ComPWA / qrules

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

Illustrate 4- or even 5-body isobar decay in the visualization notebook #27

Open redeboer opened 3 years ago

redeboer commented 3 years ago

It would be nice if we can illustrate n-body decay with more than 3 final state particles and render that in the visualization notebook. This notebook can then be referred to for instance when describing subsystems (e.g. Subsystem).

Some additional thoughts:

redeboer commented 3 years ago

@sebastianJaeger Can you think of a realistic example?

redeboer commented 3 years ago

Just to summarise from the call/discussion: A good canidate would be J/psi -> K+ K- pi+ pi-, probably with some phi and rho resonances.

redeboer commented 3 years ago

Here's an example (ran with 74cb8282). Problem: it takes so long to compute I still didn't manage to complete the whole thing. (See also ComPWA/expertsystem#338.)

@spflueger Ideas?

import graphviz

from expertsystem import io
from expertsystem.reaction import InteractionTypes, StateTransitionManager

stm = StateTransitionManager(
    initial_state=[("J/psi(1S)", [-1, +1])],
    final_state=["K+", "K-", "pi+", "pi-"],
    allowed_intermediate_particles=["phi(1020)", "rho(770)"],
    formalism_type="canonical",
)
stm.set_allowed_interaction_types([InteractionTypes.Strong])
graph_interaction_settings_groups = stm.prepare_graphs()

result = stm.find_solutions(graph_interaction_settings_groups)
print(len(result.solutions))
print(result.violated_rules)

dot_source = io.convert_to_dot(result.solutions)
graphviz.Source(dot_source)
spflueger commented 3 years ago

Here's an example (ran with 74cb8282). Problem: it takes so long to compute I still didn't manage to complete the whole thing. (See also ComPWA/expertsystem#338.)

@spflueger Ideas?

The combinatorics quickly explode. What you can do is restrict the subsystems just like in the Y example

redeboer commented 3 years ago

Ok thank, that helps :+1: Still takes a long time to compute though, which is also why the test is currently de-activated https://github.com/ComPWA/expertsystem/blob/490c59249e50666b8a7c26a342d9814369aaff48/tests/channels/test_y_to_d0_d0bar_pi0_pi0.py#L79-L81

So let's put this one to the backlog while we work on ComPWA/qrules#24.

redeboer commented 2 years ago

Another example: $\Lambda^0_b \to J/\psi\left(\to\mu^-\mu^+\right) \Lambda\left(\to p\pi^-\right)K$

graph LR
    0["Λb⁰"] --> N0[ ]
    N0 --> N1["𝛬"]
    N1 --> 1["𝑝"]
    N1 --> 2["𝜋"]
    N0 --> N2["𝐽/𝜓"]
    N2 --> 3["𝜇⁻"]
    N2 --> 4["𝜇⁺"]
    N0 --> 5["𝐾"]
    style N0 fill:#FFFFFF, stroke:#FFFFFF;
    style N1 fill:#FFFFFF, stroke:#FFFFFF;
    style N2 fill:#FFFFFF, stroke:#FFFFFF;
    style 0 fill:#FFFFFF, stroke:#FFFFFF;
    style 1 fill:#FFFFFF, stroke:#FFFFFF;
    style 2 fill:#FFFFFF, stroke:#FFFFFF;
    style 3 fill:#FFFFFF, stroke:#FFFFFF;
    style 4 fill:#FFFFFF, stroke:#FFFFFF;
    style 5 fill:#FFFFFF, stroke:#FFFFFF;

Following snippet should work, but I had to abort, because it takes ages...

from qrules.transition import StateTransitionManager

stm = StateTransitionManager(
    initial_state=["Lambda(b)0"],
    final_state=["p", "pi0", "mu+", "mu-", "K-"],
)
stm.add_final_state_grouping([["p", "pi0"], ["mu+", "mu-"]])
problem_sets = stm.create_problem_sets()
reaction = stm.find_solutions(problem_sets)
len(reaction.transitions)

To reduce the number of spin projection combinations:

from qrules.transition import StateTransitionManager

stm = StateTransitionManager(
    initial_state=[("Lambda(b)0", [+0.5])],
    final_state=[("p", [+0.5]), "pi0", ("mu+", [+0.5]), ("mu-", [+0.5]), "K-"],
)
stm.add_final_state_grouping([["p", "pi0"], ["mu+", "mu-"]])
problem_sets = stm.create_problem_sets()
reaction = stm.find_solutions(problem_sets)
len(reaction.transitions)
spflueger commented 2 years ago

The "expertsystem" has to be actually turned into one to be able to speed up the solving process. Currently the solving is done using CSP which is a rather brute force way of finding a solution. In a simple example, for particle of zero electric charge which decays into two particles, the current code just creates all possible combinations and throws them away if they validate a rule. The real expertsystem way would be to assign all possible values to one of the child particles and the second one can be directly computes as the difference of the parent and other child.

redeboer commented 1 year ago

@Zeyna777 relevant snippet to reduce the number of combinations is at https://github.com/ComPWA/qrules/issues/27#issuecomment-1203873879. But a better solution would be #219.