Usage¶
Main interface¶
The expertsystem
consists of three main components: particle
, reaction
, and amplitude
that build on each other. Here’s a small example of how to use them!
[3]:
import expertsystem as es
[4]:
pdg = es.io.load_pdg()
pdg.filter(lambda p: p.spin == 2 and p.charmness).names
[4]:
{'D(2)*(2460)+',
'D(2)*(2460)-',
'D(2)*(2460)0',
'D(2)*(2460)~0',
'D(s2)*(2573)+',
'D(s2)*(2573)-'}
[5]:
result = es.reaction.generate(
initial_state="J/psi(1S)",
final_state=["p", "p~", "eta"],
allowed_interaction_types="strong",
)
[6]:
import graphviz
graphs = result.collapse_graphs()
dot = es.io.convert_to_dot(graphs)
graphviz.Source(dot)
[6]:
The io
module offers functionality for reading and writing. This is useful if when you’ve generated
an AmplitudeModel
and want to use it in an external PWA package.
[7]:
amplitude_model = es.amplitude.generate(result)
es.io.write(amplitude_model, "jpsi_to_gamma_eta_eta.yml")
Advanced¶
Each of the expertsystem
’s sub-modules offer functionality to handle more advanced reaction types. The following notebooks illustrate how use them.