Skip to main content

NEO_JAX

PyPI Tests Python License: MIT

Effective helical ripple and trapped-particle diagnostics from Boozer geometry, with CPU/GPU kernels, automatic differentiation and a legacy NEO command line.

Installation

pip install neo-jax

The VMEX → Boozer → NEO pipeline requires Python 3.11+, VMEX 0.11.6+ and booz_xform_jax 0.4.3+:

pip install "neo-jax[pipeline]"

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

Quick start

Use an existing neo_in.mycase control file and boozmn_mycase.nc:

neo-jax mycase --quiet

xneo, xneo_jax and python -m neo_jax provide the same interface. The CLI guide covers control-file lookup, progress reporting and legacy output files.

from neo_jax import NeoConfig, run_neo

config = NeoConfig(surfaces=[0.25, 0.5, 0.75], theta_n=64, phi_n=64)
results = run_neo("boozmn_mycase.nc", config=config)
print(results.epsilon_effective)  # epsilon_eff^(3/2), the legacy epstot quantity

Capabilities

Feature NEO (Fortran) NEO_JAX
CPU ✅ ✅
GPU ❌ ✅
Automatic differentiation ❌ ✅
Effective ripple and parallel current ✅ ✅
Legacy control and output files ✅ ✅
Stellarator symmetric geometry ✅ ✅
Validated nonstellarator symmetric pipeline ❌ ❌
VMEX → Boozer → NEO without intermediate files ❌ ✅

Asymmetric WOUT and boozmn inputs are rejected. Float64 is enabled by default; low-|iota| surfaces have an explicit work guard, with exact and approximate policies.

Accuracy and speed

Matched STELLOPT calculations agree in effective ripple across ORBITS and QA surfaces. The validation guide also covers NCSX, geometry, parallel current, CPU/GPU parity and legacy diagnostics.

NEO comparison

Case Surfaces Maximum relative ripple error Fortran CPU JAX CPU first / warm JAX GPU first / warm
ORBITS 2 1.5e-10 0.382 s 8.31 / 6.02 s 52.28 / 43.40 s
Landreman–Paul QA 6 1.7e-10 2.16 s 18.09 / 15.84 s —

Apple M2 CPU with JAX 0.10.2; RTX A4000 GPU with JAX 0.9.2; float64 and compilation cache disabled. Fortran includes process startup; JAX includes Boozer file reads and compilation, with imports excluded. ORBITS requests convergence history. Fortran is faster on these cases; measurements record controls, ripple profiles and timing scopes.

Callback-free QA profile: eight surfaces, 388 modes, a 32×32 grid and 24 pitch samples.

CPU kernel Cold Warm
Effective ripple 3.06 s 0.43–0.44 s

Cold includes lowering and compilation. Both exclude transforms, imports, file I/O and plotting; precision, CPU and JAX match the CPU measurements above.

Reproduce one case with a STELLOPT executable:

python benchmarks/benchmark_orbits.py --jax --warmup \
  --control tests/fixtures/orbits/neo_in.ORBITS_FAST \
  --boozmn tests/fixtures/orbits/boozmn_ORBITS_FAST.nc \
  --reference-bin xneo --output comparison.json

Differentiable pipeline

Pass a VMEX input to the host pipeline, or a solved vmex.optimize.Equilibrium to the JAX pipeline for derivatives:

from neo_jax import NeoConfig, run_vmec_boozer_neo

results = run_vmec_boozer_neo(
    "input.mycase", booz_kwargs=dict(mboz=8, nboz=8),
    neo_config=NeoConfig(surfaces=[0.25, 0.5, 0.75], theta_n=32, phi_n=32),
)

Examples cover ripple profiles, geometry derivatives and optimization. The large NCSX fixture is fetched on demand with neo_jax.ncsx_boozmn_path(download=True).

Documentation and citation

Quickstart · Theory · Configuration · Numerics · Differentiability · API · References

Cite the NEO literature in the bibliography, together with this repository. Licensed under MIT.

Metadata

Release files for neo-jax 1.0.5

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

Source distribution (sdist)

Source distribution for neo-jax 1.0.5
File Size Uploaded
neo_jax-1.0.5.tar.gz 55.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for neo-jax 1.0.5
File Interpreter ABI Platform
neo_jax-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 115.8 kB

Release files / neo_jax-1.0.5.tar.gz

Download URL neo_jax-1.0.5.tar.gz
Size 55.5 kB
Tags Source
SHA-256 checksum
How to use checksums
34f473d855482ac883ea231564c7e24d4f7f4f961822b25403637454a272f7a1
BLAKE2b-256 checksum
How to use checksums
8558797e11b4feae4637536f5177d3b1933c1f7e60f83adfbd4df98aeca526ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 2, 2026.

Transparency log

Release files / neo_jax-1.0.5-py3-none-any.whl

Download URL neo_jax-1.0.5-py3-none-any.whl
Size 60.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64339cb6d77fd8d9a818988f576da20c0de3655b9cb0b9402a0173a89201b457
BLAKE2b-256 checksum
How to use checksums
752416db8e812c63bcdb8e30e739017e9f3dd2c737522195a88e7836619ce360
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.6

2 release files

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

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