Skip to content

feat: mixed Hermite-Legendre 1D Vlasov-Poisson solver (arXiv:2606.12322)#289

Open
joglekara wants to merge 3 commits into
mainfrom
feat/hermite-legendre-1d
Open

feat: mixed Hermite-Legendre 1D Vlasov-Poisson solver (arXiv:2606.12322)#289
joglekara wants to merge 3 commits into
mainfrom
feat/hermite-legendre-1d

Conversation

@joglekara

Copy link
Copy Markdown
Member

Summary

New ADEPTModule (hermite-legendre-1d) implementing the mixed Hermite–Legendre spectral method of Issan, Delzanno & Roytershteyn (arXiv:2606.12322) for the 1D-1V electrostatic Vlasov–Poisson system.

The electron distribution is split f = f0 + δf:

  • f0 (near-Maxwellian bulk) → asymmetrically-weighted (AW) Hermite expansion in velocity, coeffs C_n(x,t)
  • δf (strongly non-Maxwellian features: beams, plateaus, filamentation) → Legendre expansion on a bounded velocity window [v_a, v_b], coeffs B_m(x,t)

The highest Hermite coefficient C_{Nh-1} feeds the Legendre modes (one-way), and both feed the field through Poisson. At fixed total velocity DOFs the mixed method is more accurate than pure Hermite or pure Legendre when non-Maxwellian features are localized in velocity.

Structurally modeled on BaseVlasov1D; reuses the Lawson-RK4 design of the sibling _hermite_poisson_1d.

Design notes

  • Explicit time integration by choice. Both free-streaming operators are symmetric-tridiagonal in mode index (Hermite eqn 7, Legendre eqn 11), so each is integrated exactly via a prediagonalized matrix exponential; the E-field force, the Legendre Dirichlet penalty, and the Hermite→Legendre coupling go in an explicit Lawson-RK4 stage. The paper uses an implicit-midpoint/JFNK integrator for machine-precision energy conservation, but that carries a large memory footprint — so this module uses an explicit integrator instead. Consequence: mass and momentum are conserved to machine precision; energy to the time-integrator order (dt-convergent, ~4e-8 at dt=1e-2).
  • Space is spectral (Fourier, periodic) rather than the paper's 2nd-order central FD — required for the exact free-streaming exponential and consistent with the other ADEPT spectral solvers.
  • Conservation constraint J_{Nh,0}=J_{Nh,1}=J_{Nh,2}=0 (paper §3.4/§4) and Lenard-Bernstein artificial collisions (cubic spectrum, zero on the first three moments) are both implemented and config-exposed.

What's included

  • adept/_hermite_legendre_1d/{vector_field,modules,storage}.py + public entry; registered in _base_ dispatch and adept.__init__
  • Configs: configs/hermite-legendre-1d/{linear-advection,two-stream,bump-on-tail}.yaml (paper parameters)
  • Docs: docs/source/solvers/hermite_legendre_1d/config.md + quick links

Validation

  • Linear advection (§4.2): reconstructed f = f0 + δf matches the analytic f(x−vt, v, 0) to <2% L2 before recurrence.
  • Conservation (§3, two-stream, J=0 enforced): mass & momentum to ~1e-13; energy to ~1e-5 (time-integration-limited, dt-convergent).
  • Unit: streaming-matrix eigenvalues match Gauss nodes (Golub–Welsch); J_{Nh,m} parity matches eqns 27/29/34.
  • End-to-end: uv run run.py --cfg configs/hermite-legendre-1d/linear-advection runs through ergoExo/MLflow to completion.
  • uv run pytest tests/test_hermite_legendre_1d12 passed.

Test plan

  • uv run pytest tests/test_hermite_legendre_1d -q
  • uv run run.py --cfg configs/hermite-legendre-1d/two-stream → phase-space vortex (Fig 8), flat conservation diagnostics (Fig 7)

🤖 Generated with Claude Code

joglekara and others added 3 commits June 14, 2026 22:24
New ADEPTModule implementing the mixed Hermite-Legendre spectral method of
Issan, Delzanno & Roytershteyn (arXiv:2606.12322) for the 1D-1V electrostatic
Vlasov-Poisson system. The electron distribution is split f = f0 + df: the
near-Maxwellian bulk f0 is expanded in the AW-Hermite basis, while the
strongly non-Maxwellian part df is expanded in the Legendre basis on a bounded
velocity window. The two are coupled one-way (highest Hermite mode -> Legendre)
and through Poisson.

