vmec_jax.fourier

Helical Fourier basis utilities.

VMEC represents surfaces using Fourier series in the helical phase:

phase = m*theta - n*zeta

where zeta is the field-period toroidal angle (one field period spans [0, 2π)).

This module provides:

  • basis matrices (cos/sin of phase) for a set of (m,n) modes,

  • evaluation of a scalar field from (cos, sin) Fourier coefficients,

  • evaluation of angular derivatives, including the physical-toroidal derivative that includes the NFP scaling used in VMEC.

All functions are backend-agnostic: they use jax.numpy if available, otherwise NumPy.

Functions

build_helical_basis(modes, grid, *[, cache])

Precompute cos/sin(phase) tensors.

project_to_modes(f, basis, *[, normalize])

Project a real-space field f(theta,zeta) onto the helical Fourier basis.

register_pytree_node_class(cls)