-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
258 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
```{toctree} | ||
ampform | ||
ampform-dpd | ||
manual | ||
manual-symbolic | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,257 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Amplitude model with `sympy`" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"In this notebook, we formulate the amplitude model for the $\\gamma p \\to K^+ \\pi^0 \\Lambda $ symbolically by adapting the model originally for the $\\gamma p \\to \\eta\\pi^0 p$ channel example as described in [Reaction and Models](reaction-model.md).\n", | ||
"\n", | ||
"The model we want to implement is" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"$$\n", | ||
"\\begin{array}{rcl}\n", | ||
"I &=& \\left|A^{12} + A^{23} + A^{31}\\right|^2 \\\\\n", | ||
"A^{12} &=& \\frac{\\sum a_m Y_2^m (\\Omega_1)}{s_{12}-m^2_{K^{*+}_2}+im_{K^{*+}_2} \\Gamma_{K^{*+}_2}} \\\\\n", | ||
"A^{23} &=& \\frac{\\sum b_m Y_1^m (\\Omega_2)}{s_{23}-m^2_{\\Sigma^*}+im_{\\Sigma^*} \\Gamma_{\\Sigma^*}} \\\\\n", | ||
"A^{31} &=& \\frac{c_0}{s_{31}-m^2_{N^{*+}}+im_{N^{*+}} \\Gamma_{N^{*+}}} \\,,\n", | ||
"\\end{array}\n", | ||
"$$\n", | ||
"\n", | ||
"where $1=K^+$, $2=\\pi^0$, and $3=\\Lambda$." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"jupyter": { | ||
"source_hidden": true | ||
}, | ||
"tags": [ | ||
"hide-cell" | ||
] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"from __future__ import annotations\n", | ||
"\n", | ||
"import logging\n", | ||
"import os\n", | ||
"import warnings\n", | ||
"\n", | ||
"import sympy as sp\n", | ||
"\n", | ||
"STATIC_PAGE = \"EXECUTE_NB\" in os.environ\n", | ||
"\n", | ||
"os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"3\"\n", | ||
"logging.disable(logging.WARNING)\n", | ||
"warnings.filterwarnings(\"ignore\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Model implementation" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"l_max = 2" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### $A^{12}$" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"s12, m_Kstar2, Gamma_Kstar2, l12 = sp.symbols(r\"s_{12} m_{K^*_2} \\Gamma_{K^*_2} l_{12}\")\n", | ||
"theta1, phi1 = sp.symbols(\"theta_1 phi_1\")\n", | ||
"a = sp.IndexedBase(\"a\")\n", | ||
"m = sp.symbols(\"m\", cls=sp.Idx)\n", | ||
"A12 = sp.Sum(a[m] * sp.Ynm(l12, m, theta1, phi1), (m, -l12, l12)) / (\n", | ||
" s12 - m_Kstar2**2 + sp.I * m_Kstar2 * Gamma_Kstar2\n", | ||
")\n", | ||
"A12" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"A12_funcs = [\n", | ||
" sp.lambdify(\n", | ||
" [\n", | ||
" s12,\n", | ||
" *(a[j] for j in range(-l_max, l_max + 1)),\n", | ||
" m_Kstar2,\n", | ||
" Gamma_Kstar2,\n", | ||
" theta1,\n", | ||
" phi1,\n", | ||
" ],\n", | ||
" expr=A12.subs(l12, i).doit().expand(func=True),\n", | ||
" )\n", | ||
" for i in range(l_max + 1)\n", | ||
"]\n", | ||
"A12_funcs" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### $A^{23}$" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"s23, m_Sigma, Gamma_Sigma, l23 = sp.symbols(\n", | ||
" r\"s_{23} m_{\\Sigma^{*+}} \\Gamma_{\\Sigma^{*+}} l_{23}\"\n", | ||
")\n", | ||
"b = sp.IndexedBase(\"b\")\n", | ||
"m = sp.symbols(\"m\", cls=sp.Idx)\n", | ||
"theta2, phi2 = sp.symbols(\"theta_2 phi_2\")\n", | ||
"A23 = sp.Sum(b[m] * sp.Ynm(l23, m, theta2, phi2), (m, -l23, l23)) / (\n", | ||
" s23 - m_Sigma**2 + sp.I * m_Sigma * Gamma_Sigma\n", | ||
")\n", | ||
"A23" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"A23_funcs = [\n", | ||
" sp.lambdify(\n", | ||
" [\n", | ||
" s23,\n", | ||
" *(b[j] for j in range(-l_max, l_max + 1)),\n", | ||
" m_Sigma,\n", | ||
" Gamma_Sigma,\n", | ||
" theta2,\n", | ||
" phi2,\n", | ||
" ],\n", | ||
" A23.subs(l23, i).doit().expand(func=True),\n", | ||
" )\n", | ||
" for i in range(l_max + 1)\n", | ||
"]\n", | ||
"A23_funcs" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### $A^{31}$" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"s31, m_Nstar, Gamma_Nstar = sp.symbols(r\"s_{31} m_{N^*} \\Gamma_{N^*}\")\n", | ||
"c = sp.IndexedBase(\"c\")\n", | ||
"theta3, phi3, l31 = sp.symbols(\"theta_3 phi_3 l_{31}\")\n", | ||
"A31 = sp.Sum(c[m] * sp.Ynm(l31, m, theta3, phi3), (m, -l31, l31)) / (\n", | ||
" s31 - m_Nstar**2 + sp.I * m_Nstar * Gamma_Nstar\n", | ||
")\n", | ||
"A31" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"A31_funcs = [\n", | ||
" sp.lambdify(\n", | ||
" [\n", | ||
" s31,\n", | ||
" *(c[j] for j in range(-l_max, l_max + 1)),\n", | ||
" m_Nstar,\n", | ||
" Gamma_Nstar,\n", | ||
" theta3,\n", | ||
" phi3,\n", | ||
" ],\n", | ||
" A31.subs(l31, i).doit().expand(func=True),\n", | ||
" )\n", | ||
" for i in range(l_max + 1)\n", | ||
"]\n", | ||
"A31_funcs" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### $I = |A|^2 = |A^{12}+A^{23}+A^{31}|^2$" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"intensity_expr = sp.Abs(A12 + A23 + A31) ** 2\n", | ||
"intensity_expr" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.5" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file was deleted.
Oops, something went wrong.