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

Bug in allowed_interaction_types argument to generate_transitions() #285

Open
redeboer opened this issue Aug 27, 2024 · 0 comments
Open
Assignees
Labels
🐛 Bug Something isn't working

Comments

@redeboer
Copy link
Member

As noted by/with @MartinTum, setting allowed_interaction_types in generate_transitions() does not work as expected when using a tuple (setting the interaction type per node).

Imports and particle database definition
import graphviz
import qrules
from qrules.particle import Particle, Spin
from qrules.settings import InteractionType
from qrules.transition import StateTransitionManager


Tcc1_4430 = Particle(
    name="Tcc̅1(4430)⁺",
    pid=99999999999,
    latex=R"\mathit{T}_{c\overline{\mathit c}1}(4430)^+",
    spin=1,
    mass=4.478,
    width=0.181,
    charge=+1,
    isospin=Spin(1, +1),
    parity=+1,
    c_parity=-1,
    g_parity=+1,
)
particle_database = qrules.load_pdg()
particle_database += Tcc1_4430
reaction = qrules.generate_transitions(
    initial_state="B0",
    final_state=["J/psi(1S)", "pi+", "K-"],
    allowed_intermediate_particles=["K(0)", "K*", "Tc", "f(0)"],
    allowed_interaction_types=("weak", "strong"),  # <-- problem here
    particle_db=particle_database,
)

Image

Using the STM directly does result in the correct behaviour:

stm = StateTransitionManager(
    initial_state=["B0"],
    final_state=["J/psi(1S)", "pi+", "K-"],
    particle_db=particle_database,
)
stm.set_allowed_interaction_types([InteractionType.WEAK], node_id=0)
stm.set_allowed_interaction_types([InteractionType.STRONG], node_id=1)
problem_sets = stm.create_problem_sets()
reaction = stm.find_solutions(problem_sets)

Image

@redeboer redeboer added the 🐛 Bug Something isn't working label Aug 27, 2024
@ComPWA ComPWA deleted a comment Aug 27, 2024
@redeboer redeboer removed their assignment Sep 9, 2024
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
None yet
Development

No branches or pull requests

2 participants