Problem
sign_sqrtg is currently supplied independently in rabe.in and is used linearly in
dr/dA_theta = sign_sqrtg / (|grad s| psi_tor_edge).
Consequently a valid field file plus the wrong sign_sqrtg silently reverses every signed Lambda_A, Lambda_B, Lambda_S, lambda_LC_bB, and remainder output. The loaded Boozer field already has enough orientation metadata to determine this sign, so the duplicate user input can disagree with the field tuple.
This is separate from the intentional B_zeta + iota B_theta > 0 input-domain check.
Reproduction
At current main, run the bundled QH VMEC case twice with identical field and profiles, changing only
to
Both inputs are accepted, but the signed coefficient chain changes orientation even though the field did not.
Expected behavior
- The default derives the signed Boozer-Jacobian orientation from the loaded VMEC, boozmn, or extended-chartmap field tuple.
- An explicitly supplied
+1 or -1 is accepted only if it agrees with the field and otherwise aborts before coefficients are evaluated.
- A pure coordinate relabel such as
theta'=-theta transforms the field metadata and all dependent inputs as one tuple; RABE must reproduce the corresponding coefficient-covector law.
Proposed one-PR scope
- Carry
signgs in boozer_field_t after every supported loader.
- Make
sign_sqrtg=0 mean automatic and use it as the default.
- Retain explicit
+1/-1 only as a checked assertion.
- Add a negative mismatch test.
- Add a native VMEC original/relabel regression that compares every emitted coefficient and scalar output.
The underlying VMEC signgs ingestion fix is tracked by libneo issue itpplasma/libneo#308.
Existing diagnostic implementation and evidence
Branch diag/cartesian-sign-gate, commit 7b012103c993cd6a824abe95c91e314646e467b7, implements the proposed behavior and pins the corresponding libneo diagnostic fix.
The native QH original/theta'=-theta pair passes with:
Lambda_A/B/S, lambda_LC_bB, and the non-omnigenous remainder reversing as poloidal covectors;
s_tor, nu_star_crit, major radius, and split_maxima invariant;
- maximum signed relative residual
1.092e-7;
- an explicit wrong sign rejected before coefficient evaluation.
Verification:
fo build
ctest --test-dir build \
-R 'TestReadNamelist|GoldenRecord|VmecThetaRelabelCoefficients' \
--output-on-failure
Non-goals
- changing any coefficient formula;
- bypassing or deciding the physical meaning of the positive-
B_zeta+iota B_theta orientation gate;
- adding asymmetric boozmn support;
- auditing the work-in-progress precession branch.
Problem
sign_sqrtgis currently supplied independently inrabe.inand is used linearly inConsequently a valid field file plus the wrong
sign_sqrtgsilently reverses every signedLambda_A,Lambda_B,Lambda_S,lambda_LC_bB, and remainder output. The loaded Boozer field already has enough orientation metadata to determine this sign, so the duplicate user input can disagree with the field tuple.This is separate from the intentional
B_zeta + iota B_theta > 0input-domain check.Reproduction
At current main, run the bundled QH VMEC case twice with identical field and profiles, changing only
to
Both inputs are accepted, but the signed coefficient chain changes orientation even though the field did not.
Expected behavior
+1or-1is accepted only if it agrees with the field and otherwise aborts before coefficients are evaluated.theta'=-thetatransforms the field metadata and all dependent inputs as one tuple; RABE must reproduce the corresponding coefficient-covector law.Proposed one-PR scope
signgsinboozer_field_tafter every supported loader.sign_sqrtg=0mean automatic and use it as the default.+1/-1only as a checked assertion.The underlying VMEC
signgsingestion fix is tracked by libneo issue itpplasma/libneo#308.Existing diagnostic implementation and evidence
Branch
diag/cartesian-sign-gate, commit7b012103c993cd6a824abe95c91e314646e467b7, implements the proposed behavior and pins the corresponding libneo diagnostic fix.The native QH original/
theta'=-thetapair passes with:Lambda_A/B/S,lambda_LC_bB, and the non-omnigenous remainder reversing as poloidal covectors;s_tor,nu_star_crit, major radius, andsplit_maximainvariant;1.092e-7;Verification:
fo build ctest --test-dir build \ -R 'TestReadNamelist|GoldenRecord|VmecThetaRelabelCoefficients' \ --output-on-failureNon-goals
B_zeta+iota B_thetaorientation gate;