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.2+:

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.

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.3

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.3
File Size Uploaded
neo_jax-1.0.3.tar.gz 54.5 kB Details

Built distribution (wheel)

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

Total release size: 113.7 kB

Release files / neo_jax-1.0.3.tar.gz

Download URL neo_jax-1.0.3.tar.gz
Size 54.5 kB
Tags Source
SHA-256 checksum
How to use checksums
20af2399b5bc7a2e6398a822576a03b2ec5a5da04b8a3e1cbce2265d1f06ed4c
BLAKE2b-256 checksum
How to use checksums
978f0cdf0f39acd3586a1b342dadd48c0b640fa237a90db40dccb3a4000d1d04
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 1, 2026.

Transparency log

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

Download URL neo_jax-1.0.3-py3-none-any.whl
Size 59.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e441f01c0f28d9a5d210b3bbe4bac74126d3a508d4f5b212580420c2e6a62ba5
BLAKE2b-256 checksum
How to use checksums
78d7b1016887f029ce275c3d62a9fb8392d13a94cbe95a2a4797e88965535be2
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 1, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

This release

1.0.3 This release

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