Spectrax 1D Solver
Example decks live in configs/spectrax-1d/. To run one:
uv run run.py --cfg configs/spectrax-1d/landau-damping
A Hermite-Fourier spectral solver for the Vlasov-Maxwell system. Unlike the grid-based Vlasov-1D solver, velocity space is not discretized onto a mesh — it is expanded in a Hermite basis, so the kinetic state is a set of spectral coefficients rather than a sampled \(f(x, v)\).
Equations and Quantities
We solve the Vlasov equation for each species \(s\) coupled to Maxwell’s equations:
Normalization is time in \(\omega_{pe}^{-1}\), length in \(c/\omega_{pe}\), so that \(c = 1\) and \(\omega_{pe} = 1\).
The distribution function is expanded in an asymmetrically-weighted Hermite basis in each velocity direction and a Fourier basis in space:
where each \(\psi\) is scaled by a per-species thermal velocity \(\alpha_s\) and shifted by a drift
\(u_s\) (alpha_s and u_s in the config). Substituting the expansion turns the Vlasov equation into
a coupled set of ODEs for the coefficients \(C^s_{nmp}(\mathbf{k}, t)\). Free-streaming and the
Lorentz force each couple only to neighbouring Hermite indices — the three-term recurrence of the
Hermite ladder operators \(\sqrt{n}\), \(\sqrt{n+1}\) — so the right-hand side stays sparse in mode
index.
Maxwell’s equations are advanced in the same Fourier space, with the plasma current obtained directly from the first-order Hermite coefficients.
Note that although the module is named “1D”, the state carries \((N_x, N_y, N_z)\) Fourier modes and \((N_n, N_m, N_p)\) Hermite modes. 1D problems are the case where the transverse mode counts are set to 1; the velocity space remains three-dimensional.
Closure and Filtering
The Hermite hierarchy has to be truncated, and a sharp truncation reflects energy back down the spectrum as filamentation in velocity space. Two mechanisms control this:
Hypercollisions — a damping rate proportional to mode index (
physics.nu), which acts most strongly on the highest Hermite modes and leaves the low-order moments essentially untouched.Hou-Li filter — an exponential mask \(\sigma(h) = \exp(-\text{strength} \cdot (h/h_{max})^{\text{order}})\) applied across the Hermite indices (
drivers.hermite_filter).
Solver Options
Time Integration
exponential(default, recommended) — Lawson-RK4. The linear part of the system (free-streaming, the Maxwell curls, and the collision operator) is factored out into exact matrix exponentials, which removes the CFL stiffness those terms would otherwise impose. Only the nonlinear terms (Lorentz force, plasma current) are integrated explicitly.explicit— a plain Runge-Kutta method throughdiffrax(Dopri8by default). Simpler, but the timestep is limited by the stiffest linear term.
Both support adaptive stepping via grid.adaptive_time_step. For the exponential integrator this
uses an embedded 2nd-order Lawson-Heun companion to control error on the nonlinear term alone.
Field Solver
Maxwell’s equations are solved spectrally. Setting physics.static_ions: true freezes the ion
distribution at its initial Maxwellian — ion current is dropped from Ampère’s law and ion
free-streaming is bypassed. At electron plasma wave frequencies \(\omega / k v_{th,i} \gg 1\), so this
leaves the dispersion unchanged while cutting the cost roughly in half.
Entry Points
Three solver: keys share this module and differ only in post-processing:
|
Purpose |
|---|---|
|
Full Hermite-Fourier Vlasov-Maxwell |
|
Adds electron plasma wave diagnostics — first-mode amplitude, instantaneous frequency from the phase evolution, and Hermite coefficient spectra |
|
Adds electromagnetic dispersion diagnostics — measures the \(k=1\) transverse mode frequency against \(\omega^2 = \xi^2 + 1\), and an absorption ratio for checking sponge layers |
Boundary Conditions
Axis / quantity |
Condition |
Notes |
|---|---|---|
\(x, y, z\) |
Periodic |
The spatial representation is Fourier, so periodicity is structural. A 2/3 dealiasing mask is applied in Fourier space. |
Velocity |
None — spectral |
There is no velocity grid and therefore no velocity boundary. The truncation of the Hermite hierarchy plays the role a velocity boundary plays elsewhere, which is why the closure and filtering below matter so much. |
\(x\) (optional) |
Sponge layer |
An absorbing layer can be applied through spatial damping profiles — separate coefficients for the EM fields, the electrons, and the ions. Sponge layers make the linear operator stiff, which is the case the split-step exponential integrator exists to handle. |
Forcing and Drivers
Block |
What it does |
|---|---|
|
Prescribed field drivers, one per component, keyed by pulse index. Each has |
|
Stochastic density noise injected into the \((0,0,0)\) Hermite mode every timestep, configurable per species with independent amplitudes and a seed. This is what seeds an instability from a clean initial condition. |
|
Not forcing but the counterpart to it: Hou-Li exponential damping of the high Hermite modes. |
What Gets Saved
binary/:
File |
Contents |
|---|---|
|
EM fields in Fourier space, per axis |
|
Derived field diagnostics |
|
Real-space density, velocity, and temperature moments |
|
The Hermite-Fourier coefficients \(C_k\) |
|
Scalar time series — EM energy, peak fields |
|
Consolidated views |
plots/:
File |
Contents |
|---|---|
|
Mode amplitude histories |
|
Space-time plots and lineouts per field |
|
Hermite spectra — the diagnostic to watch for filamentation |
|
Per-field and per-scalar plots |
The hermite-epw-1d entry point adds epw_mode1_diagnostics.png and
epw_hermite_coefficients_2x2.png; hermite-maxwell-1d adds em_wave_k1_diagnostics.png.
A default save (scalar diagnostics) is always added automatically at every grid timestep, so you
get scalars even with an empty save block.
Configuration Reference
See the Configuration Reference for complete YAML schema documentation.