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)
_images/usage_6_0.svg

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)
93