Trace periodic join compatibility and nullspace#161
Open
krystophny wants to merge 2 commits into
Open
Conversation
This was referenced Jul 13, 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.
join_endsreplaces one periodic equation per retained Laguerre block with the Lorentz current-closure constraint. The remaining periodic seam could therefore have come from an incompatible source, an incorrect nullspace, or reconstruction of a different source.Add an opt-in
NEO2_JOIN_END_TRACE_FILEdiagnostic. For each join it records the Lorentz source correction, transfer-matrix identity error, original periodic-system left and right null vectors, compatibility residual, both replaced-row residuals, and algebraic scales. The CSV writer rejects wrong shapes, nonfinite values, nonpositive scales, and I/O failures.The diagnostic is observation-only. When disabled it allocates no diagnostic arrays and performs no diagnostic solve. It does not change the Lorentz projection, Pfirsch-Schlueter current constraint, particle-conservation treatment, collision operator, discretization, convergence criteria, Fourier convention, CGS units, boundary conditions, ABI, or array layout.
The accepted 480-step, 30-pitch batch replay resolves the open hypothesis:
2.81e-17relative;1.18e-14and1.17e-14relative;1.39e-16relative;1.39e-16and5.27e-15relative;2.71e-16relative;7.85e-4of the unsigned source scale;7.28e-4;8.48e-4.The periodic solve is compatible and satisfies both original rows. The seam instead follows from applying the Lorentz correction only to the joined propagator source. Stage-1 reconstruction replays the saved local sources, which do not contain a spatially localized form of that correction. This PR does not invent such a localization and does not accept a physical pointwise current.
With the diagnostic enabled, all 398 saved propagators and 199 reconstructed boundaries are bit-for-bit identical to the parent result. Every numerical dataset in the 199 local-response HDF5 files and the global response file is also identical. All 12 focused tests and the trace-analysis test pass under bounds checks and floating-point traps. A follow-up commit separates finiteness and positivity checks because Fortran logical operators are not required to short-circuit; this prevents a nonfinite diagnostic scale from reaching an ordered comparison under invalid-operation traps.
Verification
Test fails on parent
At
130ea2c:The existing test passes, but no requested join-end trace is produced.
Test passes after fix
The format warning is already present for the legacy
join_ends.f90file at the parent commit. This PR keeps its existing layout instead of reformatting unrelated lines.