Pure Python JAX implementation of the Boozer coordinate transformation
Project description
booz_xform_jax
Install from PyPI:
pip install booz_xform_jax
booz_xform_jax is a JAX-native implementation of the Boozer coordinate
transformation for VMEC equilibria. It reads VMEC wout data, computes Boozer
Fourier spectra, writes boozmn NetCDF files, exposes a differentiable Python
API, and provides a legacy-compatible command line interface matching
xbooz_xform workflows.
Quickstart
Install directly from PyPI:
pip install booz_xform_jax
Install from a clone in editable mode when you want to modify the code:
git clone https://github.com/uwplasma/booz_xform_jax
cd booz_xform_jax
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .
The package installs these entry points:
booz_xform_jax
xbooz_xform
xbooz_xform_jax
CLI usage with a standard STELLOPT-style input file:
booz_xform_jax in_booz.mycase F
or, from a source checkout, using a bundled regression case:
booz_xform_jax tests/test_files/booz_in.circular_tokamak F
Python API usage:
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")
The runtime dependencies installed from PyPI already include jax, jaxlib,
netCDF4, scipy, numpy, matplotlib, and plotly, so the CLI and the
NetCDF readers/writers work after a normal pip install.
Documentation
The full documentation now lives in the docs/ tree:
- Documentation index
- Quickstart
- Theory and derivations
- Inputs and outputs
- Numerics and performance
- Examples
- STELLOPT compatibility notes
- API and source reference
- Citations
Performance Snapshot
The plots below compare booz_xform_jax and the reference xbooz_xform on a
set of bundled VMEC cases.
| Case | booz_xform_jax | xbooz_xform | Speedup |
|---|---|---|---|
| Tokamak (small, ns=16) | 0.007 s | 0.001 s | 0.2x |
| li383 stellarator (ns=48) | 0.032 s | 0.428 s | 14x |
| LSP stellarator (ns=99) | 0.040 s | 1.710 s | 42x |
| HSX (large, ns=300) | 0.627 s | 89.9 s | 143x |
Reproduce the README comparison assets with:
python tools/readme_compare.py
Project Scope
- The legacy BOOZ_XFORM input format, surface-selection conventions, and
boozmnoutput structure are supported so existing workflows transfer cleanly. - The numerical core is written in JAX and keeps the transform differentiable.
- The package includes both the object-oriented
Booz_xforminterface and a lower-level functional API inbooz_xform_jax.jax_api. - More technical background, equations, derivations, numerics, and source references have been moved from the README into the documentation.
Citation
If you use this package, cite the original Boozer-coordinate and BOOZ_XFORM literature listed in docs/citations.rst, together with this repository.
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file booz_xform_jax-0.1.0.tar.gz.
File metadata
- Download URL: booz_xform_jax-0.1.0.tar.gz
- Upload date:
- Size: 49.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2008b5b8c035733e65075384d0fb1d6fd938c69f61afb08926cb167f7b8f3060
|
|
| MD5 |
e5e4c31a9da879c541f69c800869b4ee
|
|
| BLAKE2b-256 |
76c7db4e41859f876b351630127fa9f8d33525e1c1f6250a577173cdabf35cf4
|
Provenance
The following attestation bundles were made for booz_xform_jax-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on uwplasma/booz_xform_jax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
booz_xform_jax-0.1.0.tar.gz -
Subject digest:
2008b5b8c035733e65075384d0fb1d6fd938c69f61afb08926cb167f7b8f3060 - Sigstore transparency entry: 1337359875
- Sigstore integration time:
-
Permalink:
uwplasma/booz_xform_jax@e29fce7b120fe2b57369fd5ada0112f8a24c25c7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/uwplasma
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e29fce7b120fe2b57369fd5ada0112f8a24c25c7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file booz_xform_jax-0.1.0-py3-none-any.whl.
File metadata
- Download URL: booz_xform_jax-0.1.0-py3-none-any.whl
- Upload date:
- Size: 44.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d23bd9f046d3194601ced3696dc25782a2d24288de89d9230e12e5d6f8d294a9
|
|
| MD5 |
dc935e9c34c4737292aee70003fb3123
|
|
| BLAKE2b-256 |
6ce8228de1a163d3a321546d7b5b1044ab68ff742187500b85ab5e1210cfe9c7
|
Provenance
The following attestation bundles were made for booz_xform_jax-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on uwplasma/booz_xform_jax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
booz_xform_jax-0.1.0-py3-none-any.whl -
Subject digest:
d23bd9f046d3194601ced3696dc25782a2d24288de89d9230e12e5d6f8d294a9 - Sigstore transparency entry: 1337359956
- Sigstore integration time:
-
Permalink:
uwplasma/booz_xform_jax@e29fce7b120fe2b57369fd5ada0112f8a24c25c7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/uwplasma
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e29fce7b120fe2b57369fd5ada0112f8a24c25c7 -
Trigger Event:
release
-
Statement type: