Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of final state influences number of final states #160

Closed
redeboer opened this issue Mar 2, 2022 · 1 comment · Fixed by #217 or #218
Closed

Order of final state influences number of final states #160

redeboer opened this issue Mar 2, 2022 · 1 comment · Fixed by #217 or #218
Assignees
Labels
🐛 Bug Something isn't working
Milestone

Comments

@redeboer
Copy link
Member

redeboer commented Mar 2, 2022

#145 has introduced a bug: changing the order of the final_state in generate_transitions() can result in a different number of final states. This was determined with git bisect using the following test:

import qrules


def test_order():
    reaction = qrules.generate_transitions(
        initial_state="J/psi(1S)",
        final_state=[
            "pi0",
            "gamma",
            "pi0",
        ],
        allowed_intermediate_particles=["f(0)(980)"],
        allowed_interaction_types=["strong", "EM"],
    )
    assert len(reaction.final_state) == 3

First failing commit is abd875d. Probably fixed best through #144.

Note: the test does not fail anymore after #156

@redeboer redeboer added the 🐛 Bug Something isn't working label Mar 2, 2022
@redeboer redeboer self-assigned this Mar 2, 2022
@redeboer redeboer added this to Roadmap Mar 3, 2022
@redeboer redeboer moved this to Upcoming in Roadmap Mar 3, 2022
@redeboer redeboer added this to the 0.10.0 milestone Mar 3, 2022
@redeboer
Copy link
Member Author

redeboer commented Aug 5, 2022

Another example (with pip install qrules==0.9.7):

import graphviz
import qrules

reaction = qrules.generate_transitions(
    initial_state=("J/psi(1S)", [-1, +1]),
    final_state=["gamma", "pi0", "pi0"],
    allowed_intermediate_particles=["omega(782)"],
    allowed_interaction_types=["strong", "EM"],
    formalism="canonical-helicity",
)
dot = qrules.io.asdot(reaction, collapse_graphs=True)
graphviz.Source(dot)

reaction

This seems to be a problem with the DOT rendering though:

>>> reaction.transitions[0].topology
Topology(
  nodes=frozenset({0, 1}),
  edges=FrozenDict({
    -1: Edge(originating_node_id=None, ending_node_id=0),
    3: Edge(originating_node_id=0, ending_node_id=1),
    1: Edge(originating_node_id=1, ending_node_id=None),
    2: Edge(originating_node_id=1, ending_node_id=None),
  }),
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
Status: Upcoming
1 participant