Skip to main content

booz_xform_jax

PyPI Tests Python License: MIT

Boozer coordinate transforms for VMEC and VMEX equilibria, with differentiable JAX kernels and legacy BOOZ_XFORM input and output files.

Installation

pip install booz_xform_jax

For NVIDIA GPUs, install JAX with CUDA support in the same environment. For development, use pip install -e .[dev] in a clone.

Quick start

Use a STELLOPT control file with booz_xform_jax, xbooz_xform_jax or xbooz_xform:

booz_xform_jax in_booz.mycase F
from booz_xform_jax import Booz_xform

bx = Booz_xform()
bx.read_wout("wout_mycase.nc", flux=True)
bx.register_surfaces([0.25, 0.5, 0.75])
bx.run()
bx.write_boozmn("boozmn_mycase.nc")

Use bx.run_jax() or the functional API for compiled transforms and jax.grad, jax.jvp and jax.vmap. Examples cover geometry, resolution scans and optimization.

Capabilities

Feature BOOZ_XFORM (Fortran) booz_xform_jax
CPU ✅ ✅
GPU ❌ ✅
Automatic differentiation ❌ ✅
Stellarator symmetric geometry ✅ ✅
Nonstellarator symmetric geometry, including sine spectra ✅ ✅
Legacy control files and NetCDF boozmn output ✅ ✅

Accuracy and speed

Matched CLI transforms agree with STELLOPT BOOZ_XFORM to double precision, including nonzero sine coefficients. Times below include process startup and file I/O: Apple M2 CPU, float64, fastest of three fresh processes, compilation cache disabled.

Boozer transform runtime

Equilibrium Surfaces Relative L2 error in cosine and sine spectra Fortran JAX
Circular tokamak 3 4.8e-15 0.10 s 0.82 s
Up/down asymmetric tokamak 3 1.0e-14 0.10 s 0.82 s
li383 4 4.9e-15 1.16 s 0.91 s
Landreman–Sengupta–Plunk 4 5.7e-15 1.72 s 0.95 s

Fortran is faster on the small tokamak cases; JAX is faster on these stellarator cases. JAX process startup takes 0.71 s; full-process peak memory is 224–514 MiB versus 12–71 MiB for Fortran. Measurements include resolution and memory; the memory plot shows all four cases.

Compiled Python transforms amortize their first-call cost:

li383, 48 surfaces, mboz=nboz=16 First call Warm call
JAX, x86-64 CPU 0.446 s 0.0830 s
JAX, RTX A4000 GPU 0.728 s 0.00629 s

These synchronized kernel measurements use JAX 0.9.2 and exclude setup and file I/O. CPU and GPU records include derivative timings and source revisions.

Reproduce the CLI comparison with a STELLOPT xbooz_xform executable on PATH:

python tools/readme_compare.py --repeats 3

Documentation

Quickstart · Theory · Inputs and outputs · Numerics · STELLOPT compatibility · API

Citation and license

Cite the Boozer-coordinate and BOOZ_XFORM literature in the bibliography, together with this repository. Licensed under MIT.

Metadata

Release files for booz-xform-jax 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for booz-xform-jax 0.5.1
File Size Uploaded Provenance Actions
booz_xform_jax-0.5.1.tar.gz 69.4 kB With provenance Details for booz_xform_jax-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for booz-xform-jax 0.5.1
File Interpreter ABI Platform Actions
booz_xform_jax-0.5.1-py3-none-any.whl Python 3 none any Details for booz_xform_jax-0.5.1-py3-none-any.whl

Total release size: 120.6 kB

Release files / booz_xform_jax-0.5.1.tar.gz

Download URL booz_xform_jax-0.5.1.tar.gz
Size 69.4 kB
Tags Source
SHA-256 checksum
How to use checksums
553cdd33c1b1a0c158f9d29c7d4737ab24f1626b96e872459bbf0317405a9463
BLAKE2b-256 checksum
How to use checksums
a9d61c7d599d8d9fd81b5ebce35181ce68c9eb02025bd3c839046846f8287407
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / booz_xform_jax-0.5.1-py3-none-any.whl

Download URL booz_xform_jax-0.5.1-py3-none-any.whl
Size 51.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c54b3370c74b72b3c9c79b204210a3408b60a988667d3c6eb1b780ac637582c8
BLAKE2b-256 checksum
How to use checksums
26a84f011f642b83e0c9de726132c780975e6121bda339fb8e7ecd2f03f5754b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for booz-xform-jax 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for booz_xform_jax-0.5.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page