ComPWA / qrules

Rule-based particle reaction problem solver on a quantum number level
https://qrules.rtfd.io
Apache License 2.0
9 stars 5 forks source link

Add possibility to specify nodes in `generate_transitions` #290

Open grayson-helmholz opened 1 month ago

grayson-helmholz commented 1 month ago

Currently generate_transitions can only specify the "settings" for the decay as a whole, while the setter/getter-functions in the StateTransitionManager are able to specify a specific node. An example of this difference can be seen in #285 . A possible solution would be to pass along a dictionary which maps properties to nodes.

redeboer commented 1 month ago

So you would write this

reaction = qrules.generate_transitions(
    initial_state=["Lambda(c)+"],
    final_state=["p", "K-", "pi+"],
    allowed_interaction_types=("weak", "strong"),
)

instead of this

reaction = qrules.generate_transitions(
    initial_state=["Lambda(c)+"],
    final_state=["p", "K-", "pi+"],
    allowed_interaction_types={
        0: "weak",
        1: "strong",
    },
)

right?

I have to think a bit about this. It would be cleaner, but at the same time, generate_transitions() is a convenience function that assumes the user does not know anything about the generated topologies, like node IDs.