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!
import expertsystem as es
pdg = es.io.load_pdg()
pdg.filter(lambda p: p.spin == 2 and p.charmness).names
{'D(2)*(2460)+',
'D(2)*(2460)-',
'D(2)*(2460)0',
'D(2)*(2460)~0',
'D(s2)*(2573)+',
'D(s2)*(2573)-'}
result = es.reaction.generate(
initial_state="J/psi(1S)",
final_state=["K0", "Sigma+", "p~"],
allowed_interaction_types="strong",
)
import graphviz
graphs = result.collapse_graphs()
dot = es.io.convert_to_dot(graphs)
graphviz.Source(dot)
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.
amplitude_model = es.amplitude.generate(result)
es.io.write(amplitude_model, "jpsi_to_gamma_eta_eta.yml")
len(amplitude_model.parameters)
94
Advanced¶
Each of the expertsystem
’s sub-modules offer functionality to handle more advanced reaction types. The following notebooks illustrate how use them.