Restore Fourier-space KIM kernels with behavioral tests#177
Open
krystophny wants to merge 3 commits into
Open
Conversation
Member
Author
|
Follow-up commit: the Debye switch now only zeroes the thermodynamic-force terms and keeps the sign, gyroaverage Gaussian, and Fourier phase of the full expression. The historical branch flipped the sign relative to the adiabatic limit and dropped the phase factor, which would anti-screen and break diagonality once the switch feeds a matrix assembly; the modern hat-basis path (artificial_debye_case with the G0 prefactor) uses the retained convention. The switch test now checks that enabling it removes the force response while reproducing the force-free kernel. |
This was referenced Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First split item of #175: restore the continuous-Fourier kernels
kernel_rho_phi_of_kr_krp_rgandkernel_rho_B_of_kr_krp_rgaskernels_m(
KIM/src/kernels/kernel_mod.f90), rewired from the removedplasma_parameter/back_quantsglobals to the currentspecies_mplasma_tstate, and reactivate the kernel tests as ctest-registered behavioral checks.
Stack: parent branch
main, pinned parent commit2341697e.Invariant preserved
kernel_mod.f90at1ae0aeeb~1: Debye branch, large-argument Besselasymptotics,
exp(i (k_r - k_r') r_g)phase,1/(8 pi^2)(rho-phi) andi/(8 pi^2 c)(rho-B) normalizations, CGS-Gaussian units.species_mwith the same defining formulas the deleted
calculate_backsused(
A1,A2,lambda_D,z0,ks,kpverified line-by-line);Lagrange interpolation keeps the historical
binsrc/plag_coeff4-point scheme on
plasma%r_grid.gsl_sf_bessel_In->fortnum_special::bessel_in(same modified Bessel I_n), and the retired
kernel_debye_caseconfig keybecomes a module switch with unchanged default
.false..golden records, and all 25 pre-existing ctests are untouched.
Test changes
The orphaned
KIM/src/tests/programs pinned values of the deletedNRL-rounded background (
vTe = 4.19e7 sqrt(Te), constantbtor); thecurrent pipeline computes
sqrt(T ev/m)andomega_cfromB0(r), sothose pins differ at the 1e-3 level while the tightest tolerance was 1e-5:
they cannot pass against either code state. They are replaced by analytic
and property checks at 1e-12 relative tolerance:
-1/(8 pi^2 lambda_D^2)atk_r = k_r'(the acceptance value named in KIM: revive Fourier-space solver via enforced radial periodicity (localized solutions) #175),
k_r /= k_r',k_r <-> k_r'swap conjugacy andr_gphase translation(the properties the periodic matrix assembly of KIM: revive Fourier-space solver via enforced radial periodicity (localized solutions) #175 relies on),
force-free kernel (the historical branch's flipped sign and dropped
phase are deliberately not restored; see the follow-up comment),
linearity of both kernels in
A1andA2.The dead
KIM/src/tests/directory (empty CMakeLists, brokenkim_init_for_test) and the commented-outKIM_kernelssource group areremoved; the new tests live in
KIM/tests/with the other ctest programs.Verification
Test fails on defective kernel (normalization mutated)
(On
mainthe module and tests do not build at all; the historical testprograms reference modules deleted in
7c1345dc.)Test passes after restore
Full suite
Relation to Markus's Fokker-Planck periodic branch
This PR restores the historical continuous Krook kernels. It is useful for Fourier-phase, Debye-limit, and interpolation comparisons, but it is not the off-diagonal Fokker-Planck kernel implemented on
feature/kim-forced-periodicity. Hold integration until #191 decides whether any generic tests are retained. The independent FP derivation and oracle are #187, #194, and #196.