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 ✅ ✅
Nonstellarator symmetric geometry ✅ ✅
VMEX → Boozer → NEO without intermediate files ❌ ✅

File and differentiable pipelines retain both cosine and sine geometry. 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.6

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.6
File Size Uploaded
neo_jax-1.0.6.tar.gz 55.5 kB Details

Built distribution (wheel)

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

Total release size: 115.8 kB

Release files / neo_jax-1.0.6.tar.gz

Download URL neo_jax-1.0.6.tar.gz
Size 55.5 kB
Tags Source
SHA-256 checksum
How to use checksums
be70c48e7475aefeab2a2358c8a93d8b2c21ee1805c1951a58e756b399b23a56
BLAKE2b-256 checksum
How to use checksums
31bc1b684ab343ef8cc21e42f4a6931495fd40d4ee1bad68e0de3dec194c225e
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 15, 2026.

Transparency log

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

Download URL neo_jax-1.0.6-py3-none-any.whl
Size 60.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25fc769e01cea525783a09f8175cc531c0707be86c33430850236116f867509b
BLAKE2b-256 checksum
How to use checksums
4ddeaff5180a384116401940f5a4e3ef32b3dcc5fa5ac7c071dce999828c79db
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 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

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