Usage#
Overview#
Library of symbolic dynamics functions#
AmpForm offers a number of dynamics parametrization functions. The functions are expressed with sympy
, so that they can easily be visualized, simplified, or modified:
import sympy as sp
from ampform.dynamics import relativistic_breit_wigner
m, m0, w0 = sp.symbols("m m0 Gamma0")
relativistic_breit_wigner(s=m**2, mass0=m0, gamma0=w0)
from ampform.dynamics import relativistic_breit_wigner_with_ff
m1, m2, L = sp.symbols("m1 m2 L")
relativistic_breit_wigner_with_ff(
s=m**2,
mass0=m0,
gamma0=w0,
m_a=m1,
m_b=m2,
angular_momentum=L,
meson_radius=1,
)
from ampform.dynamics.kmatrix import NonRelativisticKMatrix
n_poles = sp.Symbol("n_R", integer=True, positive=True)
NonRelativisticKMatrix.formulate(
n_poles=n_poles,
n_channels=1,
)[0, 0]
matrix = NonRelativisticKMatrix.formulate(n_poles=1, n_channels=2)
matrix[0, 0].doit().simplify()
More dynamics functions can be found in the dynamics
library, as well as on the Dynamics page!
Formulate amplitude models#
Together with QRules, AmpForm can automatically formulate amplitude models for generic, multi-body decays. These models can then be used as templates for faster computational back-ends with TensorWaves. Hereās an example:
import qrules
reaction = qrules.generate_transitions(
initial_state=("psi(4160)", [-1, +1]),
final_state=["D-", "D0", "pi+"],
allowed_intermediate_particles=["D*(2007)0"],
formalism="helicity",
)
import ampform
from ampform.dynamics.builder import create_relativistic_breit_wigner
builder = ampform.get_builder(reaction)
for particle in reaction.get_intermediate_particles():
builder.dynamics.assign(particle.name, create_relativistic_breit_wigner)
model = builder.formulate()
model.intensity
Show code cell source
from ampform.io import aslatex
(symbol, expr), *_ = model.amplitudes.items()
Math(aslatex({symbol: expr}, terms_per_line=1))
In case of multiple decay topologies, AmpForm also takes care of spin alignment with [Marangotto, 2020]!
reaction = qrules.generate_transitions(
initial_state="Lambda(c)+",
final_state=["p", "K-", "pi+"],
allowed_intermediate_particles=[
"Lambda(1405)",
"Delta(1232)++",
],
)
Show code cell source
import graphviz
dot = qrules.io.asdot(reaction, collapse_graphs=True)
graphviz.Source(dot)
builder = ampform.get_builder(reaction)
model = builder.formulate()
model.intensity
Advanced examples#
The following pages provide more advanced examples of how to use AmpForm. You can run each of them as Jupyter notebooks with the launch button in the top-right corner.