Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: show unaligned amplitudes in spin alignment page #321

Merged
merged 2 commits into from
Aug 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 69 additions & 1 deletion docs/usage/helicity/spin-alignment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"from IPython.display import Math\n",
"\n",
"import ampform\n",
"from ampform.helicity import HelicityModel\n",
"from ampform.io import aslatex, improve_latex_rendering\n",
"\n",
"LOGGER = logging.getLogger()\n",
Expand Down Expand Up @@ -166,6 +167,41 @@
"non_aligned_model.intensity"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The symbols for the amplitudes are defined through {attr}`.HelicityModel.amplitudes`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"jupyter": {
"source_hidden": true
},
"tags": [
"full-width",
"hide-input"
]
},
"outputs": [],
"source": [
"def render_amplitudes(model: HelicityModel) -> Math:\n",
" selected_amplitudes = {\n",
" symbol: expr\n",
" for i, (symbol, expr) in enumerate(model.amplitudes.items())\n",
" if i % 5 == 0\n",
" }\n",
" src = aslatex(selected_amplitudes)\n",
" src = src.replace(R\"\\end{array}\", R\"& \\dots \\\\ \\end{array}\")\n",
" return Math(src)\n",
"\n",
"\n",
"render_amplitudes(non_aligned_model)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -179,7 +215,11 @@
"source": [
"One way of aligning the spins of each sub-system, is Dalitz-Plot Decomposition (DPD) {cite}`mikhasenkoDalitzplotDecompositionThreebody2020`. DPD **can only be used for three-body decays**, but results in a quite condense amplitude model expression.\n",
"\n",
"We can select DPD alignment as follows:"
"We can select DPD alignment as follows:\n",
"\n",
":::{warning}\n",
"The {class}`.DalitzPlotDecomposition` is not yet fully functional for reactions with a polarized initial or final state. In this example, the sums inside the incoherent sum should also include $\\lambda_0=0$.\n",
":::"
]
},
{
Expand Down Expand Up @@ -260,6 +300,34 @@
"Math(src)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that the amplitudes are the same as those in the non-aligned model:\n",
"\n",
":::{warning}\n",
"This behavior is a bug that will be fixed through [ComPWA/ampform#318](https://github.com/ComPWA/ampform/issues/318).\n",
":::"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"jupyter": {
"source_hidden": true
},
"tags": [
"full-width",
"hide-input"
]
},
"outputs": [],
"source": [
"render_amplitudes(dpd_model)"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down