Skip to content

Consume pyQSC_JAX external 3+5+7 field jets - #46

Draft
rogeriojorge wants to merge 3 commits into
eg/analysisfrom
refactor/pyqsc-external-field-jet
Draft

Consume pyQSC_JAX external 3+5+7 field jets#46
rogeriojorge wants to merge 3 commits into
eg/analysisfrom
refactor/pyqsc-external-field-jet

Conversation

@rogeriojorge

@rogeriojorge rogeriojorge commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • add a generic JAX magnetic-field Hessian interface;
  • consume pyQSC_JAX total-vacuum or surface-free external field jets;
  • use smooth, dimensionally normalized 3+5+7 least-squares residual blocks;
  • verify exact vacuum reduction and finite-beta external-target subtraction;
  • differentiate through real coil shapes/currents and pyQSC_JAX
    axis/physics variables;
  • add executable finite-beta stage-two and single-stage optimization
    examples.

Pressure-only stellarator examples

Both demonstrations now use public database-backed
plasma_stellarator (Wisconsin database ID 52521):

  • finite p2 and exactly I2 = 0;
  • nonplanar axis with nonzero torsion;
  • |iota| > 2.8;
  • formal radius 0.15 m;
  • normalized field, STF-gradient, and STF-Hessian residual blocks.

The single-stage design vector is (rc1, zs1, etabar, B2c); toroidal current
is fixed at zero and cannot drift toward a tokamak-like solution. Saved
metadata include the complete Fourier axis and database provenance.

Validation

  • 13 focused tests pass, including both optimization scripts in clean
    subprocesses.
  • The pressure-only regression checks finite pressure, exactly zero current,
    |iota| > 0.4, RMS torsion above 0.5 1/m, more than 10% angular
    variation in the plasma-field norm, and nonzero field/Hessian subtraction.
  • Stage two: normalized objective 6.7102e7 -> 4.4677e3; field, gradient,
    and Hessian block sums independently decrease
    4.4786 -> 0.7913, 2.0187e4 -> 72.3078, and
    2.6833e8 -> 1.7578e4.
  • Single stage: objective 6.7102e7 -> 3.0052e4; final blocks are
    0.6382, 137.638, and 1.1966e5; weighted B20 residual
    0.2930 -> 0.2514; final |iota| = 2.843, I2 = 0, and RMS torsion
    0.856 1/m.
  • Coil-shape/current and near-axis gradients agree with finite differences;
    vacuum reduction is exact.

These deliberately short runs are execution and coupled-gradient
demonstrations, not claims of device-quality global optima.

Dependency and inherited state

This draft is paired with
uwplasma/pyQSC_JAX#2;
the final boundary/VMEX hardening source commit is 060aef3. Dependency
direction remains ESSOS -> pyQSC_JAX.

The ESSOS base branch retains unrelated collection, formatting, and
documentation failures already present before this patch. They remain
disclosed rather than being mixed into the field-jet integration. No
generated optimization output is committed.

This PR should remain draft until the paired pyQSC_JAX API lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant