vmec_jax.vmec_forces

VMEC force/residue kernels for parity work.

This module implements a direct, array-based port of VMEC2000’s forces core for the R/Z equations, operating on:

  • VMEC even/odd-m real-space decomposition (odd stored in 1/sqrt(s) form),

  • half-mesh quantities from vmec_jax.vmec_bcovar.

Scope

This is a parity/debug kernel used to validate the algebra and staggering. It is not yet the full VMEC solver pipeline (no vacuum/free boundary, no 2D preconditioner, and no full lambda residue parity), but it does include the VMEC constraint-force pipeline (tcon + alias) for fixed-boundary parity.

Functions

rz_residual_coeffs_from_kernels(k, *, static)

Compute Fourier-space residual coefficients gcr/gcz from force kernels.

rz_residual_scalars_like_vmec(coeffs, *, bc, ...)

Compute VMEC-like invariant scalars for the R/Z residuals.

vmec_forces_rz_from_wout(*, state, static, wout)

Compute VMEC R/Z force kernels (armn/brmn/...) from a wout equilibrium.

vmec_forces_rz_from_wout_reference_fields(*, ...)

Compute VMEC R/Z force kernels using wout's stored (sqrtg, bsup, |B|).

vmec_residual_internal_from_kernels(k, *, ...)

Compute internal residual coefficient arrays using VMEC's tomnsps conventions.

Classes

VmecConstraintKernels(rcon_force, ...)

Constraint-force kernels produced by the alias pipeline.

VmecInternalResidualRZL(frcc, frss, fzsc, ...)

Internal VMEC-style residual arrays produced by tomnsps (+ tomnspa when lasym=True).

VmecRZResidualCoeffs(gcr_cos, gcr_sin, ...)

VmecRZResidualScalars(fsqr_like, fsqz_like)