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.

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

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.4
File Size Uploaded
neo_jax-1.0.4.tar.gz 55.1 kB Details

Built distribution (wheel)

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

Total release size: 115.0 kB

Release files / neo_jax-1.0.4.tar.gz

Download URL neo_jax-1.0.4.tar.gz
Size 55.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e602bf1f6adf24d42005b429d1d348f2e6437c9baf2e0efc7a79394bc74884cb
BLAKE2b-256 checksum
How to use checksums
6fefb48b52435d7855d5a435f257ae5f64930e758523892a9b89a3ffacbd5e0f
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.4-py3-none-any.whl

Download URL neo_jax-1.0.4-py3-none-any.whl
Size 59.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ab6b3836efef3be04fcee0e287f6ecd60138405d669680cd9d5b4880cbcdd2d
BLAKE2b-256 checksum
How to use checksums
a0222f684c99a8fa3205b8ac36b307659e2e77bc37e1ef526a859319d9c4c9df
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

1.0.5

2 release files

This release

1.0.4 This release

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