Skip to content

FIX: correct multichannel couplings - #90

Merged
redeboer merged 48 commits into
mainfrom
fix-json-multichannelbw
Aug 4, 2026
Merged

FIX: correct multichannel couplings#90
redeboer merged 48 commits into
mainfrom
fix-json-multichannelbw

Conversation

@mmikhasenko

@mmikhasenko mmikhasenko commented Jun 26, 2025

Copy link
Copy Markdown
Collaborator

Closes #87

A major problem has been found in implementation of Multichannel BW, in the way how couplings are computed.
The couplings themselves appear only for Flatte. So these values were modified to be consistent with the correct implementation.

  • fix json
  • fix julia
  • fix python

🐛 Bug fixes

  • Correct the serialized multichannel Breit-Wigner couplings and deserialize gsq as a coupling squared instead of an energy width.

✨ New features

  • Render a Dalitz plot and the $m_{13}$ and $m_{23}$ mass projections (including per-resonance components) of the deserialized amplitude model.
  • Verify the deserialized generic_function dynamics (Bugg Breit-Wigner) against the model definition.

⚙️ Enhancements

  • Render individual dynamical expressions through unfold_definitions() so that their complete symbolic structure is visible.
  • Assert that each deserialized distribution reproduces the checksums in the model definition, so that the documentation build fails on a mismatch instead of only reporting it in the validation table.
  • Document the multichannel Breit-Wigner convention, with references to HadronicLineshapes.jl and ComPWA/ampform-dpd#199.

📝 Documentation

  • Render figures as SVG with transparent backgrounds and neutral colours, so that they remain readable in dark mode.
  • Remove the note block about the amplitude model not being deserialized correctly, which no longer applies.

🔨 Maintenance

  • Require ampform-dpd>=0.4.1 and upgrade the lock files accordingly.

Squash commit messages

* DOC: improve rendering on dark mode
* DOC: remove note block about validation
* ENH: assert equivalence of checksums
* ENH: render sub-expressions with `unfold_definitions()`
* ENH: verify `generic_function`
* FEAT: render Dalitz plot and mass projections
* MAINT: upgrade to ComPWA/ampform-dpd@0.4.1

@redeboer

Copy link
Copy Markdown
Collaborator

MultichannelBreitWigner is imported, so since it was matched, the problem might be there as well

from ampform_dpd.dynamics import (
    BreitWigner,
    ChannelArguments,
    EnergyDependentWidth,
    MultichannelBreitWigner,
    P,
    SimpleBreitWigner,
)

These features are not released, see here. But good to be aware for future developments.

@mmikhasenko

mmikhasenko commented Jun 26, 2025

Copy link
Copy Markdown
Collaborator Author

The problem should be somewhere here, then,

@mmikhasenko

Copy link
Copy Markdown
Collaborator Author

@redeboer could you please help understanding your definition,

m^2-s-imG
G = sum Gi
#
Gi = 1/m * g^2 * 2p/sqrt(s)

In the code, I do not recognize the Gi expression.

@mmikhasenko

Copy link
Copy Markdown
Collaborator Author

@redeboer do the tests at the PR check the validation points of json in python code?

I'm surprised to see that the json is modified, python code is not modified, but test button is green.

@redeboer

Copy link
Copy Markdown
Collaborator

There are some tests, it seems
ComPWA/ampform-dpd@0.2.0...0.2.1rc0#diff-37a837280345b38e5d2b0707adb33df844b8d44971fcae9fcb1aa340073d16cf
But could well be that they don't cover the part of the code that you're referring to.

@mmikhasenko

Copy link
Copy Markdown
Collaborator Author

JSON has cross check evaluation, it is surprising that these are not evaluated or pass, given that the lineshape for L1405 changed

@redeboer

Copy link
Copy Markdown
Collaborator

it is surprising that these are not evaluated

Not really. Like I said, this was coded together in an afternoon and is therefore only in a release candidate. Serialization is currently not our priority list.

@mmikhasenko

Copy link
Copy Markdown
Collaborator Author

This issue is looking forward for being resolved :)

@redeboer redeboer self-assigned this Dec 3, 2025
@redeboer redeboer added the 🐛 Bug Something isn't working label Dec 3, 2025
@mmikhasenko

Copy link
Copy Markdown
Collaborator Author

ping @redeboer

Let's check if your MultichannelBreitWigner does the same as this,
https://github.com/mmikhasenko/HadronicLineshapes.jl/blob/main/src/shapes.jl#L22-L31

before merging, I would like to see,

  1. json is changed, python code gives different results as before (as expected, or as julia)
  2. the python code is fixed, dependencies are updated
  3. python code gives the same result as expected, or as julia

@redeboer redeboer mentioned this pull request Jan 6, 2026
@mmikhasenko

Copy link
Copy Markdown
Collaborator Author

Ok, Is it fixed now, @redeboer ?

@redeboer

Copy link
Copy Markdown
Collaborator

Has the serialization format been formalized?

@mmikhasenko

Copy link
Copy Markdown
Collaborator Author

I mean, I have seen some development, looks like you worked on it. So I am curious if it is resolved. Not related to the format.

redeboer pushed a commit to RUB-EP1/amplitude-serialization-pr-preview that referenced this pull request Aug 4, 2026
redeboer pushed a commit to RUB-EP1/amplitude-serialization-pr-preview that referenced this pull request Aug 4, 2026
redeboer pushed a commit to RUB-EP1/amplitude-serialization-pr-preview that referenced this pull request Aug 4, 2026
@redeboer
redeboer self-requested a review August 4, 2026 22:11
redeboer pushed a commit to RUB-EP1/amplitude-serialization-pr-preview that referenced this pull request Aug 4, 2026
@redeboer
redeboer marked this pull request as ready for review August 4, 2026 22:22
@redeboer redeboer added 🖱️ DX Improvements to the Developer Experience 📝 Docs Improvements or additions to documentation ✨ Feature New feature added to the package 🔨 Maintenance Refactoring or redesign that don't affect the interface labels Aug 4, 2026
redeboer pushed a commit to RUB-EP1/amplitude-serialization-pr-preview that referenced this pull request Aug 4, 2026
@redeboer redeboer removed the 🖱️ DX Improvements to the Developer Experience label Aug 4, 2026
Base automatically changed from dependabot/lock-ee0317cf3e to main August 4, 2026 22:28
redeboer pushed a commit to RUB-EP1/amplitude-serialization-pr-preview that referenced this pull request Aug 4, 2026
@redeboer
redeboer merged commit d0f0dff into main Aug 4, 2026
15 checks passed
@redeboer
redeboer deleted the fix-json-multichannelbw branch August 4, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 Bug Something isn't working 📝 Docs Improvements or additions to documentation ⚙️ Enhancement Improvements and optimizations of existing features ✨ Feature New feature added to the package 🔨 Maintenance Refactoring or redesign that don't affect the interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect definition of MultiChannelBW

2 participants