Skip to content

FIX: use cyclic pair ordering for LS couplings - #207

Merged
redeboer merged 2 commits into
mainfrom
fix-ls-pair-ordering
Aug 4, 2026
Merged

FIX: use cyclic pair ordering for LS couplings#207
redeboer merged 2 commits into
mainfrom
fix-ls-pair-ordering

Conversation

@Zeyna777

@Zeyna777 Zeyna777 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Closes #202

🐛 Bug fixes

❗ Behavioral changes

  • Affected models need a refit, not just a re-evaluation: the amplitude of every $LS$ model that populates subsystem 2 shifts by a wave-dependent sign. Models in the helicity basis, and $LS$ models without a subsystem-2 chain, are unaffected.

🖱️ Developer experience

  • test_ls_amplitude_does_not_depend_on_child_order states the invariant directly, rather than through the C-symmetry observable of LS Clebsch-Gordan factors use a different pair ordering than the isobar Wigner-d function #202: which of the two children an IsobarNode happens to store first is an implementation detail of whoever built the ThreeBodyDecay, so reversing it may not change the amplitude. The test builds each subsystem amplitude twice, once from the decay as to_three_body_decay produces it and once with every decay node's children reversed, and asserts that the two expressions are symbolically equal.

    Without the fix it fails on the subsystem whose ordering flips, with a relative sign:

    A: -(sin(theta_12/2)/4 - 3*sin(3*theta_12/2)/4)*H[N(1700)+, 2, 1/2]*H[N(1700)+, 1, 1]/4
    B: +(sin(theta_12/2)/4 - 3*sin(3*theta_12/2)/4)*H[N(1700)+, 2, 1/2]*H[N(1700)+, 1, 1]/4
    
  • No existing test or notebook covered this: the three docs/comparison notebooks that assert DPD == AmpForm all use min_ls=True, docs/xib2pkk.ipynb uses the $LS$ basis but only asserts non-NaN, and docs/lc2pkpi.ipynb uses min_ls=(False, True), whose decay node is in the helicity basis and therefore unaffected. The whole suite passes unchanged either way, which is why this went unnoticed.

@Zeyna777 Zeyna777 added ❗ Behavior Changes that may affect the framework output 🐛 Bug Something isn't working labels Aug 3, 2026
@Zeyna777
Zeyna777 requested a review from redeboer August 3, 2026 16:38
@Zeyna777 Zeyna777 self-assigned this Aug 3, 2026
The Clebsch-Gordan factors of a decay node were built from
IsobarNode.child1/child2, which to_three_body_decay() sorts by final-state ID,
while the isobar Wigner-d function of the same node uses the cyclic pair
ordering (23)1, (31)2, (12)3 of the DPD paper. The two orderings coincide for
subsystems 1 and 3, but (31)2 is the one cyclic pair that is not in ascending
order, so subsystem 2 got its Clebsch-Gordan factors with lambda_1 - lambda_3
while its Wigner-d carried lambda_3 - lambda_1.

Exchanging the two particles of an LS-coupled state costs (-1)^(l+s_i+s_j-S),
which depends on the wave, so the mismatch does not cancel between resonances
with different l and cannot be absorbed into the couplings. It also made the LS
basis inconsistent with the helicity basis, whose decay couplings are indexed
by get_decay_product_ids() and are therefore cyclic already.

Closes #202.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@redeboer
redeboer force-pushed the fix-ls-pair-ordering branch from 4cfeb55 to bafbfdd Compare August 3, 2026 20:18
@redeboer redeboer changed the title FIX: use the cyclic pair ordering for the LS Clebsch-Gordan factors FIX: use cyclic pair ordering for LS couplings Aug 4, 2026
@redeboer redeboer added 🖱️ DX Improvements to the Developer Experience and removed 🖱️ DX Improvements to the Developer Experience labels Aug 4, 2026
@redeboer redeboer added this to the 0.4.1 milestone Aug 4, 2026

@redeboer redeboer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! 🐉
Verified on ComPWA/polarimetry@cf68fe0 (ComPWA/polarimetry#444), with decay rates for the LS model asserted to be unaffected 🎉

@redeboer
redeboer merged commit d79c0e9 into main Aug 4, 2026
37 checks passed
@redeboer
redeboer deleted the fix-ls-pair-ordering branch August 4, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❗ Behavior Changes that may affect the framework output 🐛 Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LS Clebsch-Gordan factors use a different pair ordering than the isobar Wigner-d function

2 participants