vmec_jax.vmec_jacobian

VMEC-style half-mesh Jacobian construction.

This module ports the core logic of VMEC2000’s jacobian.f / jacobian_par into a small, dependency-light implementation.

Motivation

VMEC uses an internal representation in which odd-m Fourier content is stored in a 1/sqrt(s) form for axis regularity. In real space, many quantities are represented as:

X(s,θ,ζ) = X_even(s,θ,ζ) + sqrt(s) * X_odd(s,θ,ζ)

VMEC then constructs several derivatives and the Jacobian on the radial half mesh with explicit correction terms arising from d/ds sqrt(s).

The direct Cartesian cross-product Jacobian in vmec_jax.geom is fine for many uses, but does not match VMEC’s discrete half-mesh convention used for Nyquist wout fields like gmnc/gmns. This module exists specifically for parity work.

Functions

jacobian_half_mesh_from_parity(*, pr1_even, ...)

Compute half-mesh Jacobian quantities using VMEC's discrete formula.

vmec_half_mesh_jacobian_from_state(*, state, ...)

Compute VMEC half-mesh Jacobian directly from Fourier coefficients.