Skip to content

[math-04] Derive the charge-potential integral kernels#216

Draft
marjohma wants to merge 2 commits into
fix/kim-fp-194-susceptibility-oraclefrom
fix/kim-fp-196-charge-kernel-oracle
Draft

[math-04] Derive the charge-potential integral kernels#216
marjohma wants to merge 2 commits into
fix/kim-fp-194-susceptibility-oraclefrom
fix/kim-fp-196-charge-kernel-oracle

Conversation

@marjohma

Copy link
Copy Markdown
Member

Summary

  • derive diagonal and off-diagonal charge-potential kernel formulas
  • record normalization, Bessel, harmonic, and limiting checks
  • commit deterministic kernel oracle fixtures and update formula provenance

Why

The Fourier charge kernel has a source-derived normalization and sign oracle.

Validation

Validated cumulatively at the stack head:

  • cmake --build build -j2
  • ctest --test-dir build -E 'test_rhs_balance|test_periodic_convergence|test_periodic_vs_global' --output-on-failure — 35/35 passed

Known red gates are intentionally excluded from that command: the pre-existing test_rhs_balance baseline failure, the periodization-deformation acceptance gate, and the unresolved periodic-vs-global 5% agreement gate.

Stack

Base: fix/kim-fp-194-susceptibility-oracle
Head: fix/kim-fp-196-charge-kernel-oracle

Closes #196

@marjohma

Copy link
Copy Markdown
Member Author

Review (standards + spec vs #196) — keeping this in draft. Standout genuine win: the 1+b_+ vs 1−b_+ discrepancy is actually resolved from the upstream integral as the issue demanded — 04_charge_potential_kernels.wl:61-80 proves the (1−b_+−m) form symbolically from the Weber generating integral and cross-checks it by arbitrary-precision integration of the unreduced Bessel moment; it matches production core_rho_phi_sp. The FP I00/I20 ingredients are integrated independently of getIfunc, Krook/FP assumptions are kept separate, and all cited code paths are real. The 13 oracle rows cover species signs, diagonal/off-diagonal, finite k_s, the b_x=600 asymptotic branch, zero-FLR, Debye-only, and m_phi=0,±1,±2.

What keeps it in draft:

  1. "Make [kim-fp-03] Verify the off-diagonal Fokker-Planck Fourier kernel #187 consume the generated oracle" is not done — nothing outside verification/ references rho_phi_kernels.dat; the pre-existing test_flr2_fourier_kernel.f90 never reads it, so the success criterion ctest -R test_flr2_fourier_kernel doesn't test this PR's output. The oracle is currently consumed only by the script that generated it. (If the intent is that [kim-fp-03] Verify the off-diagonal Fokker-Planck Fourier kernel #217 wires it up, the issue text should be amended or the PR should carry the reader.)
  2. Kernel assembly is transcription: kernelParts reproduces core_rho_phi_sp's structure (prefactor i·vT²·ks/(λ²ω_c·ν), I00(A1F0+A2F2)+A2·I20·F0/2, phase, 1/4π) with no upstream derivation of that combination — the non-goal "do not define the Mathematica kernel by transcribing flr2_fourier_kernel.f90" is violated for the assembly, ingredients aside. Several Behavior items (perturbation-field representation, guiding-centre + Fourier integration, thermodynamic-force source, species sum, Debye term, charge sign entering the math) are asserted rather than derived.
  3. "Every analytic reduction checked against the unreduced integral at nontrivial points": only the FLR Bessel factors, at one probe (a=0.7, c=1.1, m=1). The assembled kernel is never checked against an unreduced integral; the final oracle-row check compares the two total columns against the script's own formula — that's provenance, not verification. The other ~19 committed columns are unchecked.
  4. 4 of 6 negative fixtures are tautological trip-wires (four-pi, fourier-measure, phase, hidden-ks2 are caught by re-stated-definition checks two lines after the assignment, not by independent physics; only bessel-index and bplus-sign are rejected by real integration). The early FinishChecks[] exit means mutations never reach the FP integrals or oracle comparison. FORMULA_INDEX's "six negative fixtures independently mutate…" overstates this.
  5. verify-mathematica-charge-kernels-negative inherits the false-pass flaw from the inventory PR: with WOLFRAM_KERNEL unset, the inner make fails at the kernel guard for every fixture, all six print "rejected", and the target exits green without any Wolfram run.
  6. Production-default mismatch undisclosed in the commit: the oracle assumes k_s² included, but the production default is kern_include_ks2=.false. — today's code default cannot match the .dat (deferred to [kim-fp-03] Verify the off-diagonal Fokker-Planck Fourier kernel #187 in the index, unmentioned in the commit message).

Minor: m_phi truncation "proof" is a self-referential demonstration on cases 9-13; homogeneous limit exists as a script-only identity at one point with no .dat row; all rows sit at moderate x1 (0.3–0.7). Commit type verify: still undocumented in AGENTS.md.

## Summary

- replace the diagonal-only shortcut with the verified off-diagonal FP
kernel
- stabilize Bessel/exponential evaluation and retain explicit model
choices
- add oracle, symmetry, diagonal-collapse, normalization, and mutation
tests

## Why

Dense periodic Fourier assembly now uses the intended nonlocal FP
response.

## Validation

Validated cumulatively at the stack head:

- `cmake --build build -j2`
- `ctest --test-dir build -E
'test_rhs_balance|test_periodic_convergence|test_periodic_vs_global'
--output-on-failure` — 35/35 passed

Known red gates are intentionally excluded from that command: the
pre-existing `test_rhs_balance` baseline failure, the
periodization-deformation acceptance gate, and the unresolved
periodic-vs-global 5% agreement gate.

## Stack

Base: `fix/kim-fp-196-charge-kernel-oracle`
Head: `fix/kim-fp-187-offdiagonal-kernel`

Closes #187
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