Skip to content

DOCS - BUG FIX - State pmodb displacement gauges and prove consumer contracts - #339

Merged
logan-nc merged 9 commits into
PrincetonUniversity:developfrom
krystophny:fix/pmodb-gauge-docs-20261019
Oct 24, 2026
Merged

logan-nc merged 9 commits into
PrincetonUniversity:developfrom
krystophny:fix/pmodb-gauge-docs-20261019

Conversation

@krystophny

@krystophny krystophny commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

The pmodb lagb column is the Lagrangian field strength of the displacement with zero toroidal component in the working chart. It is not the perpendicular-displacement value that a consumer pairing it with a perpendicular divergence needs. docs/pmodb_gauge.rst documents every column and how the columns relate, the regularisation, what PENTRC and Boozer/Hamada bounce-averaged consumers need, and how to transform to a target gauge. outputs.rst gets a corrected one-line summary. The two Fortran changes are comments only.

The PR first also added symbolic proofs of the page's identities under docs/derivations/pmodb_gauge/. With SymPy 1.9, 53 were proved; G6 (the direct metric contraction of the kinematic identity) stayed open; and all three negative controls were nonzero. Those scripts were dropped in 4591149 as new infrastructure that is out of scope for 1.6.0, and they remain in this PR's history (up to 09c85cd). The page keeps the statements and equations without the identity labels.

Update (logan-nc): merged develop and brought the page in line with #340–#343:

  • the current ξ⊥ construction from ξ^ψ and ξ_s;
  • both PENTRC paths now use the ξ⊥ pair;
  • the regularisation section is reduced to the divergence of the regularised field and the column relation;
  • the list of fixed defects is replaced by a short history;
  • dropped check_output.py and the references to material outside this repo.

The page builds without Sphinx warnings.

Also a factual pass over the existing docs for 1.6 (09c85cd). Each edit is checked against the source, and no new sections are added:

  • outputs.rst: corrected file names and flags;
  • sign_conventions.rst: Jacobian direction; jac_type park and other added;
  • install notes;
  • broken links;
  • example READMEs;
  • two template comments.

Chris&AI

🤖 Generated with Claude Code

https://claude.ai/code/session_01VMDGyfQKRZQMdk3NJXsKQE

… pmodb columns relate

lagb (gpout_pmodb) is the Lagrangian field strength of xi_perp + lambda B
with xi^zeta = 0 in the working (jac_type) chart. It is neither the
xi_perp-only value nor Park et al. (2009) Eq. 7 with GPEC's divergence-free
xi, and lagb = -(Bdivxprp + Bkxprp) is not an identity:

  lagb + Bdivxprp + Bkxprp = -(xi_perp^zeta/q) d_theta B - xi_perp.F/B,

F = (curl B) x B - mu0 grad p. The docs called lagb "the Lagrangian |B|
necessary for NTV post processing" and gpdiag labelled it "with parallel
components".

docs/pmodb_gauge.rst derives every column in the GPEC chart for any
jac_type, the regularisation terms of reg_flag, and what PENTRC and
perturbed-Boozer/Hamada consumers need. The identities are proved with the
FortSym native zero test (docs/derivations/pmodb_gauge, verdicts JSON);
FortSym is needed only to rerun the proofs. No code change.
@logan-nc logan-nc mentioned this pull request Oct 21, 2026
27 tasks done
@krystophny
krystophny marked this pull request as ready for review October 23, 2026 06:10
@krystophny krystophny added this to the v1.6.0 milestone Oct 23, 2026
@krystophny
krystophny requested a review from logan-nc October 23, 2026 06:10
@krystophny

Copy link
Copy Markdown
Collaborator Author

@logan-nc this is ready for review for v1.6.0. It changes documentation only: it states the displacement gauge behind each pmodb column and the contracts that Boozer/Hamada consumers must follow, with the FortSym proofs under docs/derivations/pmodb_gauge/. The Julia counterpart is OpenFUSIONToolkit/GPEC#540.

Chris&AI

logan-nc and others added 3 commits October 24, 2026 00:59
PrincetonUniversity#340-PrincetonUniversity#343 merged after this page was written. Describe and prove the
current xi_perp construction from xi^psi and xi_s (G4.1, G4.2, G4.4,
G5.6), state that both PENTRC input paths now use the xi_perp pair, and
reduce the regularisation section to what the output columns use (R3,
R8). Replace the list of fixed defects with a short history, and drop
material that depends on files outside this repository
(check_output.py, the TC24 attribution, rmp_torque and FortSym issue
references). derive.py falls back to SymPy when FortSym is absent; the
verdicts were regenerated with SymPy 1.9 (57 proved, G6 open, all
negative controls nonzero at exact rational witnesses).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMDGyfQKRZQMdk3NJXsKQE
…or 1.6

Factual pass over the existing pages, each edit checked against the
source; no new sections. outputs.rst: euler.bin, lowercase gpec_* file
names, the real flags for vpbrzphi/vsbrzphi and bnormal_spectrum.bin,
xbnormal columns, output formats and when the control/singfld outputs
are written. sign_conventions.rst: the Jacobian powers give 1/J, and the
jac_type table gains park and other. installation.rst and install/README:
X11_HOME, NETCDF_C_DIR is derived, allf builds the same modules as all,
OMPFLAG is automatic. Broken links in namelists.rst and
source_documentation.rst; the DIII-D kinetic and resistive READMEs are
linked from the index; example READMEs no longer claim rlar output while
rlar_flag is off. Template comments: jac_type options, ahb_flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMDGyfQKRZQMdk3NJXsKQE

@logan-nc logan-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for 1.6.0. I merged develop, then brought the pmodb gauge page in line with #340–#343: the ξ⊥ construction is re-proved with SymPy, and the stale defect list and references to material outside the repo are gone. A docs-wide factual pass is also on the branch (09c85cd). CI is green on gfortran and ifort.

The symbolic proof scripts under docs/derivations are a new
verification framework that nothing else in the repo uses, so they
are out of scope for 1.6.0. The pmodb_gauge page keeps its statements
and equations; only the references to the scripts and their identity
labels are removed. The scripts remain in this PR's commit history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMDGyfQKRZQMdk3NJXsKQE
@logan-nc

Copy link
Copy Markdown
Contributor

@krystophny I've taken the docs/derivations/pmodb_gauge/ scripts out of this PR (4591149). That's a scope call for the final Fortran release, not a problem with the proofs: it would be a new verification framework that nothing else in the repo uses or maintains. The page keeps its statements and equations. The scripts are still in this branch's history (09c85cd and earlier) if you want them in the Julia GPEC repo instead.

@logan-nc
logan-nc merged commit 3c0207e into PrincetonUniversity:develop Oct 24, 2026
5 checks passed
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.

2 participants