Complete pyQSC_JAX refactor with pyQSC parity and plasma–coil field jets - #2
Draft
rogeriojorge wants to merge 39 commits into
Draft
Complete pyQSC_JAX refactor with pyQSC parity and plasma–coil field jets#2rogeriojorge wants to merge 39 commits into
rogeriojorge wants to merge 39 commits into
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete foundational refactor of pyQSC_JAX into an immutable,
autodifferentiable near-axis stellarator library while preserving the ESSOS
pyqsc_jax.near_axis.near_axiscontract.The branch now includes:
first-order solves;
gradient/Hessian, Mercier, singular-radius, and Maxwell diagnostics;
elimination, criteria, and branch-aware axis optimization;
derivation, with a mandatory formal radius and asymptotic metadata;
magnetic well, energy, volume, and aspect ratio;
examples, publication figures, documentation, CI, and packaging.
Final integration hardening
validates finite positive radii, and refuses to write an invalid boundary.
traced candidates receive nonfinite boundary coefficients rather than a
silently different equilibrium.
QA database ID 139524, a nonplanar axis with RMS torsion
1.189 1/m.PYQSC_RUN_VMEX=1), so an installedVMEX does not unexpectedly turn the ordinary example matrix into a
multi-minute equilibrium run.
uwplasma/ESSOS#46 now uses
finite-pressure, exactly zero-current database stellarator ID 52521 for
both stage-two and single-stage demonstrations;
I2is not a single-stagedesign variable.
Screened showcase
The README gallery uses public Wisconsin stellarator-database QA
139524, QH
3, B20-refinement seed
57409, and
large-clearance case
107579.
|iota| = 0.355, finite pressure,exactly
I2 = 0, nonzero torsion, and passes the configurable Curvocriteria with the requested QA
|iota| >= 0.3gate.|iota| >= 0.4.|iota| = 2.964,r_singularity = 0.249 m, and weighted B20 residual1.2743e-10atnphi=121, stable throughnphi=481.p2, exactlyI2 = 0,|iota| = 2.809, RMS torsion0.979 1/m, and 14.04% angular variationin the pressure-driven plasma-field norm.
a = 0.15 misreported honestly as about 0.19%. The former 30% finite-current,
tokamak-like showcase was removed; current-driven physics remains supported
and tested, but it is not used in user-facing finite-beta examples.
Validation
dcacea2: all required GitHub checks pass on macOS andUbuntu with Python 3.12/3.14, including docs, package, Codecov, frozen
contracts, clean ESSOS, and live current-main VMEX. The only skipped job is
the intentionally schedule/manual-only upstream-head smoke.
skips; the branch-coverage run measured 98.75% lines and
95.898% branches.
opt-in skips.
cases pass. The finite-pressure case has signed on-axis-iota error
0.02143% and maximum force residual 9.97e-12.
2a40d756: 2 passed, coveringvacuum and finite-beta/zero-current radial iota, QS, magnetic well, and
implicit boundary/pressure gradients.
da66774: 13 passed, including both optimizationscripts in clean subprocesses; field, gradient, and Hessian blocks all
decrease in stage-two and single-stage runs.
nphi=121comparison to audited pyQSC commitcd75359:maximum scalar delta
8.02e-12, geometry/sigma delta3.40e-14, and r2array delta
1.11e-11.twine check; independent clean installs pass physics,VMEC-boundary, and
pip checksmokes.directories; the headline README figures were visually inspected.
Architecture and release state
Core runtime dependencies remain unpinned
jaxandsolvax; plotting andVMEX are optional. pyQSC_JAX has no ESSOS dependency. The legacy mutable class
is a thin adapter around immutable pytrees, with no import-time JAX
configuration or mutable global physics state.
This remains a draft review PR. TestPyPI/PyPI trusted-publisher setup,
maintainer approval and merge, release-version/date metadata, and Zenodo DOI
creation are external release gates. No release tag is proposed here.