Welcome to AmpForm!#
AmpForm automatically formulates amplitude models for arbitrary particle transitions in order to do a partial-waves analysis. All allowed transitions between some initial and final state are generated with the qrules package. You can then use ampform to formulate these state transitions into an amplitude model with some formalism, like the helicity formalism.
Scan which resonances are allowed for a given particle decay, then formulate the amplitude model automatically with the spin formalism of your choice.
AmpForm amplitude models are formulated symbolically with SymPy, so that you can easily inspect the mathematical expressions and modify then algebraically.
Customize dynamics lineshapes in the amplitude builder, for instance if you needsome additional background terms, without having to tweak the entire framework.
The amplitude models are converted to computational back-ends like JAX, TensorFlow, and NumPy. The TensorWaves package facilitates this and also provides tools to generate toy Monte Carlo data samples.
All this functionality is offered in an open and transparent style, so that you can navigate AmpForm’s output and feed it to whatever other Python packages come in handy for you. For instance, check out inspect the model interactively to see how to inspect your model with an interactive widget.
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.
Dynamics parametrizations#
AmpForm offers a number of functions for parametrizing dynamics lineshapes. 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
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)++",
],
)
builder = ampform.get_builder(reaction)
model = builder.formulate()
model.intensity
Tip
Amplitude models for three-body decays that involve spin in the final state are best formulated with the AmpForm-DPD extension.
Advanced examples#
The following pages provide more advanced examples of how to use AmpForm.