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.1.tar.gz (53.5 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.1-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

Details for the file booz_xform_jax-0.1.1.tar.gz.

File metadata

  • Download URL: booz_xform_jax-0.1.1.tar.gz
  • Upload date:
  • Size: 53.5 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.1.tar.gz
Algorithm Hash digest
SHA256 f247c281fe89648b39276f6677e0bb82b1e9b61cf2036e4a898a3c21f0d95bed
MD5 fc19f7555c1f91e443c91ef9fe8516a1
BLAKE2b-256 e37160a90f9a0a0144220ccce28d5f42c459aed23e6201b6b4d03fb8dfcad2d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for booz_xform_jax-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: booz_xform_jax-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 46.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7d26d2b389277b7b17fd4fa1da0e1c5b2470be0caff044f8c4aeb98f591666d
MD5 125ab1abee153aa8967960994cbdf742
BLAKE2b-256 e8f75a576530463446238c9b8cfd99407e826c31c03ae10a24cb0a14077c082a

See more details on using hashes here.

Provenance

The following attestation bundles were made for booz_xform_jax-0.1.1-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