Standard lineshapes

Note

The formulas and figures on this page have been generated with the lineshapes in the lineshape module, so as to glue them back in to the API of that module.

import myst_nb
import sympy as sp

from ampform.dynamics.lineshape import (
    BlattWeisskopf,
    relativistic_breit_wigner,
    relativistic_breit_wigner_with_ff,
)
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from qrules.combinatorics import arange


def plot_real_imag(
    expression: sp.Expr,
    variable: sp.Symbol,
    x_min: float,
    x_max: float,
    resolution: int = 100,
) -> Figure:
    delta = (x_max - x_min) / resolution
    x = list(arange(x_min, x_max, delta))
    y_real = list(map(lambda x: sp.Abs(expression).subs(variable, x), x))
    y_imag = list(map(lambda x: sp.arg(expression).subs(variable, x), x))
    fig, ax = plt.subplots(nrows=2, sharex=True, figsize=(8, 8))
    for a in ax:
        a.xaxis.set_ticks([])
        a.yaxis.set_ticks([])
    ax_real, ax_imag = ax
    ax_imag.set(xlabel=f"${variable.name}$")
    ax_imag.set(ylabel=f"imag $f({variable.name})$")
    ax_real.set(ylabel=f"real $f({variable.name})$")
    ax_real.yaxis.set_ticks([])
    ax_imag.yaxis.set_ticks([0, float(sp.pi)])
    ax_imag.yaxis.set_ticklabels([0, R"$\pi$"])
    ax_imag.set_ylim([0, float(sp.pi)])
    ax_real.plot(x, y_real)
    ax_imag.plot(x, y_imag)
    return fig

Form factor

AmpForm uses BlattWeisskopf functions \(B_L\) as barrier factors (also called form factors):

z, q, d, L = sp.symbols("z, q, d, L", real=True)
ff2 = BlattWeisskopf(q, d, L) ** 2
display(ff2)
myst_nb.glue("BlattWeisskopf", ff2.doit().subs({(d * q) ** 2: z}))
\[\displaystyle B_L\left(q\right)^{2}\]
\[\begin{split}\displaystyle \begin{cases} 1 & \text{for}\: L = 0 \\\frac{2 z}{z + 1} & \text{for}\: L = 1 \\\frac{13 z^{2}}{9 z + \left(z - 3\right)^{2}} & \text{for}\: L = 2 \\\frac{277 z^{3}}{z \left(z - 15\right)^{2} + \left(2 z - 5\right) \left(18 z - 45\right)} & \text{for}\: L = 3 \\\frac{12746 z^{4}}{25 z \left(2 z - 21\right)^{2} + \left(z^{2} - 45 z + 105\right)^{2}} & \text{for}\: L = 4 \\\frac{998881 z^{5}}{z^{5} + 15 z^{4} + 315 z^{3} + 6300 z^{2} + 99225 z + 893025} & \text{for}\: L = 5 \\\frac{118394977 z^{6}}{z^{6} + 21 z^{5} + 630 z^{4} + 18900 z^{3} + 496125 z^{2} + 9823275 z + 108056025} & \text{for}\: L = 6 \\\frac{19727003738 z^{7}}{z^{7} + 28 z^{6} + 1134 z^{5} + 47250 z^{4} + 1819125 z^{3} + 58939650 z^{2} + 1404728325 z + 18261468225} & \text{for}\: L = 7 \\\frac{4392846440677 z^{8}}{z^{8} + 36 z^{7} + 1890 z^{6} + 103950 z^{5} + 5457375 z^{4} + 255405150 z^{3} + 9833098275 z^{2} + 273922023375 z + 4108830350625} & \text{for}\: L = 8 \end{cases}\end{split}\]

with \(z = (dq)^2\).

Relativistic Breit-Wigner

Without form factor

See relativistic_breit_wigner():

m, m0, w0 = sp.symbols("m m0 Gamma", real=True)
myst_nb.glue(
    "relativistic_breit_wigner",
    relativistic_breit_wigner(m, m0, w0),
)
\[\displaystyle \frac{\Gamma m_{0}}{- i \Gamma m_{0} - m^{2} + m_{0}^{2}}\]
plot_real_imag(relativistic_breit_wigner(m, 1.0, 0.3), m, x_min=0, x_max=2);
../../_images/lineshapes_13_0.svg

With form factor

See relativistic_breit_wigner_with_ff():

L = 0
m, m0, w0, ma, mb, meson_radius = sp.symbols(
    "m m0 Gamma m_a m_b q_r", real=True
)
myst_nb.glue(
    "relativistic_breit_wigner_with_ff",
    relativistic_breit_wigner_with_ff(
        mass=m,
        mass0=m0,
        gamma0=w0,
        m_a=ma,
        m_b=mb,
        angular_momentum=L,
        meson_radius=meson_radius,
    ).doit(),
)
\[\displaystyle \frac{\Gamma m_{0}}{- \frac{i \Gamma m_{0}^{2} \sqrt{\frac{\left(m^{2} - \left(m_{a} - m_{b}\right)^{2}\right) \left(m^{2} - \left(m_{a} + m_{b}\right)^{2}\right)}{m^{2}}}}{m \sqrt{\frac{\left(m_{0}^{2} - \left(m_{a} - m_{b}\right)^{2}\right) \left(m_{0}^{2} - \left(m_{a} + m_{b}\right)^{2}\right)}{m_{0}^{2}}}} - m^{2} + m_{0}^{2}}\]
ma = 0.2
mb = 0.3
complex_bw_ff = relativistic_breit_wigner_with_ff(
    mass=m,
    mass0=1.0,
    gamma0=0.3,
    m_a=ma,
    m_b=mb,
    angular_momentum=0,
    meson_radius=1,
)
plot_real_imag(complex_bw_ff.doit(), m, x_min=ma + mb, x_max=2);
../../_images/lineshapes_17_0.svg