Skip to content

Moving Hermite basis 3/5: exact triangular remap with caps and an event record - #58

Open
rogeriojorge wants to merge 2 commits into
adaptive/p2-moving-termsfrom
adaptive/p3-remap
Open

rogeriojorge wants to merge 2 commits into
adaptive/p2-moving-termsfrom
adaptive/p3-remap

Conversation

@rogeriojorge

Copy link
Copy Markdown
Member

Adds an exact segment remap (u, a) -> (u', a') per species and axis (Pagliantini et al., arXiv 2208.14373, Def. 1).

  • remap_matrix builds T[m,n] (h_m(A xi + B) on h_n(xi), with A = a/a', B = (u-u')/a') by recurrence in O(N^2). It is exactly lower-triangular with T_nn = A^n.
  • remap applies T separably with the (a/a')^3 normalization. It is pure and differentiable.
  • moment_target gives the moment-matched basis: U = u + a g1/(sqrt2 g0), a' = sqrt2 sigma.
  • cap_target clips the target: |du| <= a', a/a' <= 1.1, a' >= 1.1 sigma. Widening is free.
  • remap_event refuses moves outside the caps. It records the time, both bases, per-species tail fractions and the low-moment defect.

Why the caps: conditioning grows like (a/a')^N when the basis narrows, and like (du/a)^N/sqrt(N!) with the shift. With measured cond tables, a coherent displacement d >= 3 cannot be remapped at N >= 32. Large coherent shifts belong to the pump frame (PR 2/5).

Tested SHA 13405b8. Command: python -m pytest -q -n 2 tests. Result: 170 passed.

New tests (tests/test_remap.py):

  • T agrees with Gauss-Hermite quadrature to 1e-13 for N up to 40; it is lower-triangular with diagonal A^n.
  • Every mixed moment v_x^i v_y^j v_z^k with i < Nn, j < Nm, k < Np is preserved to 1e-12 against quadrature (unequal orders, 2 species).
  • The round trip is the identity to 1e-13.
  • The generator d/ds T(u + u_dot s, a + a_dot s) at s = 0 equals basis_rate_terms to 1e-12.
  • Shifted and heated Maxwellians: the target is recovered and the remap gives delta_n0 to 1e-13.
  • Caps are enforced and clipped.
  • Landau k lambda_D = 0.5, Nn = 128: a run remapped at t = 5 to (0.3 a, 1.1 a) tracks the fixed-basis E_k to 5e-7 relative. Both fit gamma = -0.1537 (reference -0.1534).

Stack: base adaptive/base = integration/dark-baseline 9d0982d (main ab87385 + #48, #46, #13, #12, #9, #55, #50, #44, #18, #51). This lands on main after those foundation PRs and the earlier PRs of this stack (#56 first). Local results only (macOS, Python 3.12, JAX 0.11.2, x64); GitHub CI on this branch has not been checked yet.

…cord

remap_matrix builds T[m,n] (h_m(A xi + B) in the h_n basis) by recurrence; remap
applies it per species and axis with the (a/a') normalization, preserving every
moment of order below the truncation. moment_target gives the moment-matched
(U, sqrt(2) sigma) basis, cap_target clips it (|du| <= a', a/a' <= 1.1, a' >= 1.1 sigma),
remap_event refuses moves outside the caps and records tail fractions and the
moment defect for replay.
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