Modeled structurally on BaseVlasov1D and reusing the Lawson-RK4 design of
_hermite_poisson_1d. Both free-streaming operators are symmetric-tridiagonal in
mode index, so each is integrated exactly via a prediagonalized matrix
exponential; the E-field force, the Legendre Dirichlet penalty, and the
Hermite->Legendre coupling are advanced explicitly. Space is spectral (Fourier,
periodic). An explicit integrator is used by choice (the paper's implicit
midpoint has a large memory footprint): mass and momentum are conserved to
machine precision, energy to the time-integrator order (dt-convergent).

- adept/_hermite_legendre_1d/{vector_field,modules,storage}.py + public entry
- registered as solver "hermite-legendre-1d" in _base_ dispatch and adept.__init__
- conservation constraint J_{Nh,0..2}=0 and Lenard-Bernstein artificial collisions
- configs: linear-advection, two-stream, bump-on-tail (paper parameters)
- tests: streaming/J-integral units, linear advection vs analytic, conservation
- docs: solvers/hermite_legendre_1d/config.md + quick links

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…u test

Adds to the mixed Hermite-Legendre solver:

- External longitudinal `ex` driver (ExternalExDriver), mirroring the vlasov1d /
  hermite_poisson `ex` driver: a prescribed E added to the velocity-space force
  (never enters Poisson), e.g. a resonant EPW kick. Saved as `de` in fields.

- IMEX integrator (grid.integrator: imex). The explicit Lawson-RK4 step blows up
  once the E.d_v f Lorentz force gets stiff (operator norm ~Nl^2/width*|E| for the
  Legendre block, the dominant term). IMEX keeps streaming/collisions/closure-flux
  explicit and advances the Lorentz force with an unconditionally stable frozen-E
  Backward-Euler substep (first-order Lie split), mirroring _spectrax1d/imex_E.py.
  Two-stream then runs stably at dt=0.02 (vs explicit's 0.002), mass conserved to
  ~1e-12. Current impl uses a per-x dense solve; structured (bidiagonal/Woodbury)
  solve noted as the large-Nx optimization.

- Driven Landau-damping test (test_landau_damping): drives a uniform Maxwellian at
  the resonant (k0, w0) and measures E_x(k1) ringing -- frequency matches the
  kinetic dispersion to <1%, damping to ~5-9% (finite-Nh Hermite).

- IMEX stability test (test_imex): explicit blows up at dt=0.01, IMEX stays finite
  and conserves mass.

- Fix: _hermite_function_values overflowed float64 at Nh>=171 (formed 2^n n!
  directly), silently zeroing the J_{Nh,m} coupling -- now a stable normalized
  recurrence. Seed the t=0 field diagnostics from the actual Poisson field.

- two-stream.yaml dt 0.01 -> 0.002 (explicit CFL); add two-stream-imex.yaml.

Suite: 16 passed. Two-stream works in both explicit and IMEX; bump-on-tail (the
hardest case: asymmetric domain, weak instability, long time) still blows up near
saturation in both -- needs the implicit-midpoint path (next commit).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… preconditioner

Adds `grid.integrator: implicit` -- the implicit-midpoint rule
y1 = y0 + dt F((y0+y1)/2) solved by Jacobian-free Newton-Krylov, with the Jacobian
applied as an EXACT autodiff JVP (jax.linearize) to a matrix-free GMRES
(jax.scipy.sparse.linalg.gmres). The Jacobian is never assembled (memory is the state
plus a few Krylov vectors), so it is the laptop-feasible method the paper uses, here
realized with autodiff. Complex coefficients are carried as real (re,im) pytree leaves
so the Krylov inner products are the standard real ones.

Implicit midpoint is A-stable (no CFL) and conserves quadratic invariants: on two-stream
it conserves mass exactly and energy to the solve tolerance (2nd order in dt), and is
stable far past where explicit/IMEX die.

Preconditioning (`grid.precondition: true`, default) is essential -- unpreconditioned
GMRES stalls on the skew streaming spectrum and Newton then injects energy. The
preconditioner M = I - dt/2(L_stream + L_force) is applied as a composition of cheap
structured solves: streaming is block-diagonal in k and tridiagonal in mode (per-k
tridiagonal solve); the Hermite force is lower-bidiagonal and the Legendre force is
dominated by the lower-triangular derivative matrix (per-x triangular solves; the rank-2
Dirichlet penalty is left to GMRES). This takes bump-on-tail's linear-phase energy drift
from 928% (unpreconditioned) to ~1e-9.

Config knobs: integrator, precondition, newton_iters, gmres_restart/maxiter/tol.

bump-on-tail.yaml -> integrator: implicit, precondition, dt=0.02. The bump saturation
phase needs a small step for the nonlinear solve to converge (the paper uses dt=0.01);
large-dt robustness at saturation is the motivation for a learned preconditioner
(follow-up). test_implicit gates mass-exact / energy-conserving implicit midpoint on
two-stream. Suite: 17 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant