Skip to content

[math-05] Derive magnetic kernels, basis transforms, and Poisson systems#220

Draft
marjohma wants to merge 3 commits into
fix/kim-fp-196-charge-kernel-oraclefrom
fix/kim-fp-197-poisson-oracle
Draft

[math-05] Derive magnetic kernels, basis transforms, and Poisson systems#220
marjohma wants to merge 3 commits into
fix/kim-fp-196-charge-kernel-oraclefrom
fix/kim-fp-197-poisson-oracle

Conversation

@marjohma

Copy link
Copy Markdown
Member

Summary

  • derive magnetic-drive/current kernels and Fourier/hat basis transforms
  • derive weak and periodic Poisson operators, boundary terms, gauge rules, and field reconstruction
  • commit deterministic field-operator matrix fixtures and formula mappings

Why

The field solve and reconstruction conventions have an independent symbolic derivation.

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-187-offdiagonal-kernel
Head: fix/kim-fp-197-poisson-oracle

Closes #197

@marjohma

Copy link
Copy Markdown
Member Author

Review (standards + spec vs #197) — keeping this in draft. Positives first: all new FORMULA_INDEX citations resolve on the branch (no phantom paths), the Makefile targets mirror sibling style, and a minority of checks are genuine derivations (cylindrical harmonic Laplacian via D[], the Green's-identity probe, the FP generator symmetry). But this is the weakest of the math PRs against its own issue:

Blocking

  1. "Make periodic/hat matrix tests read the committed oracle" is not done. Nothing in Fortran references field_operator_matrices.dat; test_periodic_{assembly,solve,vs_global} and KIM/tests/CMakeLists.txt are untouched. The oracle's only consumer is the generating script's own read-back — pure self-comparison, drift detection at best. The second success criterion (ctest -R 'test_periodic_(assembly|solve|vs_global)') runs pre-existing tests that never see the oracle.
  2. Most of the Behavior list is absent: no canonical-magnetic-perturbation or radial-field derivation; K^{ρB} (FP_kernel_plasma_prefacs.f90:187-249) never derived or checked; no Fourier-to-hat transform or its measure (there is a 4-point DFT and flat-1D hat rows, but no transform between bases and no cylindrical measure); no manufactured Φ_MA or localized ψ (the kind-1 ψ is a smooth per-mode constant and source = aa*total is circular); "decide the radial versus helical Laplacian" is not decided — radialSymbol returns −k_r² by construction and both symbols are merely labeled.
  3. K^{jB} verification proves the wrong thing: the check |jBCorrect − jBPrinted| > 1e-6 establishes that I11/I13 differs from I02/I22, not that I11/I13 is correct; jBCorrect transcribes the production formula (FP_G1_j_B at kernel.f90:335) — the same transcription failure mode flagged on [math-04] Derive the charge-potential integral kernels #216.
  4. Check theater: hat mass/Laplace matrix rows are hardcoded literals checked against hardcoded arithmetic (never Integrated over hat functions); i10=i01; i12=i21 followed by checks that compare the value to itself (the .dat has no (1,0)/(1,2) rows); screenedZero, radialSymbol, aligned-potential residual, kernelAction == kernelProbe.phiProbe, and the source-sign check are all definitional when unmutated. The hardcoded row count ==14 repeats the [math-01] Inventory formulas and lock KAMEL conventions #193 counting pattern.

Inherited/minor

  • verify-mathematica-field-operators-negative copies the false-pass-when-WOLFRAM_KERNEL-unset flaw a fourth time (all six fixtures print "rejected" without Wolfram ever running). Worth fixing once, centrally, for all four targets.
  • All six negative fixtures exist but FinishChecks[] exits early, so mutations never reach the current-kernel or oracle sections.
  • FORMULA_INDEX marks KIM-07/08/09 "verified by [math-05] Derive magnetic kernels, basis transforms, and Poisson systems #197" though the .wl never touches Fortran and no Fortran test reads the oracle — verified-derivation ≠ verified-production-code; poisson.f90's actual Dirichlet lifting (solve_poisson.f90:197-208) and calc_mass_matrix are never checked.
  • .dat header omits the precision/generation provenance both sibling oracles state; 05_...wl:200-202 exceed the 100-col limit.

Base automatically changed from fix/kim-fp-187-offdiagonal-kernel to fix/kim-fp-196-charge-kernel-oracle July 14, 2026 10:33
…roblem (#219)

## Summary

- solve for a periodic deviation around an explicit physical
aligned-potential lift
- derive and enforce screened zero-mode and null-space behavior
- add manufactured complex solves, projection checks, reconstruction
checks, and failure cases

## Why

The periodic solver no longer relies on an implicit periodic
full-potential boundary condition.

## 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-197-poisson-oracle`
Head: `fix/kim-fp-188-matched-bvp`

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