PERTURBED EQUILIBRIUM - BUG FIX - Use Λ† in reluctance to match Fortran gpresp_reluct - #297
Merged
github-actions[bot] merged 1 commit intoJun 22, 2026
Conversation
…an gpresp_reluct The flux-space reluctance was computed as ϱ = L⁻¹·(Λ − L)·L⁻¹, but the Fortran GPEC reference (gpresp_reluct) uses the adjoint of the plasma inductance: ϱ = L⁻¹·(Λ† − L)·L⁻¹. Λ is not Hermitian — its anti-Hermitian part carries the dissipative/torque response — so dropping the adjoint introduced a small error in the reported reluctance. reluctance is an output-only quantity (stored and written to HDF5; not consumed by any downstream calculation), so the fix is isolated to the reluctance dataset and its field-space conform. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
github-actions
Bot
deleted the
bugfix/reluctance-plasma-inductance-adjoint
branch
June 22, 2026 01:32
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.
Summary
The flux-space reluctance matrix in
src/PerturbedEquilibrium/Response.jlwas computed with the plasma inductanceΛwhere the Fortran GPEC reference (gpresp_reluct) uses its adjointΛ†:ϱ = L⁻¹·(Λ − L)·L⁻¹gpresp_reluctϱ = L⁻¹·(Λ† − L)·L⁻¹ϱ = L⁻¹·(Λ† − L)·L⁻¹✅Λ(plasma inductance) is not Hermitian — its anti-Hermitian part carries the dissipative/torque response — so dropping the adjoint introduces a small but real error in the reported reluctance. For a perfectly HermitianΛthe two forms coincide, which is why it went unnoticed.This was surfaced by a
fortran-physics-revieweraudit of the coordinate-invariant field-space work (merged in #277). It is a pre-existing inconsistency — it predates #277 and was only flagged during that review — hence this separate bugfix branched fromdevelop.The fix
(
'is the Julia adjoint = conjugate transpose, i.e.CONJG(TRANSPOSE(...)).)Scope / blast radius
reluctanceis an output-only quantity: it is stored inPerturbedEquilibriumState, conformed to field space byfield_space_response_matrices, and written to HDF5 — nothing downstream consumes it (permeability is built directly fromΛandL, not fromϱ). The fix therefore only changes thereluctancedataset itself.Verification
using GeneralizedPerturbedEquilibriumloads cleanly.test/runtests_coordinate_invariant.jl: 15/15 + energy net-zero still green (those tests exercise the congruence conform on synthetic inputs, not this production formula).diiid_n1,developvs this branch: 46 quantities unchanged, 0 moved — confirms the change is isolated (no pinned quantity moves;reluctanceis not pinned).Fortran reference (for convenience — exact lines, no need to pull up the source)
~/Code/gpec/gpec/gpresp.f,SUBROUTINE gpresp_reluct(lines 423–461).temp1is set to the identity thenzhetrf/zhetrssolvesurf_indmats·X = I, sotemp1 = L⁻¹:Key lines:
diff_indmats = CONJG(TRANSPOSE(plas_indmats)) − surf_indmats→Λ† − Lreluctmats = MATMUL(temp1, MATMUL(diff_indmats, temp1))→L⁻¹·(Λ† − L)·L⁻¹🤖 Generated with Claude Code