Download this notebook here
.
Step 1: Create an amplitude model¶
tensorwaves
requires you to first formulate an amplitude model that you want to fit to your data set. The expertsystem
helps you to construct such a model.
This notebooks briefly illustrates how to create such an amplitude model with the expertsystem
and how to write it to a recipe file that can be understood by tensorwaves
. We won’t go into details here, because the expertsystem
already provides its own guides.
We first define the boundary conditions of our physics problem, that is, initial state, final state, formalism type, and the intermediate states that we’re interested in. All this is handled through the StateTransitionManager
(STM). In this example, we chose to use the helicity formalism, but you can also use formalism_type="canonical-helicity"
.
[1]:
from expertsystem.ui.system_control import StateTransitionManager
stm = StateTransitionManager(
initial_state=[("J/psi")],
final_state=[("gamma"), ("pi0"), ("pi0")],
allowed_intermediate_particles=["f0", "omega"],
formalism_type="helicity",
topology_building="isobar",
)
Note
As Step 3: Perform fit serves to illustrate usage only, we make the amplitude model here a bit simpler by not allowing \(\omega\) states (which are narrow and therefore hard to fit).
[2]:
stm.allowed_intermediate_particles = ["f0"]
Next, we let the STM generate topologies (represented by graphs) for the transition from initial to final state.
[3]:
graph_interaction_settings_groups = stm.prepare_graphs()
Now we’re ready to let the STM compute the allowed intermediate states! In this example, we just use the standard interaction types that the expertsystem
uses. We’re also not too interested in warnings here, so we lower the logging level.
[4]:
import logging
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
solutions, violated_rules = stm.find_solutions(
graph_interaction_settings_groups)
That’s all! We now know which possible transitions there are going from initial to final state:
[5]:
from expertsystem.topology.graph import get_intermediate_state_edges
def print_intermediate_states(solutions):
print("intermediate states:")
intermediate_states = set()
for g in solutions:
edge_id = get_intermediate_state_edges(g)[0]
intermediate_states.add(g.edge_props[edge_id]['Name'])
print(intermediate_states)
print("found", len(solutions), "solutions!")
print_intermediate_states(solutions)
found 12 solutions!
intermediate states:
{'f0(980)', 'f0(1500)'}
This is the part where tensorwaves
comes in. All we need it is formulate those possible transitions in terms of an amplitude model. As we told the STM to analyze the problem with the helicity formalism, we use the HelicityAmplitudeGenerator
to generate that amplitude model and write it to a recipe file. YAML is the preferred file format for tensorwaves
. Note that if you told the STM to use the canonical formalism, you should use CanonicalAmplitudeGenerator
here.
[6]:
from expertsystem.amplitude.helicitydecay import HelicityAmplitudeGenerator
amplitude_generator = HelicityAmplitudeGenerator()
amplitude_generator.generate(solutions)
amplitude_generator.write_to_file("amplitude_model_helicity.yml")
Cool, that’s it! Now we have a recipe for an amplitude model with which to generate data and perform a fit!