Skip to main content

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:

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 boozmn output 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_xform interface and a lower-level functional API in booz_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

booz_xform_jax-0.1.0.tar.gz (49.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

booz_xform_jax-0.1.0-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

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

Hashes for booz_xform_jax-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2008b5b8c035733e65075384d0fb1d6fd938c69f61afb08926cb167f7b8f3060
MD5 e5e4c31a9da879c541f69c800869b4ee
BLAKE2b-256 76c7db4e41859f876b351630127fa9f8d33525e1c1f6250a577173cdabf35cf4

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for booz_xform_jax-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d23bd9f046d3194601ced3696dc25782a2d24288de89d9230e12e5d6f8d294a9
MD5 dc935e9c34c4737292aee70003fb3123
BLAKE2b-256 6ce8228de1a163d3a321546d7b5b1044ab68ff742187500b85ab5e1210cfe9c7

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page