decayamplitude 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- decayamplitude-0.1.0/.gitignore +9 -0
- decayamplitude-0.1.0/.pre-commit-config.yaml +48 -0
- decayamplitude-0.1.0/LICENSE.md +19 -0
- decayamplitude-0.1.0/PKG-INFO +191 -0
- decayamplitude-0.1.0/README.md +166 -0
- decayamplitude-0.1.0/docs/Makefile +20 -0
- decayamplitude-0.1.0/docs/conf.py +29 -0
- decayamplitude-0.1.0/docs/index.rst +23 -0
- decayamplitude-0.1.0/docs/make.bat +35 -0
- decayamplitude-0.1.0/examples/elisabeth_example/amplitude.py +295 -0
- decayamplitude-0.1.0/examples/elisabeth_example/generate_momenta.py +84 -0
- decayamplitude-0.1.0/examples/four_body_semileptonic.py +161 -0
- decayamplitude-0.1.0/examples/run_examples.sh +3 -0
- decayamplitude-0.1.0/examples/simple_threebody.py +346 -0
- decayamplitude-0.1.0/examples/test_data/Parsed_ccp_kinematics_100events.json +3269 -0
- decayamplitude-0.1.0/examples/test_data/cpp_100_events_sign2pi_unmodified.json +18402 -0
- decayamplitude-0.1.0/examples/three_body_jpsi.py +180 -0
- decayamplitude-0.1.0/examples/utils.py +77 -0
- decayamplitude-0.1.0/pyproject.toml +65 -0
- decayamplitude-0.1.0/src/decayamplitude/__init__.py +0 -0
- decayamplitude-0.1.0/src/decayamplitude/arguments.py +10 -0
- decayamplitude-0.1.0/src/decayamplitude/backend.py +3 -0
- decayamplitude-0.1.0/src/decayamplitude/chain.py +608 -0
- decayamplitude-0.1.0/src/decayamplitude/combiner.py +137 -0
- decayamplitude-0.1.0/src/decayamplitude/kinematics_helpers.py +20 -0
- decayamplitude-0.1.0/src/decayamplitude/resonance.py +249 -0
- decayamplitude-0.1.0/src/decayamplitude/rotation.py +220 -0
- decayamplitude-0.1.0/src/decayamplitude/utils.py +77 -0
- decayamplitude-0.1.0/tests/test_chains.py +85 -0
- decayamplitude-0.1.0/tests/test_threebody.py +340 -0
- decayamplitude-0.1.0/workflows/pre-commit.yml +16 -0
- decayamplitude-0.1.0/workflows/testpypi-release.yml +59 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
ci:
|
|
2
|
+
autoupdate_commit_msg: "MAINT: update pre-commit configuration"
|
|
3
|
+
autoupdate_schedule: quarterly
|
|
4
|
+
|
|
5
|
+
repos:
|
|
6
|
+
- repo: meta
|
|
7
|
+
hooks:
|
|
8
|
+
- id: check-hooks-apply
|
|
9
|
+
- id: check-useless-excludes
|
|
10
|
+
|
|
11
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
12
|
+
rev: v4.6.0
|
|
13
|
+
hooks:
|
|
14
|
+
- id: check-case-conflict
|
|
15
|
+
- id: check-json
|
|
16
|
+
- id: check-merge-conflict
|
|
17
|
+
- id: check-toml
|
|
18
|
+
- id: check-yaml
|
|
19
|
+
- id: end-of-file-fixer
|
|
20
|
+
- id: mixed-line-ending
|
|
21
|
+
|
|
22
|
+
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
23
|
+
rev: v4.0.0-alpha.8
|
|
24
|
+
hooks:
|
|
25
|
+
- id: prettier
|
|
26
|
+
|
|
27
|
+
- repo: https://github.com/econchick/interrogate
|
|
28
|
+
rev: 1.7.0
|
|
29
|
+
hooks:
|
|
30
|
+
- id: interrogate
|
|
31
|
+
exclude: "src/decayangle/__*|tests/*|src/decayangle/backend.py"
|
|
32
|
+
args: [--fail-under=80, --verbose]
|
|
33
|
+
|
|
34
|
+
- repo: https://github.com/codespell-project/codespell
|
|
35
|
+
rev: v1.16.0
|
|
36
|
+
hooks:
|
|
37
|
+
- id: codespell
|
|
38
|
+
name: codespell
|
|
39
|
+
description: Checks for common misspellings in text files.
|
|
40
|
+
entry: codespell README.md
|
|
41
|
+
language: python
|
|
42
|
+
types: [text]
|
|
43
|
+
exclude: "notebooks/*"
|
|
44
|
+
|
|
45
|
+
- repo: https://github.com/psf/black
|
|
46
|
+
rev: 24.4.2
|
|
47
|
+
hooks:
|
|
48
|
+
- id: black
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2025 Kai Habermann
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: decayamplitude
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A tool for modeling of amplitudes using jax
|
|
5
|
+
Project-URL: Documentation, https://kaihabermann.github.io/decayamplitude/
|
|
6
|
+
Project-URL: Issues, https://github.com/KaiHabermann/decayamplitude/issues
|
|
7
|
+
Project-URL: Source, https://github.com/KaiHabermann/decayamplitude
|
|
8
|
+
Author-email: Kai Habermann <kai.sebastian.habermann@cern.ch>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE.md
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
17
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Requires-Dist: decayangle==1.1.2
|
|
20
|
+
Requires-Dist: jax
|
|
21
|
+
Requires-Dist: jaxlib
|
|
22
|
+
Requires-Dist: numpy
|
|
23
|
+
Requires-Dist: sympy
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# Welcome to the decayamplitude software Project
|
|
27
|
+
|
|
28
|
+
[](https://pypi.org/project/decayamplitude/)
|
|
29
|
+
[](https://pypi.org/project/decayamplitude/)
|
|
30
|
+
[](https://codecov.io/gh/KaiHabermann/decayamplitude)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
**Table of Contents**
|
|
36
|
+
|
|
37
|
+
- [Installation](#installation)
|
|
38
|
+
- [Goal](#goal)
|
|
39
|
+
- [Related projects](#related-projects)
|
|
40
|
+
- [How to cite](#how-to-cite)
|
|
41
|
+
- [License](#license)
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
```console
|
|
46
|
+
pip install decayamplitude
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Goal
|
|
50
|
+
|
|
51
|
+
The software project `decayamplitude` provides an amplitude package working in tandem with `decayangle` to build full cascade reaction amplitudes.
|
|
52
|
+
The main goal is to provide a simple interface to build decay chains and their amplitudes, which can be used in amplitude analyses.
|
|
53
|
+
|
|
54
|
+
## Online Decay Editor
|
|
55
|
+
|
|
56
|
+
There is a beta version of a web based decay editor, which is hosted [here](https://kaihabermann.github.io/DecaySelector/).
|
|
57
|
+
The Website allows for an easy selection of a decay and resonances. Once finished a script generating an amplitude with `decayamplitude` can be downloaded.
|
|
58
|
+
This is usually the easiest and quickest way to get a working amplitude. Explicit lineshapes need then to be defined by the user, where it is marked in the downloaded script.
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
```python
|
|
62
|
+
from decayamplitude.resonance import Resonance
|
|
63
|
+
from decayamplitude.rotation import QN, Angular
|
|
64
|
+
from decayamplitude.chain import DecayChain, MultiChain
|
|
65
|
+
from decayamplitude.combiner import ChainCombiner
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
from decayangle.decay_topology import Topology, Node, TopologyCollection
|
|
71
|
+
|
|
72
|
+
# First we define the final state
|
|
73
|
+
final_state_qn = {
|
|
74
|
+
1: QN(1, 1),
|
|
75
|
+
2: QN(2, 1),
|
|
76
|
+
3: QN(0, 1)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
# decayangles Topology class is used to generate the angular variables. Be carefull here, as fit results may depend on the ordering.
|
|
80
|
+
|
|
81
|
+
topology1 = Topology(
|
|
82
|
+
0,
|
|
83
|
+
decay_topology=((2,3), 1)
|
|
84
|
+
)
|
|
85
|
+
topology2 = Topology(
|
|
86
|
+
0,
|
|
87
|
+
decay_topology=((1, 2), 3)
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
# alternatively we can use the topology collection to define all topologies automatically
|
|
91
|
+
tg = TopologyCollection(
|
|
92
|
+
0,
|
|
93
|
+
[1,2,3]
|
|
94
|
+
)
|
|
95
|
+
tg.topologies
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
We now have a basic definition of our decay scheme. But we need resonances to react. In general for a multi body decay we want to define a list of resonances for each isobar. Then let the code figure out all the possible decay chains.
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
resonances1 = {
|
|
102
|
+
# we need to define resonances for each internal node of the decay chain
|
|
103
|
+
# A resonance needs a node, to which it couples, quantum numbers, a lineshape
|
|
104
|
+
# and a list of argument names, which will be used to map the parameters of the resonance
|
|
105
|
+
# to the outside, once all our configurations are combined into an amplitude
|
|
106
|
+
(2,3): Resonance(topology1.nodes[(2, 3)],
|
|
107
|
+
quantum_numbers=QN(0, -1),
|
|
108
|
+
lineshape=BW_lineshape(topology1.nodes[(2, 3)].mass(momenta)),
|
|
109
|
+
argnames=["gamma1", "m01"]),
|
|
110
|
+
|
|
111
|
+
# since we can not only model decays, but also transitions from 2 particle
|
|
112
|
+
# to many particles
|
|
113
|
+
# Thus we may have to model multiple initial resonances and their production
|
|
114
|
+
# with a lineshape
|
|
115
|
+
# For decays we can use a constant lineshape
|
|
116
|
+
# The preserve_parity flag controlls which L S couplings will be produced,
|
|
117
|
+
# if one uses the automated generation of the possible couplings
|
|
118
|
+
# This has no effect if one plugs in couplings by hand
|
|
119
|
+
0: Resonance(Node(0), quantum_numbers=QN(1, 1),
|
|
120
|
+
lineshape=constant_lineshape,
|
|
121
|
+
argnames=[],
|
|
122
|
+
preserve_partity=False)
|
|
123
|
+
|
|
124
|
+
# we use the argnames, to use the same mass for both BW lineshapes, but different widths
|
|
125
|
+
resonances2 = {
|
|
126
|
+
(1, 2): Resonance(nodes_2[(1, 2)], quantum_numbers=QN(3, -1), lineshape=BW_lineshape(nodes_2[(1, 2)].mass(momenta)), argnames=["gamma2", "m01"]),
|
|
127
|
+
0: Resonance(Node(0), quantum_numbers=QN(1, 1), lineshape=constant_lineshape, argnames=[], preserve_partity=False)
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Now we can take the resonance dictionaries and combine them with a topology in order to produce a `DecayChain`.
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
chain1 = DecayChain(topology = topology1,
|
|
136
|
+
resonances = resonances1,
|
|
137
|
+
momenta = momenta,
|
|
138
|
+
final_state_qn = final_state_qn)
|
|
139
|
+
|
|
140
|
+
chain2 = DecayChain(topology = topology2,
|
|
141
|
+
resonances = resonances2,
|
|
142
|
+
momenta = momenta,
|
|
143
|
+
final_state_qn = final_state_qn)
|
|
144
|
+
```
|
|
145
|
+
These chains are already able to produce a chain function, which can be evaluated for a given set of parameters.
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
chain1.chain_function
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
We can now combine the chains into a `ChainCombiner` object. This object will internally take care of the alignmeht operations.
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
combined = ChainCombiner([chain1, chain2])
|
|
155
|
+
|
|
156
|
+
# we can generate the unpolarized amplitude
|
|
157
|
+
unpolarized, argnames = combined.unpolarized_amplitude(combined.generate_couplings())
|
|
158
|
+
# unpolarized(*args) will return the amplitude for the given parameters
|
|
159
|
+
|
|
160
|
+
# we can generate the matix elements depending on the polarization of the particles
|
|
161
|
+
polarized, lambdas, argnames = combined.polarized_amplitude(combined.generate_couplings())
|
|
162
|
+
# polarized(*lambdas, *args) will return the amplitude for the given parameters and polarization
|
|
163
|
+
|
|
164
|
+
# here we get a list of aditional function parameters, which represent the polarization of the initial and final state particles
|
|
165
|
+
# lambdas = ["h_0", "h_1", "h_2", "h_3"]
|
|
166
|
+
|
|
167
|
+
# alternatively we can produce all matrix elements at once
|
|
168
|
+
matrx_function, matrix_argnames = combined.matrix_function(combined.generate_couplings())
|
|
169
|
+
# here we only have the initial state polarization as an additional parameter
|
|
170
|
+
# matrix_argnames = ["h_0"] + argnames
|
|
171
|
+
# matrx_function(h_0, *args) will return the amplitude for the given parameters and polarization
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Related projects
|
|
176
|
+
|
|
177
|
+
Amplitude analyses dealing with non-zero spin of final-state particles have to implement wigner rotations in some way.
|
|
178
|
+
However, there are a few projects addressing these rotations explicitly using analytic expressions in [DPD paper](https://inspirehep.net/literature/1758460), derived for three-body decays:
|
|
179
|
+
|
|
180
|
+
- [ThreeBodyDecays.jl](https://github.com/mmikhasenko/ThreeBodyDecays.jl),
|
|
181
|
+
- [SymbolicThreeBodyDecays.jl](https://github.com/mmikhasenko/SymbolicThreeBodyDecays.jl),
|
|
182
|
+
- [ComPWA/ampform-dpd](https://github.com/ComPWA/ampform-dpd).
|
|
183
|
+
|
|
184
|
+
## How to cite
|
|
185
|
+
|
|
186
|
+
This software package as well as the closely related [decayangle](https://github.com/KaiHabermann/decayangle) should be cited by the accompaning paper
|
|
187
|
+
[Wigner Rotations for Cascade Reactions](https://doi.org/10.1103/PhysRevD.111.056015)
|
|
188
|
+
|
|
189
|
+
## License
|
|
190
|
+
|
|
191
|
+
`decayamplitude` is distributed under the terms of the [MIT](https://mit-license.org/) license.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Welcome to the decayamplitude software Project
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/decayamplitude/)
|
|
4
|
+
[](https://pypi.org/project/decayamplitude/)
|
|
5
|
+
[](https://codecov.io/gh/KaiHabermann/decayamplitude)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Table of Contents**
|
|
11
|
+
|
|
12
|
+
- [Installation](#installation)
|
|
13
|
+
- [Goal](#goal)
|
|
14
|
+
- [Related projects](#related-projects)
|
|
15
|
+
- [How to cite](#how-to-cite)
|
|
16
|
+
- [License](#license)
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```console
|
|
21
|
+
pip install decayamplitude
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Goal
|
|
25
|
+
|
|
26
|
+
The software project `decayamplitude` provides an amplitude package working in tandem with `decayangle` to build full cascade reaction amplitudes.
|
|
27
|
+
The main goal is to provide a simple interface to build decay chains and their amplitudes, which can be used in amplitude analyses.
|
|
28
|
+
|
|
29
|
+
## Online Decay Editor
|
|
30
|
+
|
|
31
|
+
There is a beta version of a web based decay editor, which is hosted [here](https://kaihabermann.github.io/DecaySelector/).
|
|
32
|
+
The Website allows for an easy selection of a decay and resonances. Once finished a script generating an amplitude with `decayamplitude` can be downloaded.
|
|
33
|
+
This is usually the easiest and quickest way to get a working amplitude. Explicit lineshapes need then to be defined by the user, where it is marked in the downloaded script.
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
```python
|
|
37
|
+
from decayamplitude.resonance import Resonance
|
|
38
|
+
from decayamplitude.rotation import QN, Angular
|
|
39
|
+
from decayamplitude.chain import DecayChain, MultiChain
|
|
40
|
+
from decayamplitude.combiner import ChainCombiner
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
from decayangle.decay_topology import Topology, Node, TopologyCollection
|
|
46
|
+
|
|
47
|
+
# First we define the final state
|
|
48
|
+
final_state_qn = {
|
|
49
|
+
1: QN(1, 1),
|
|
50
|
+
2: QN(2, 1),
|
|
51
|
+
3: QN(0, 1)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
# decayangles Topology class is used to generate the angular variables. Be carefull here, as fit results may depend on the ordering.
|
|
55
|
+
|
|
56
|
+
topology1 = Topology(
|
|
57
|
+
0,
|
|
58
|
+
decay_topology=((2,3), 1)
|
|
59
|
+
)
|
|
60
|
+
topology2 = Topology(
|
|
61
|
+
0,
|
|
62
|
+
decay_topology=((1, 2), 3)
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# alternatively we can use the topology collection to define all topologies automatically
|
|
66
|
+
tg = TopologyCollection(
|
|
67
|
+
0,
|
|
68
|
+
[1,2,3]
|
|
69
|
+
)
|
|
70
|
+
tg.topologies
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
We now have a basic definition of our decay scheme. But we need resonances to react. In general for a multi body decay we want to define a list of resonances for each isobar. Then let the code figure out all the possible decay chains.
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
resonances1 = {
|
|
77
|
+
# we need to define resonances for each internal node of the decay chain
|
|
78
|
+
# A resonance needs a node, to which it couples, quantum numbers, a lineshape
|
|
79
|
+
# and a list of argument names, which will be used to map the parameters of the resonance
|
|
80
|
+
# to the outside, once all our configurations are combined into an amplitude
|
|
81
|
+
(2,3): Resonance(topology1.nodes[(2, 3)],
|
|
82
|
+
quantum_numbers=QN(0, -1),
|
|
83
|
+
lineshape=BW_lineshape(topology1.nodes[(2, 3)].mass(momenta)),
|
|
84
|
+
argnames=["gamma1", "m01"]),
|
|
85
|
+
|
|
86
|
+
# since we can not only model decays, but also transitions from 2 particle
|
|
87
|
+
# to many particles
|
|
88
|
+
# Thus we may have to model multiple initial resonances and their production
|
|
89
|
+
# with a lineshape
|
|
90
|
+
# For decays we can use a constant lineshape
|
|
91
|
+
# The preserve_parity flag controlls which L S couplings will be produced,
|
|
92
|
+
# if one uses the automated generation of the possible couplings
|
|
93
|
+
# This has no effect if one plugs in couplings by hand
|
|
94
|
+
0: Resonance(Node(0), quantum_numbers=QN(1, 1),
|
|
95
|
+
lineshape=constant_lineshape,
|
|
96
|
+
argnames=[],
|
|
97
|
+
preserve_partity=False)
|
|
98
|
+
|
|
99
|
+
# we use the argnames, to use the same mass for both BW lineshapes, but different widths
|
|
100
|
+
resonances2 = {
|
|
101
|
+
(1, 2): Resonance(nodes_2[(1, 2)], quantum_numbers=QN(3, -1), lineshape=BW_lineshape(nodes_2[(1, 2)].mass(momenta)), argnames=["gamma2", "m01"]),
|
|
102
|
+
0: Resonance(Node(0), quantum_numbers=QN(1, 1), lineshape=constant_lineshape, argnames=[], preserve_partity=False)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Now we can take the resonance dictionaries and combine them with a topology in order to produce a `DecayChain`.
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
chain1 = DecayChain(topology = topology1,
|
|
111
|
+
resonances = resonances1,
|
|
112
|
+
momenta = momenta,
|
|
113
|
+
final_state_qn = final_state_qn)
|
|
114
|
+
|
|
115
|
+
chain2 = DecayChain(topology = topology2,
|
|
116
|
+
resonances = resonances2,
|
|
117
|
+
momenta = momenta,
|
|
118
|
+
final_state_qn = final_state_qn)
|
|
119
|
+
```
|
|
120
|
+
These chains are already able to produce a chain function, which can be evaluated for a given set of parameters.
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
chain1.chain_function
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
We can now combine the chains into a `ChainCombiner` object. This object will internally take care of the alignmeht operations.
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
combined = ChainCombiner([chain1, chain2])
|
|
130
|
+
|
|
131
|
+
# we can generate the unpolarized amplitude
|
|
132
|
+
unpolarized, argnames = combined.unpolarized_amplitude(combined.generate_couplings())
|
|
133
|
+
# unpolarized(*args) will return the amplitude for the given parameters
|
|
134
|
+
|
|
135
|
+
# we can generate the matix elements depending on the polarization of the particles
|
|
136
|
+
polarized, lambdas, argnames = combined.polarized_amplitude(combined.generate_couplings())
|
|
137
|
+
# polarized(*lambdas, *args) will return the amplitude for the given parameters and polarization
|
|
138
|
+
|
|
139
|
+
# here we get a list of aditional function parameters, which represent the polarization of the initial and final state particles
|
|
140
|
+
# lambdas = ["h_0", "h_1", "h_2", "h_3"]
|
|
141
|
+
|
|
142
|
+
# alternatively we can produce all matrix elements at once
|
|
143
|
+
matrx_function, matrix_argnames = combined.matrix_function(combined.generate_couplings())
|
|
144
|
+
# here we only have the initial state polarization as an additional parameter
|
|
145
|
+
# matrix_argnames = ["h_0"] + argnames
|
|
146
|
+
# matrx_function(h_0, *args) will return the amplitude for the given parameters and polarization
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Related projects
|
|
151
|
+
|
|
152
|
+
Amplitude analyses dealing with non-zero spin of final-state particles have to implement wigner rotations in some way.
|
|
153
|
+
However, there are a few projects addressing these rotations explicitly using analytic expressions in [DPD paper](https://inspirehep.net/literature/1758460), derived for three-body decays:
|
|
154
|
+
|
|
155
|
+
- [ThreeBodyDecays.jl](https://github.com/mmikhasenko/ThreeBodyDecays.jl),
|
|
156
|
+
- [SymbolicThreeBodyDecays.jl](https://github.com/mmikhasenko/SymbolicThreeBodyDecays.jl),
|
|
157
|
+
- [ComPWA/ampform-dpd](https://github.com/ComPWA/ampform-dpd).
|
|
158
|
+
|
|
159
|
+
## How to cite
|
|
160
|
+
|
|
161
|
+
This software package as well as the closely related [decayangle](https://github.com/KaiHabermann/decayangle) should be cited by the accompaning paper
|
|
162
|
+
[Wigner Rotations for Cascade Reactions](https://doi.org/10.1103/PhysRevD.111.056015)
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
`decayamplitude` is distributed under the terms of the [MIT](https://mit-license.org/) license.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = .
|
|
9
|
+
BUILDDIR = _build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
|
2
|
+
#
|
|
3
|
+
# For the full list of built-in configuration values, see the documentation:
|
|
4
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
5
|
+
|
|
6
|
+
# -- Project information -----------------------------------------------------
|
|
7
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
8
|
+
import os, sys
|
|
9
|
+
|
|
10
|
+
sys.path.insert(0, os.path.abspath("../src/"))
|
|
11
|
+
project = "decayamplitude"
|
|
12
|
+
copyright = "2025, Kai Habermann"
|
|
13
|
+
author = "Kai Habermann"
|
|
14
|
+
release = "09.02.2025"
|
|
15
|
+
|
|
16
|
+
# -- General configuration ---------------------------------------------------
|
|
17
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
18
|
+
|
|
19
|
+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "sphinx_mdinclude"]
|
|
20
|
+
|
|
21
|
+
templates_path = ["_templates"]
|
|
22
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# -- Options for HTML output -------------------------------------------------
|
|
26
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
27
|
+
|
|
28
|
+
html_theme = "sphinx_rtd_theme"
|
|
29
|
+
html_static_path = ["_static"]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.. decayamplitude documentation master file, created by
|
|
2
|
+
sphinx-quickstart on Tue Apr 2 16:09:04 2024.
|
|
3
|
+
You can adapt this file completely to your liking, but it should at least
|
|
4
|
+
contain the root `toctree` directive.
|
|
5
|
+
|
|
6
|
+
.. Welcome to decayamplitude's documentation!
|
|
7
|
+
.. ======================================
|
|
8
|
+
|
|
9
|
+
.. automodule:: decayamplitude
|
|
10
|
+
:members:
|
|
11
|
+
|
|
12
|
+
.. toctree::
|
|
13
|
+
:maxdepth: 2
|
|
14
|
+
:caption: Contents:
|
|
15
|
+
|
|
16
|
+
.. mdinclude:: ../README.md
|
|
17
|
+
|
|
18
|
+
Indices and tables
|
|
19
|
+
==================
|
|
20
|
+
|
|
21
|
+
* :ref:`genindex`
|
|
22
|
+
* :ref:`modindex`
|
|
23
|
+
* :ref:`search`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@ECHO OFF
|
|
2
|
+
|
|
3
|
+
pushd %~dp0
|
|
4
|
+
|
|
5
|
+
REM Command file for Sphinx documentation
|
|
6
|
+
|
|
7
|
+
if "%SPHINXBUILD%" == "" (
|
|
8
|
+
set SPHINXBUILD=sphinx-build
|
|
9
|
+
)
|
|
10
|
+
set SOURCEDIR=.
|
|
11
|
+
set BUILDDIR=_build
|
|
12
|
+
|
|
13
|
+
%SPHINXBUILD% >NUL 2>NUL
|
|
14
|
+
if errorlevel 9009 (
|
|
15
|
+
echo.
|
|
16
|
+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
|
17
|
+
echo.installed, then set the SPHINXBUILD environment variable to point
|
|
18
|
+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
|
19
|
+
echo.may add the Sphinx directory to PATH.
|
|
20
|
+
echo.
|
|
21
|
+
echo.If you don't have Sphinx installed, grab it from
|
|
22
|
+
echo.https://www.sphinx-doc.org/
|
|
23
|
+
exit /b 1
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
if "%1" == "" goto help
|
|
27
|
+
|
|
28
|
+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
29
|
+
goto end
|
|
30
|
+
|
|
31
|
+
:help
|
|
32
|
+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
33
|
+
|
|
34
|
+
:end
|
|
35
|
+
popd
|