vmec_jax.vmec_constraints

VMEC constraint pipeline pieces (alias / gcon) for parity work.

VMEC uses a “constraint force” to maintain polar regularity and enforce internal relationships near the magnetic axis. In the VMEC2000 fixed-boundary pipeline:

  1. totzsps produces real-space constraint-like arrays rcon, zcon

  2. funct3d forms a scalar field

    ztemp = (rcon - rcon0)*ru0 + (zcon - zcon0)*zu0

  3. alias computes gcon from ztemp via a de-aliased spectral operator

  4. forces uses gcon to add constraint force kernels and to form the arcon/azcon arrays passed to tomnsps.

This module ports the core of VMEC’s alias.f needed for parity diagnostics.

Notes

The overall constraint strength depends on tcon(js), which VMEC computes in bcovar.f from preconditioner-related quantities. For parity work we provide a tcon_from_tcon0_heuristic that matches VMEC’s scaling structure but does not yet reproduce the full bcovar computation.

Functions

alias_gcon(*, ztemp, trig, ntor, mpol, ...)

Compute VMEC's gcon field from ztemp (alias.f).

faccon_from_signgs(*, mpol, signgs[, dtype])

Compute VMEC's faccon(m) array (fixaray.f).

precondn_diag_axd1_from_bcovar(*, trig, s, ...)

Compute VMEC precondn diagonal outputs axd(:,1) for R/Z-like calls.

tcon_from_bcovar_precondn_diag(*, tcon0, ...)

Compute VMEC-like tcon(js) using the diagonal precondn pieces from bcovar.f.

tcon_from_cached_precondn_diag(*, tcon0, ...)

Compute tcon(js) from cached precondn diagonal outputs and current ru0/zu0 norms.

tcon_from_precondn_axisym(*, tcon0, bc, k, ...)

Compute tcon(js) from a VMEC-style axisymmetric preconditioner diagonal.

tcon_from_tcon0_heuristic(*, tcon0, s, trig, ...)

Heuristic tcon(js) profile (placeholder for VMEC's bcovar-derived tcon).

Classes

VmecConstraintTables(faccon, tcon)