Stage: KIM magnetic/current kernels and field solve
Source language: Wolfram Language with generated matrix fixtures
Manuals to read first: Markl dissertation DOI 10.3217/efp2p-0x485, sections “Kernel relating charge density with magnetic field,” “Basis transformation,” “Hat functions,” and “Poisson equation”; KIM/src/electrostatic_poisson; KIM/src/asymptotics/FLR2_asymptotics.f90; #188
Depends on: #193, #194, #196
Goal
Derive the magnetic-drive and current-response kernels, then carry them through the continuous Fourier, hat-function, and finite-periodic bases to the solved fields. Verify every sign, normalization, matrix element, boundary term, and reconstructed observable.
Files to edit
verification/mathematica/05_magnetic_current_basis_poisson.wl: NEW derivations and matrix checks.
verification/oracles/field_operator_matrices.dat: NEW operator and field-reconstruction points.
verification/FORMULA_INDEX.md: map thesis and code formulas.
Behavior to implement
Derive the canonical magnetic perturbation, radial-field representation, K^{rho B}, K^{j Phi}, and K^{j B} from the verified kinetic response. Derive the Fourier-to-hat transform with its measure, hat overlap and derivative matrices, weak Poisson form including boundary terms, finite-periodic transform, aligned potential, deviation equation, gauge/null space, electric-field reconstruction, parallel current, and real-field condition. Derive the cylindrical metric terms and decide the radial versus helical Laplacian without using profile agreement as evidence.
Scaffold
kHat[lp_,l_] := Integrate[Conjugate[phiHat[lp,r]] kernel[r,rp] phiHat[l,rp], {r,…},{rp,…}];
laplaceHat[lp_,l_] := -Integrate[D[phiHat[lp,r],r] D[phiHat[l,r],r], {r,rmin,rmax}] + boundaryTerm;
check["weak Poisson operator", FullSimplify[projectedStrongForm-(laplaceHat+4 Pi kHat)] == 0];
Positive fixtures to add
- Constant-background analytic matrices in both bases.
- Manufactured complex
Phi, Phi_MA, and localized psi with exact charge, E_perp, and current.
- Constant and nonconstant radial magnetic drives with independently derived Fourier coefficients.
Negative fixtures to add
- Wrong source sign, missing boundary term, wrong transform factor, transposed kernel index, unjustified gauge removal, or incorrect
k_s^2 term: fail.
Makefile target
Add the Mathematica script and make periodic/hat matrix tests read the committed oracle.
Success criteria
math -script verification/mathematica/05_magnetic_current_basis_poisson.wl
ctest --test-dir build -R 'test_periodic_(assembly|solve|vs_global)' --output-on-failure
Non-goals
- Do not infer operator signs by matching one numerical profile.
- Do not omit current kernels because the first periodic solve uses only charge kernels.
Verification
math -script verification/mathematica/05_magnetic_current_basis_poisson.wl
Stage: KIM magnetic/current kernels and field solve
Source language: Wolfram Language with generated matrix fixtures
Manuals to read first: Markl dissertation DOI
10.3217/efp2p-0x485, sections “Kernel relating charge density with magnetic field,” “Basis transformation,” “Hat functions,” and “Poisson equation”;KIM/src/electrostatic_poisson;KIM/src/asymptotics/FLR2_asymptotics.f90; #188Depends on: #193, #194, #196
Goal
Derive the magnetic-drive and current-response kernels, then carry them through the continuous Fourier, hat-function, and finite-periodic bases to the solved fields. Verify every sign, normalization, matrix element, boundary term, and reconstructed observable.
Files to edit
verification/mathematica/05_magnetic_current_basis_poisson.wl: NEW derivations and matrix checks.verification/oracles/field_operator_matrices.dat: NEW operator and field-reconstruction points.verification/FORMULA_INDEX.md: map thesis and code formulas.Behavior to implement
Derive the canonical magnetic perturbation, radial-field representation,
K^{rho B},K^{j Phi}, andK^{j B}from the verified kinetic response. Derive the Fourier-to-hat transform with its measure, hat overlap and derivative matrices, weak Poisson form including boundary terms, finite-periodic transform, aligned potential, deviation equation, gauge/null space, electric-field reconstruction, parallel current, and real-field condition. Derive the cylindrical metric terms and decide the radial versus helical Laplacian without using profile agreement as evidence.Scaffold
Positive fixtures to add
Phi,Phi_MA, and localizedpsiwith exact charge,E_perp, and current.Negative fixtures to add
k_s^2term: fail.Makefile target
Add the Mathematica script and make periodic/hat matrix tests read the committed oracle.
Success criteria
math -script verification/mathematica/05_magnetic_current_basis_poisson.wl ctest --test-dir build -R 'test_periodic_(assembly|solve|vs_global)' --output-on-failureNon-goals
Verification