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

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

Open
redeboer opened this issue Oct 27, 2020 · 8 comments
Open
Labels
📝 Docs Improvements or additions to documentation 💫 Good first issue Good for newcomers

Comments

@redeboer
Copy link
Member

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:

  • It should not take the expertsystem too long to generate this decay, because the notebook has to be integrated into the CI for the documentation. Therefore best if the example only involves one interaction type (e.g. strong).
  • While not essential for the visualization of a topology, best would be an example that is interesting for PWA as well.
@redeboer
Copy link
Member Author

@sebastianJaeger Can you think of a realistic example?

@redeboer
Copy link
Member Author

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 redeboer changed the title Illustrate 4- or even 5-body decay in the visualization notebook Illustrate 4- or even 5-body isobar decay in the visualization notebook Oct 27, 2020
@redeboer
Copy link
Member Author

Here's an example (ran with 74cb828). 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
Copy link
Member

Here's an example (ran with 74cb828). 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
Copy link
Member Author

Ok thank, that helps 👍
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 #24.

@redeboer redeboer transferred this issue from ComPWA/expertsystem Apr 6, 2021
@redeboer redeboer added 📝 Docs Improvements or additions to documentation 💫 Good first issue Good for newcomers labels Apr 16, 2021
@redeboer redeboer added this to the 0.8.1 milestone Apr 16, 2021
@redeboer redeboer modified the milestones: 0.8.1, 0.9.1 May 27, 2021
@redeboer redeboer modified the milestones: 0.9.1, 0.9.2 Jul 21, 2021
@redeboer redeboer self-assigned this Sep 20, 2021
@redeboer redeboer modified the milestones: 0.9.3, 0.9.2 Sep 20, 2021
@redeboer redeboer removed their assignment Dec 6, 2021
@redeboer redeboer modified the milestones: 0.9.6, Future Jan 31, 2022
@redeboer redeboer moved this to 📋 Backlog in Student projects Jul 27, 2022
@redeboer
Copy link
Member Author

redeboer commented Aug 3, 2022

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;
Loading

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
Copy link
Member

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 redeboer removed this from the Future milestone Apr 27, 2023
@redeboer
Copy link
Member Author

@Zeyna777 relevant snippet to reduce the number of combinations is at #27 (comment). But a better solution would be #219.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📝 Docs Improvements or additions to documentation 💫 Good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants