vmec_jax.qi_optimizationΒΆ
Support routines for staged bounded QI optimization.
The public example script keeps the user-facing workflow visible: configure
inputs, construct objective tuples, call least_squares_solve, then save/plot
outputs. This module holds the reusable seed-preconditioning, stage-promotion,
and checkpoint helpers used by that script and sweep drivers.
Functions
|
Apply optional command-line overrides to a QI example namespace. |
|
Rank prefilter candidates by QI/iota first, engineering second. |
|
Rank reference-family candidates by gates first, then exact metrics. |
|
Return whether a preconditioner summary record satisfies safe gates. |
|
Install script-level constants used by the staged helper routines. |
|
Return a scalar diagnostic value, or |
|
Rank already-gated candidates by QI first and mirror second. |
|
Convert NumPy/JAX-like values into JSON-serializable containers. |
|
|
|
Build a typed staged-QI helper context from script constants. |
|
Write root-level stage input files from an optimization result. |
|
Lower score means a better exact-diagnostic QI candidate. |
|
|
|
Independent QI diagnostics for a raw fixed-boundary VMEC run. |
|
Return the stage mode sequence for the QI example workflow. |
|
Run a bounded large-step prefilter and return the selected input deck. |
|
Scan same-NFP reference-family boundary jumps and return the selected input. |
|
Run the guarded staged QI policy and return |
|
Insert deterministic 1e-5 target-helicity modes before local QI solves. |
|
Save the unpreconditioned VMEC input deck and its solved WOUT. |
|
|
|
Apply the script's staged promotion rule to exact diagnostics. |
|
Return deterministic low-order perturbations for circular/minimal seeds. |
|
Persist QI stage metrics before root finalization can be reached. |
Classes
|
Explicit staged-QI controls shared by helper routines. |