Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Commit 622b11e

Browse files
committed
Add notebook with AmpForm v0.15.9 test
1 parent 0b26a65 commit 622b11e

3 files changed

Lines changed: 108 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
--no-dev \
2626
jupyter lite build \
2727
--contents docs/Dp-to-pip-pip-pim.ipynb \
28+
--contents docs/Dp-to-pip-pip-pim-fixed.ipynb \
2829
--output-dir lite
2930
- uses: actions/upload-pages-artifact@v3
3031
with:

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ To contribute to this repository, all you need to install is [`uv`](https://docs
1313
--no-dev \
1414
jupyter lite build \
1515
--contents docs/Dp-to-pip-pip-pim.ipynb \
16+
--contents docs/Dp-to-pip-pip-pim-fixed.ipynb \
1617
--output-dir lite
1718
```
1819
- Run all notebooks

docs/Dp-to-pip-pip-pim-fixed.ipynb

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Symmetrization of $D^+ \\to \\pi^+ \\pi^+ \\pi^-$"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": null,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"%pip install ampform==0.15.9"
17+
]
18+
},
19+
{
20+
"cell_type": "code",
21+
"execution_count": null,
22+
"metadata": {
23+
"jupyter": {
24+
"source_hidden": true
25+
},
26+
"mystnb": {
27+
"code_prompt_show": "Import Python libraries"
28+
},
29+
"tags": [
30+
"hide-cell"
31+
]
32+
},
33+
"outputs": [],
34+
"source": [
35+
"import ampform\n",
36+
"import qrules\n",
37+
"from ampform.dynamics.builder import (\n",
38+
" RelativisticBreitWignerBuilder,\n",
39+
" create_non_dynamic_with_ff,\n",
40+
")\n",
41+
"from ampform.io import aslatex\n",
42+
"from IPython.display import Math"
43+
]
44+
},
45+
{
46+
"cell_type": "code",
47+
"execution_count": null,
48+
"metadata": {},
49+
"outputs": [],
50+
"source": [
51+
"reaction = qrules.generate_transitions(\n",
52+
" initial_state=\"D+\",\n",
53+
" final_state=[\"pi+\", \"pi+\", \"pi-\"],\n",
54+
" allowed_intermediate_particles=[\"rho(770)0\"],\n",
55+
" formalism=\"helicity\",\n",
56+
")\n",
57+
"resonances = reaction.get_intermediate_particles()\n",
58+
"assert resonances.names == [\"rho(770)0\"]\n",
59+
"resonances"
60+
]
61+
},
62+
{
63+
"cell_type": "code",
64+
"execution_count": null,
65+
"metadata": {},
66+
"outputs": [],
67+
"source": [
68+
"bw_builder = RelativisticBreitWignerBuilder(\n",
69+
" energy_dependent_width=True,\n",
70+
" form_factor=True,\n",
71+
")\n",
72+
"model_builder = ampform.HelicityAmplitudeBuilder(reaction)\n",
73+
"model_builder.dynamics.assign(\"D+\", create_non_dynamic_with_ff)\n",
74+
"for name in reaction.get_intermediate_particles().names:\n",
75+
" model_builder.dynamics.assign(name, bw_builder)\n",
76+
"model = model_builder.formulate()\n",
77+
"model.intensity\n",
78+
"Math(aslatex(model.amplitudes, terms_per_line=1))"
79+
]
80+
}
81+
],
82+
"metadata": {
83+
"colab": {
84+
"toc_visible": true
85+
},
86+
"kernelspec": {
87+
"display_name": "Python 3 (ipykernel)",
88+
"language": "python",
89+
"name": "python3"
90+
},
91+
"language_info": {
92+
"codemirror_mode": {
93+
"name": "ipython",
94+
"version": 3
95+
},
96+
"file_extension": ".py",
97+
"mimetype": "text/x-python",
98+
"name": "python",
99+
"nbconvert_exporter": "python",
100+
"pygments_lexer": "ipython3",
101+
"version": "3.12.11"
102+
}
103+
},
104+
"nbformat": 4,
105+
"nbformat_minor": 4
106+
}

0 commit comments

Comments
 (0)