multipolePDM 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.
Files changed (72) hide show
  1. multipolepdm-0.1.0/LICENSE +21 -0
  2. multipolepdm-0.1.0/MANIFEST.in +4 -0
  3. multipolepdm-0.1.0/PKG-INFO +40 -0
  4. multipolepdm-0.1.0/README.md +10 -0
  5. multipolepdm-0.1.0/docs/response-reference.md +268 -0
  6. multipolepdm-0.1.0/pyproject.toml +32 -0
  7. multipolepdm-0.1.0/scripts/build_release.py +22 -0
  8. multipolepdm-0.1.0/scripts/release.py +81 -0
  9. multipolepdm-0.1.0/setup.cfg +4 -0
  10. multipolepdm-0.1.0/src/multipolePDM.egg-info/PKG-INFO +40 -0
  11. multipolepdm-0.1.0/src/multipolePDM.egg-info/SOURCES.txt +70 -0
  12. multipolepdm-0.1.0/src/multipolePDM.egg-info/dependency_links.txt +1 -0
  13. multipolepdm-0.1.0/src/multipolePDM.egg-info/entry_points.txt +3 -0
  14. multipolepdm-0.1.0/src/multipolePDM.egg-info/requires.txt +20 -0
  15. multipolepdm-0.1.0/src/multipolePDM.egg-info/top_level.txt +1 -0
  16. multipolepdm-0.1.0/src/multipolepdm/__init__.py +3 -0
  17. multipolepdm-0.1.0/src/multipolepdm/__main__.py +32 -0
  18. multipolepdm-0.1.0/src/multipolepdm/cli.py +127 -0
  19. multipolepdm-0.1.0/src/multipolepdm/config/common.py +7 -0
  20. multipolepdm-0.1.0/src/multipolepdm/config/p_ado.py +3 -0
  21. multipolepdm-0.1.0/src/multipolepdm/config/p_dco.py +10 -0
  22. multipolepdm-0.1.0/src/multipolepdm/config/pdco.py +13 -0
  23. multipolepdm-0.1.0/src/multipolepdm/contracts.py +222 -0
  24. multipolepdm-0.1.0/src/multipolepdm/examples/README.md +56 -0
  25. multipolepdm-0.1.0/src/multipolepdm/examples/example.json +45 -0
  26. multipolepdm-0.1.0/src/multipolepdm/examples/example_PDCO.json +55 -0
  27. multipolepdm-0.1.0/src/multipolepdm/examples/example_P_DCO.json +55 -0
  28. multipolepdm-0.1.0/src/multipolepdm/examples/example_batch.json +159 -0
  29. multipolepdm-0.1.0/src/multipolepdm/gui/results.py +191 -0
  30. multipolepdm-0.1.0/src/multipolepdm/gui/self_test.py +89 -0
  31. multipolepdm-0.1.0/src/multipolepdm/gui/window.py +560 -0
  32. multipolepdm-0.1.0/src/multipolepdm/io/export.py +255 -0
  33. multipolepdm-0.1.0/src/multipolepdm/io/input.py +115 -0
  34. multipolepdm-0.1.0/src/multipolepdm/jobs/manager.py +186 -0
  35. multipolepdm-0.1.0/src/multipolepdm/jobs/workers.py +26 -0
  36. multipolepdm-0.1.0/src/multipolepdm/models/p_ado.py +5 -0
  37. multipolepdm-0.1.0/src/multipolepdm/models/p_dco.py +5 -0
  38. multipolepdm-0.1.0/src/multipolepdm/models/pdco.py +5 -0
  39. multipolepdm-0.1.0/src/multipolepdm/models/registry.py +88 -0
  40. multipolepdm-0.1.0/src/multipolepdm/pdm/mapping.py +200 -0
  41. multipolepdm-0.1.0/src/multipolepdm/pdm/observations.py +63 -0
  42. multipolepdm-0.1.0/src/multipolepdm/pdm/statistics.py +229 -0
  43. multipolepdm-0.1.0/src/multipolepdm/physics/amplitudes.py +99 -0
  44. multipolepdm-0.1.0/src/multipolepdm/physics/joint.py +131 -0
  45. multipolepdm-0.1.0/src/multipolepdm/physics/populations.py +52 -0
  46. multipolepdm-0.1.0/src/multipolepdm/physics/propagation.py +43 -0
  47. multipolepdm-0.1.0/src/multipolepdm/physics/symmetries.py +34 -0
  48. multipolepdm-0.1.0/src/multipolepdm/plotting/__init__.py +16 -0
  49. multipolepdm-0.1.0/src/multipolepdm/plotting/export.py +86 -0
  50. multipolepdm-0.1.0/src/multipolepdm/plotting/intervals.py +199 -0
  51. multipolepdm-0.1.0/src/multipolepdm/plotting/overview.py +229 -0
  52. multipolepdm-0.1.0/src/multipolepdm/plotting/style.py +94 -0
  53. multipolepdm-0.1.0/tests/reference/__init__.py +1 -0
  54. multipolepdm-0.1.0/tests/reference/angular_correlation.py +422 -0
  55. multipolepdm-0.1.0/tests/reference/examples.py +69 -0
  56. multipolepdm-0.1.0/tests/test_app_regressions.py +292 -0
  57. multipolepdm-0.1.0/tests/test_azimuth_average.py +204 -0
  58. multipolepdm-0.1.0/tests/test_contracts.py +53 -0
  59. multipolepdm-0.1.0/tests/test_export_measures.py +38 -0
  60. multipolepdm-0.1.0/tests/test_forward_metadata.py +16 -0
  61. multipolepdm-0.1.0/tests/test_gui.py +66 -0
  62. multipolepdm-0.1.0/tests/test_gui_averaging.py +37 -0
  63. multipolepdm-0.1.0/tests/test_independent_reference.py +278 -0
  64. multipolepdm-0.1.0/tests/test_io.py +62 -0
  65. multipolepdm-0.1.0/tests/test_jobs.py +77 -0
  66. multipolepdm-0.1.0/tests/test_mapping.py +235 -0
  67. multipolepdm-0.1.0/tests/test_physics.py +106 -0
  68. multipolepdm-0.1.0/tests/test_plotting.py +487 -0
  69. multipolepdm-0.1.0/tests/test_reference_bridge.py +64 -0
  70. multipolepdm-0.1.0/tests/test_response_domain.py +32 -0
  71. multipolepdm-0.1.0/tests/test_responses.py +176 -0
  72. multipolepdm-0.1.0/tests/test_statistics.py +202 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 multipolePDM contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ recursive-include src/multipolepdm/examples *.json *.md
2
+ recursive-include docs *.md
3
+ recursive-include tests *.py
4
+ recursive-include scripts *.py
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.4
2
+ Name: multipolePDM
3
+ Version: 0.1.0
4
+ Summary: Probability density mapping for nuclear gamma-ray multipole mixing
5
+ License-Expression: MIT
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Topic :: Scientific/Engineering :: Physics
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: numpy>=1.24
12
+ Requires-Dist: scipy>=1.10
13
+ Requires-Dist: sympy>=1.12
14
+ Requires-Dist: matplotlib>=3.7
15
+ Requires-Dist: PySide6-Essentials>=6.6
16
+ Provides-Extra: analysis
17
+ Requires-Dist: jupyterlab>=4; extra == "analysis"
18
+ Requires-Dist: pandas>=2; extra == "analysis"
19
+ Requires-Dist: openpyxl>=3.1; extra == "analysis"
20
+ Requires-Dist: nbconvert>=7; extra == "analysis"
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest>=8; extra == "dev"
23
+ Requires-Dist: pytest-qt>=4; extra == "dev"
24
+ Requires-Dist: build>=1; extra == "dev"
25
+ Requires-Dist: twine>=5; extra == "dev"
26
+ Requires-Dist: setuptools>=77; extra == "dev"
27
+ Requires-Dist: wheel; extra == "dev"
28
+ Requires-Dist: ruff; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # multipolePDM
32
+
33
+ PDM maps measured polarization and angular-distribution / directional-correlation
34
+ densities into multipole mixing and alignment coordinates.
35
+
36
+ Development status: physics verification in progress. This source tree is not
37
+ yet an accepted scientific release. See the root project README for analysis.
38
+
39
+ From this directory, install with `python -m pip install .` using Python 3.10
40
+ or later. Launch the application with `pdm-gui` or `python -m multipolepdm`.
@@ -0,0 +1,10 @@
1
+ # multipolePDM
2
+
3
+ PDM maps measured polarization and angular-distribution / directional-correlation
4
+ densities into multipole mixing and alignment coordinates.
5
+
6
+ Development status: physics verification in progress. This source tree is not
7
+ yet an accepted scientific release. See the root project README for analysis.
8
+
9
+ From this directory, install with `python -m pip install .` using Python 3.10
10
+ or later. Launch the application with `pdm-gui` or `python -m multipolepdm`.
@@ -0,0 +1,268 @@
1
+ # PDM angular-correlation reference
2
+
3
+ `angular_correlation.py` evaluates Droste's generalized 9j radiation
4
+ coefficients and couples statistical tensors through an emission-ordered
5
+ cascade. It uses a factorial Wigner small-d implementation and SymPy's angular
6
+ momentum symbols. It never constructs a nuclear emission matrix, an observed
7
+ density matrix, or production quadratic coefficients. The standalone tests
8
+ also compare against Cartesian or closed-form cases derived separately from
9
+ the recoupled kernel.
10
+
11
+ ## Input and normalization
12
+
13
+ - `Transition.mixed(Ji, Jf, delta)` takes the signed **Droste / Krane-Steffen**
14
+ radiation amplitude ratio \(a(E2)/a(M1)\). It uses real, normalized weights
15
+ \((1,\delta)/\sqrt{1+\delta^2}\). Pure E2 uses `Transition.pure`.
16
+ - Populations are in ascending \(m\), with axial alignment and
17
+ \(p_m=p_{-m}\). `gaussian` uses the source state's \(\sigma\) in spin
18
+ units. Unobserved steps use normalized radiative multipole weights and
19
+ propagate each tensor component without fitting a new \(\sigma\).
20
+ - The direction is \((\theta,\phi)\) in radians in the common lab frame.
21
+ Parallel and perpendicular refer to the photon **electric field** along
22
+ \(\mathbf e_\theta\) and \(\mathbf e_\phi\). At a pole the supplied \(\phi\)
23
+ fixes the analyzer meridian. Polarization is a channel difference divided
24
+ by the channel sum and is undefined at zero total intensity. For an
25
+ experiment, the relation to Compton scattering counts uses the calibrated
26
+ sensitivity and analyzer response.
27
+ - Multiply the single density in \(\mathrm{sr}^{-1}\) by \(4\pi\), or the
28
+ joint density in \(\mathrm{sr}^{-2}\) by \((4\pi)^2\), to get the module
29
+ outputs. Unpolarized isotropic emission has scaled intensity one.
30
+ `joint(target=1)` is POL--DIR and `joint(target=2)` is DIR--POL. The
31
+ other photon is always summed over helicity. The reference is exercised
32
+ for real dipole/quadrupole radiation and at most one linear analyzer.
33
+
34
+ ## Tensor construction
35
+
36
+ Let \(j_i,j_f\) be the spin before and after a step, \(a,b\) the outgoing
37
+ and incoming tensor ranks, \(k\) a radiation rank, and \(d^k\) use
38
+ \(\exp(-i\theta J_y)\), with \(d^1_{10}=-\sin\theta/\sqrt2\).
39
+ Droste's Eq. (2) gives
40
+
41
+ \[
42
+ B_b(j_i)=\sqrt{2j_i+1}\sum_m(-1)^{j_i+m}
43
+ \langle j_i,-m;j_i,m\mid b,0\rangle p_m .
44
+ \]
45
+
46
+ With normalized multipole weights \(v_{TL}\), the two radiation coefficients
47
+ are sums of \(v_{TL}v_{T'L'}\) times
48
+
49
+ \[
50
+ (-1)^{L-1}
51
+ \sqrt{(2j_i+1)(2j_f+1)(2L+1)(2L'+1)(2a+1)(2b+1)}
52
+ \begin{Bmatrix} j_i&j_i&b\\ L&L'&k\\ j_f&j_f&a\end{Bmatrix}
53
+ \]
54
+
55
+ times the following helicity factors.
56
+
57
+ | Coefficient | Helicity factor |
58
+ | --- | --- |
59
+ | \(A^{ab}_{k0}\) | \(\langle L,-1;L',1\mid k,0\rangle\) |
60
+ | \(A^{ab}_{k2}\) | \((-1)^{[T'=M]}\langle L,-1;L',-1\mid k,-2\rangle\) |
61
+
62
+ These are Droste Eqs. (3), (4), (7), and (8), with the **primed**
63
+ magnetic indicator from Starosta p. 17 footnote 1. In the second row the
64
+ Clebsch-Gordan coefficient is put into \(H_k F_k\) directly. This also
65
+ defines the product when the denominator of \(H_k\) vanishes. Substituting
66
+ the original printed unprimed indicator leaves pure terms alone and reverses
67
+ the mixed E/M contribution to the Stokes numerator.
68
+
69
+ For singles or the full directional marginal of the other photon,
70
+
71
+ \[
72
+ \begin{split}
73
+ W(\theta)&=\sum_k B_k U^{\rm before}_k A^{0k}_{k0} d^k_{00}(\theta),\\
74
+ S(\theta)&=-\sum_k B_k U^{\rm before}_k A^{0k}_{k2} d^k_{02}(\theta),\\
75
+ I_\parallel&=(W+S)/2,\qquad I_\perp=(W-S)/2 .
76
+ \end{split}
77
+ \]
78
+
79
+ For the joint response a term in the directional sum is
80
+
81
+ \[
82
+ B_b U^{\rm before}_b U^{\rm between}_a(2-\delta_{\mu0})
83
+ \langle b,0;a,\mu\mid k,\mu\rangle\cos(\mu\Delta\phi)
84
+ \; A^{ab}_{k0}(1)d^k_{\mu0}(\theta_1)\,
85
+ A^{0a}_{a0}(2)d^a_{\mu0}(\theta_2).
86
+ \]
87
+
88
+ For \(S\), replace the analyzed leg's \(A_{k0}d^k_{\mu0}\) with
89
+ \(-A_{k2}(d^k_{\mu2}+(-1)^k d^k_{\mu,-2})/2\) for the first leg. For
90
+ the second leg substitute \(a\) for \(k\), which is even there. This is
91
+ Droste Eq. (16) restricted to \(\psi=0,\pi/2\) and one analyzer. With
92
+ \(U_0=1\), and \(U_k\) from the Steffen--Alder 6j expression, the fully
93
+ integrated directional intensity is one. An empty product of \(U_k\) gives
94
+ the adjacent cascade. Integrating a direction removes that detector's
95
+ angular conditioning. It preserves its unobserved spin transfer when
96
+ it occurs upstream of the target.
97
+
98
+ ## Bridge to the production helicity basis
99
+
100
+ Use \(q=m_i-m_f\), \(h=\pm1\),
101
+ \(D^L_{qh}(\phi,\theta,0)=e^{-iq\phi}d^L_{qh}(\theta)\), and define
102
+ \(\eta_E(h)=1,\ \eta_M(h)=h\). With Condon--Shortley CG coefficients,
103
+ a helicity realization of the source weights is
104
+
105
+ \[
106
+ \mathcal A_h =
107
+ \sum_{TL} v_{TL}(-1)^L \eta_T(h)
108
+ \sqrt{\frac{2L+1}{8\pi}}\,
109
+ \langle j_f m_f,Lq\mid j_i m_i\rangle D^{L*}_{qh} .
110
+ \]
111
+
112
+ Choose linear combinations \((\mathcal A_+-\mathcal A_-)/\sqrt2\)
113
+ for parallel and \((\mathcal A_++\mathcal A_-)/\sqrt2\) for perpendicular,
114
+ up to a phase per analyzer. In this helicity gauge, the \(+\) helicity
115
+ has unit E and M factor. The \(-\) helicity on the primed leg of the
116
+ off-diagonal photon product gives exactly \((-1)^{[T'=M]}\).
117
+ Changing to \(\mathcal A'_h=h\mathcal A_h\) produces the production gauge
118
+ \(\eta'_E(h)=h,\ \eta'_M(h)=1\), with parallel given by the sum.
119
+ The phase change of the analyzer and helicity conventions is common to
120
+ the multipoles.
121
+
122
+ For each fixed \(h\), integrating \(D^*_{qh}D_{q'h}\) gives
123
+ \(4\pi\,\delta_{qq'}\delta_{LL'}/(2L+1)\), with the ranks on the two
124
+ rotation factors understood to be \(L,L'\). The two helicities and
125
+ orthogonality of the nuclear CG coefficients then give
126
+ \(\sum_h\int d\Omega\,\mathcal A_h^\dagger\mathcal A_h=1\) on the
127
+ parent spin space for \(\sum_{TL}|v_{TL}|^2=1\).
128
+
129
+ Three steps give the relative \((-1)^L\) through CG/9j recoupling.
130
+
131
+ 1. Use \((-1)^{j+m'}\langle j,-m';j,m\mid b,B\rangle\) on the
132
+ spin tensor. In the conjugated photon leg reverse the CG projections
133
+ and use \(D^L_{qh}=(-1)^{q-h}D^{L*}_{-q,-h}\). With \(m'_i=m'_f+q\)
134
+ the resulting phase before permuting the 9j is \((-1)^{L-1}\).
135
+ 2. The four-angular-momentum recoupling gives the 9j with rows
136
+ \((j_f,j_f,a)\), \((L,L',k)\), \((j_i,j_i,b)\) after transposition.
137
+ Exchanging the top and bottom rows to match Droste Eq. (7) gives
138
+ \((-1)^{L+L'+a+k+b}\). This uses even \(2j_i+2j_f\) for a photon
139
+ transition. Rewriting the axial coupling
140
+ \(\langle a,\mu;k,-\mu\mid b,0\rangle\) into
141
+ \(\langle b,0;a,\mu\mid k,\mu\rangle\) and reversing the Wigner
142
+ projection contributes \((-1)^{k+b}\) for the even helicity
143
+ differences \(0,\pm 2\). The intermediate tensor rank \(a\) is even
144
+ in the one-analyzer problem.
145
+ 3. Bare helicities therefore carry an extra \((-1)^{L+L'}\) in
146
+ the source coefficient. The amplitude phase \((-1)^L\) cancels it
147
+ in every pair. Either sign of a common overall amplitude phase gives
148
+ the same observables.
149
+
150
+ An axial sign anchor is \(3/2\to1/2\) at \(\theta=\pi/2\) with only
151
+ \(|m_i|=3/2\) occupied. For \(m_i=3/2\), the \(q=1\) CGs are
152
+ \(1\) and \(1/\sqrt5\) for \(L=1,2\). The electric quadrupole \(q=2\)
153
+ CG is \(-2/\sqrt5\). Evaluating the two analyzer combinations gives
154
+ \(I_\parallel=(\sqrt3+\delta)^2/[4(1+\delta^2)]\) and
155
+ \(I_\perp=\delta^2/(1+\delta^2)\). The \(q=1\) parallel amplitudes
156
+ therefore interfere constructively at positive source \(\delta\).
157
+ Droste's 9j expression reproduces this without the helicity calculation.
158
+ At \(\delta=+0.5\) the corrected scaled Stokes numerator is
159
+ 0.796410161514. Using the printed phase yields 0.103589838486.
160
+
161
+ | E2/M1 coordinate for the same transition | Relation |
162
+ | --- | --- |
163
+ | Droste Eq. (5) and Krane--Steffen Eq. (9) | \(\delta_{\rm D96}=\delta_{\rm KS}\) for the same Bohr--Mottelson operator and state conventions |
164
+ | Bare \(CG\,D^*\) projection using the same analyzer gauge | \(\delta_{\rm bare}=-\delta_{\rm D96}\) |
165
+ | Rose--Brink normalized interaction RME ratio | \(\delta_{\rm RB}=-\delta_{\rm KS}\), from KS Eq. (5) and RB Eq. (3.39) |
166
+ | Biedenharn--Rose as related by KS Eqs. (12a,b) | \(\delta_{\rm BR}=-\delta_{\rm KS}\) for the populating gamma and \(+\delta_{\rm KS}\) for the radiating gamma |
167
+
168
+ KS Eq. (4b) uses the magnetic factor \(-i^{L-1}=i^{L+1}\).
169
+ Its electric factor is \(i^L\). Droste Eq. (5) uses the same factors
170
+ and an extra common transition normalization, so the M1 and E2 terms
171
+ share \(i^2\). This does not fix the CG/rotation basis by itself. Likewise
172
+ the KS Eq. (5) conversion to RB contains \((-1)^{I_i-I_f+L}\) after
173
+ absorbing \(\sqrt{2L+1}\) into the RB normalized ratio. The resulting
174
+ odd-rank/even-rank sign is separate from Starosta's primed-phase correction.
175
+ Use KS/Droste for production input, record source conventions when importing
176
+ signed values, and convert legacy bare-basis coordinates exactly once.
177
+
178
+ ## Numerical checks
179
+
180
+ - The standalone suite passed 24 tests. It checks angle/spin normalization,
181
+ pure E/M reciprocity, zero-spin cascades, both signs of the mixed anchor,
182
+ DCO labels and detector inversion, and numerical gate marginals in both
183
+ emission orders with a preceding step and a mixed gap. Full angular
184
+ quadrature gives unit total probability for an aligned nonadjacent cascade.
185
+ - With \(x=\cos\beta\), the analytic scaled directional responses are
186
+ \(3(1+x^2)/4\) for \(0\to1\to0\) and
187
+ \(5(1-3x^2+4x^4)/4\) for \(0\to2\to0\). The electric relative-plane
188
+ analyzer pairs are \((3x^2/4,3/4)\) and
189
+ \((5(2x^2-1)^2/4,5x^2/4)\). The dipole pair follows from the
190
+ transverse projector onto the unobserved photon's polarization plane.
191
+ The quadrupole pair follows by rotating the projected \(m=\pm1\)
192
+ substate along the gate direction and using \(d^2_{11}\pm d^2_{1,-1}\).
193
+ Rotating these analyzer pairs geometrically to the lab meridian verifies
194
+ both emission orders at noncoplanar and polar angles.
195
+ - For a nonadjacent \(0\to1\to1\to0\) case, the gap has \(U_0=1\),
196
+ \(U_2(M1)=-1/2\), \(U_2(E2)=1/10\), and \(U_2=-0.38\) at
197
+ \(\delta=\pm0.5\). The gap multiplies the rank-two parts of both the
198
+ closed-form directional and Stokes responses by \(-0.38\).
199
+ - For \(5\to4\), \(\xi=+0.4\) rad and \(\sigma=1.5\), the separate
200
+ source and radiation factors are \(B_2=-0.878251841624\) and
201
+ \(A^{02}_{20}=-0.418073711391\). Their product is the coefficient
202
+ \(+0.367174006964\) multiplying \(P_2\) in the singles distribution.
203
+ - A separate read-only production comparison of the seven `examples.py`
204
+ configurations checked both raw linear channels in each emission order,
205
+ both singles and both DCO ratios. Maximum absolute differences were
206
+ \(4.66\times10^{-15}\) for scaled joint intensities,
207
+ \(3.55\times10^{-15}\) for scaled singles, and \(1.78\times10^{-15}\)
208
+ for DCO ratios. The comparison covered the `joint_channels` and
209
+ `single_channels` physics entry points.
210
+
211
+ Droste Fig. 7 uses \(5\to4\to2\), \(\sigma=1.5\), an E2 second
212
+ transition, and the two polarization directions at \(90^\circ\) with
213
+ \(\Delta\phi=0\). The DCO ratio below puts the first photon at
214
+ \(0^\circ\) versus \(90^\circ\) in the numerator versus denominator.
215
+
216
+ | First transition | \(P_{\rm single}(1)\) | POL--DIR | DIR--POL | \(R_{\rm DCO}\) |
217
+ | --- | ---: | ---: | ---: | ---: |
218
+ | Pure E1 | 0.343428707 | 0.560408130 | 0.560408130 | 0.406200548 |
219
+ | Pure M1 | -0.343428707 | -0.560408130 | 0.560408130 | 0.406200548 |
220
+ | \(\arctan\delta=-70^\circ\) | 0.273255004 | 0.437181265 | 0.173582689 | 0.362034032 |
221
+ | \(\arctan\delta=+70^\circ\) | -0.177717135 | -0.498826923 | 0.675959927 | 1.355587917 |
222
+
223
+ The first and third rows reproduce the approximate values discussed on
224
+ p. 523. The article gives the mixed ratio as approximately 0.4. The
225
+ extra digits are reference calculations, with no digitization or refit.
226
+
227
+ Krämer--Flecken p. 334 Table 1 sets the second line as the gate and
228
+ gives \(90^\circ,38^\circ,18^\circ,\sigma/I=0.3\). Six rows match
229
+ the printed values within 0.005. Four rows give the following residuals
230
+ with the stated point geometry and a Gaussian standard deviation of
231
+ \(0.3I\). They remain unresolved as published-table replay checks.
232
+
233
+ | Cascade | Multipole orders | Printed | Reference |
234
+ | --- | --- | ---: | ---: |
235
+ | 10--8--7 | 2;2 | 0.66 | 0.637340759 |
236
+ | 10--8--8 | 2;1 | 1.07 | 1.029279931 |
237
+ | 9--8--7 | 1;2 | 0.92 | 0.970704300 |
238
+ | 9--8--8 | 1;2 | 1.12 | 1.188657467 |
239
+
240
+ The theory and experimental fractions on the same page label the generic
241
+ gate \(\gamma_1\) and target \(\gamma_2\); the numerator is target
242
+ in detector 1 with gate in detector 2. Table 1 uses the second **emitted**
243
+ line as gate. The reference treats detector labels, target/gate identities,
244
+ and emission order as independent inputs.
245
+
246
+ ## Original evidence
247
+
248
+ | Original checked | Printed locator (one-based PDF page) | Local source record |
249
+ | --- | --- | --- |
250
+ | Droste et al., NIM A 378 (1996) 518--525, DOI `10.1016/0168-9002(96)00426-3` | p. 519 (2), Eqs. (1)--(6) and Fig. 2; p. 520 (3), Eqs. (7), (8), (12); p. 521 (4), Eqs. (13)--(16); p. 522 (5), Eqs. (19)--(21); pp. 523--524 (6--7), discussion and Fig. 7 | `knowledge/sources/droste-1996-pdco-formalism.md` |
251
+ | Starosta et al., NIM A 423 (1999) 16--26, DOI `10.1016/S0168-9002(98)01220-0` | p. 17 (2), Eq. (1) and footnote 1 | `knowledge/sources/starosta-1999-pdco-experimental-test.md` |
252
+ | Steffen & Alder, ch. 12 in W. D. Hamilton (ed., 1975) | p. 552 (563), Eqs. (12.209)--(12.213), including the radiative-only condition | `knowledge/sources/book-hamilton-electromagnetic-interaction.md` |
253
+ | D. R. Hamilton, Phys. Rev. 74 (1948) 782--788 | pp. 783--784 (2--3), Eq. (1) and the E/M interchange of transverse field axes | `knowledge/sources/hamilton-1948-successive-quanta-polarization.md` |
254
+ | Krämer--Flecken et al., NIM A 275 (1989) 333--339, DOI `10.1016/0168-9002(89)90706-7` | p. 334 (2), Fig. 1, directional/experimental fractions, Table 1 | `knowledge/sources/kramer-flecken-1989-use-dco-ratios.md` |
255
+ | Krane & Steffen, Phys. Rev. C 2 (1970) 724--734 | p. 727 (4), Eqs. (4a), (4b), (5), (9), (12a), (12b) | `knowledge/sources/krane-steffen-1970-cd110-mixing-ratios.md` |
256
+ | Rose & Brink, Rev. Mod. Phys. 39 (1967) 306--347 | p. 319 (14), Eq. (3.39) | `knowledge/sources/rose-brink-1967-phase-defined-angular-distributions.md` |
257
+
258
+ The Wiki worksheet `knowledge/methods/dco-pdco-ambiguity-worksheet.md`
259
+ provided the original KS/RB locators. The signed D96 implementation was
260
+ assembled directly from the original equations before reading the
261
+ production prototype or the worksheet's audit script.
262
+
263
+ ## Run
264
+
265
+ ```sh
266
+ python -m pytest tests/test_independent_reference.py tests/test_reference_bridge.py -q
267
+ PYTHONPATH=tests python -m reference.examples
268
+ ```
@@ -0,0 +1,32 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "multipolePDM"
7
+ version = "0.1.0"
8
+ description = "Probability density mapping for nuclear gamma-ray multipole mixing"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ dependencies = ["numpy>=1.24", "scipy>=1.10", "sympy>=1.12", "matplotlib>=3.7", "PySide6-Essentials>=6.6"]
14
+ classifiers = ["Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Physics"]
15
+
16
+ [project.optional-dependencies]
17
+ analysis = ["jupyterlab>=4", "pandas>=2", "openpyxl>=3.1", "nbconvert>=7"]
18
+ dev = ["pytest>=8", "pytest-qt>=4", "build>=1", "twine>=5", "setuptools>=77", "wheel", "ruff"]
19
+
20
+ [project.scripts]
21
+ pdm-gui = "multipolepdm.__main__:main"
22
+ multipolepdm = "multipolepdm.cli:main"
23
+
24
+ [tool.setuptools.packages.find]
25
+ where = ["src"]
26
+
27
+ [tool.setuptools.package-data]
28
+ multipolepdm = ["examples/*.json", "examples/*.md"]
29
+
30
+ [tool.pytest.ini_options]
31
+ testpaths = ["tests"]
32
+ pythonpath = ["src"]
@@ -0,0 +1,22 @@
1
+ """Build and validate local artifacts; never reads credentials or uploads."""
2
+
3
+ from pathlib import Path
4
+ import subprocess
5
+ import sys
6
+
7
+
8
+ def main():
9
+ root = Path(__file__).resolve().parents[1]
10
+ subprocess.run(
11
+ [sys.executable, "-m", "build", "--no-isolation"], cwd=root, check=True
12
+ )
13
+ artifacts = sorted(
14
+ str(p)
15
+ for p in (root / "dist").iterdir()
16
+ if p.suffix == ".whl" or p.name.endswith(".tar.gz")
17
+ )
18
+ subprocess.run([sys.executable, "-m", "twine", "check", *artifacts], check=True)
19
+
20
+
21
+ if __name__ == "__main__":
22
+ main()
@@ -0,0 +1,81 @@
1
+ """Validate explicit artifacts; upload to production PyPI only with --publish.
2
+
3
+ Read the token locally at publication time. Never put tokens into command
4
+ arguments, files in this project, or diagnostic output.
5
+ """
6
+
7
+ import argparse
8
+ import os
9
+ from pathlib import Path
10
+ import re
11
+ import subprocess
12
+ import sys
13
+
14
+
15
+ def read_token(path):
16
+ for line in Path(path).read_text(encoding="utf-8").splitlines():
17
+ match = re.fullmatch(r"\s*(?:export\s+)?PYPI_API_KEY\s*=\s*(.*?)\s*", line)
18
+ if match:
19
+ token = match[1].strip().strip("\"'")
20
+ if token.startswith("pypi-") and not any(c.isspace() for c in token):
21
+ return token
22
+ raise ValueError(
23
+ "PYPI_API_KEY is present but is not a valid token-shaped value."
24
+ )
25
+ raise ValueError(
26
+ "PYPI_API_KEY was not found in the supplied local credential file."
27
+ )
28
+
29
+
30
+ def main(argv=None):
31
+ parser = argparse.ArgumentParser(description=__doc__)
32
+ parser.add_argument("artifacts", nargs="+", type=Path)
33
+ parser.add_argument("--publish", action="store_true")
34
+ parser.add_argument("--token-file", type=Path)
35
+ args = parser.parse_args(argv)
36
+ files = [p.resolve() for p in args.artifacts]
37
+ if any(
38
+ not p.is_file() or not p.name.lower().startswith("multipolepdm-") for p in files
39
+ ):
40
+ parser.error("Supply explicit, existing multipolePDM release artifacts.")
41
+ subprocess.run(
42
+ [sys.executable, "-m", "twine", "check", *map(str, files)], check=True
43
+ )
44
+ if not args.publish:
45
+ print(
46
+ "Local artifact validation only. No credentials read and no upload attempted."
47
+ )
48
+ return 0
49
+ token = (
50
+ read_token(args.token_file)
51
+ if args.token_file
52
+ else os.environ.get("PYPI_API_KEY", "")
53
+ )
54
+ if not token:
55
+ parser.error(
56
+ "Publication needs --token-file or PYPI_API_KEY in the process environment."
57
+ )
58
+ env = os.environ.copy()
59
+ env.update(TWINE_USERNAME="__token__", TWINE_PASSWORD=token)
60
+ completed = subprocess.run(
61
+ [
62
+ sys.executable,
63
+ "-m",
64
+ "twine",
65
+ "upload",
66
+ "--non-interactive",
67
+ "--disable-progress-bar",
68
+ "--repository-url",
69
+ "https://upload.pypi.org/legacy/",
70
+ *map(str, files),
71
+ ],
72
+ env=env,
73
+ capture_output=True,
74
+ text=True,
75
+ )
76
+ print((completed.stdout + completed.stderr).replace(token, "[redacted]"))
77
+ return completed.returncode
78
+
79
+
80
+ if __name__ == "__main__":
81
+ raise SystemExit(main())
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.4
2
+ Name: multipolePDM
3
+ Version: 0.1.0
4
+ Summary: Probability density mapping for nuclear gamma-ray multipole mixing
5
+ License-Expression: MIT
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Topic :: Scientific/Engineering :: Physics
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: numpy>=1.24
12
+ Requires-Dist: scipy>=1.10
13
+ Requires-Dist: sympy>=1.12
14
+ Requires-Dist: matplotlib>=3.7
15
+ Requires-Dist: PySide6-Essentials>=6.6
16
+ Provides-Extra: analysis
17
+ Requires-Dist: jupyterlab>=4; extra == "analysis"
18
+ Requires-Dist: pandas>=2; extra == "analysis"
19
+ Requires-Dist: openpyxl>=3.1; extra == "analysis"
20
+ Requires-Dist: nbconvert>=7; extra == "analysis"
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest>=8; extra == "dev"
23
+ Requires-Dist: pytest-qt>=4; extra == "dev"
24
+ Requires-Dist: build>=1; extra == "dev"
25
+ Requires-Dist: twine>=5; extra == "dev"
26
+ Requires-Dist: setuptools>=77; extra == "dev"
27
+ Requires-Dist: wheel; extra == "dev"
28
+ Requires-Dist: ruff; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # multipolePDM
32
+
33
+ PDM maps measured polarization and angular-distribution / directional-correlation
34
+ densities into multipole mixing and alignment coordinates.
35
+
36
+ Development status: physics verification in progress. This source tree is not
37
+ yet an accepted scientific release. See the root project README for analysis.
38
+
39
+ From this directory, install with `python -m pip install .` using Python 3.10
40
+ or later. Launch the application with `pdm-gui` or `python -m multipolepdm`.
@@ -0,0 +1,70 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ docs/response-reference.md
6
+ scripts/build_release.py
7
+ scripts/release.py
8
+ src/multipolePDM.egg-info/PKG-INFO
9
+ src/multipolePDM.egg-info/SOURCES.txt
10
+ src/multipolePDM.egg-info/dependency_links.txt
11
+ src/multipolePDM.egg-info/entry_points.txt
12
+ src/multipolePDM.egg-info/requires.txt
13
+ src/multipolePDM.egg-info/top_level.txt
14
+ src/multipolepdm/__init__.py
15
+ src/multipolepdm/__main__.py
16
+ src/multipolepdm/cli.py
17
+ src/multipolepdm/contracts.py
18
+ src/multipolepdm/config/common.py
19
+ src/multipolepdm/config/p_ado.py
20
+ src/multipolepdm/config/p_dco.py
21
+ src/multipolepdm/config/pdco.py
22
+ src/multipolepdm/examples/README.md
23
+ src/multipolepdm/examples/example.json
24
+ src/multipolepdm/examples/example_PDCO.json
25
+ src/multipolepdm/examples/example_P_DCO.json
26
+ src/multipolepdm/examples/example_batch.json
27
+ src/multipolepdm/gui/results.py
28
+ src/multipolepdm/gui/self_test.py
29
+ src/multipolepdm/gui/window.py
30
+ src/multipolepdm/io/export.py
31
+ src/multipolepdm/io/input.py
32
+ src/multipolepdm/jobs/manager.py
33
+ src/multipolepdm/jobs/workers.py
34
+ src/multipolepdm/models/p_ado.py
35
+ src/multipolepdm/models/p_dco.py
36
+ src/multipolepdm/models/pdco.py
37
+ src/multipolepdm/models/registry.py
38
+ src/multipolepdm/pdm/mapping.py
39
+ src/multipolepdm/pdm/observations.py
40
+ src/multipolepdm/pdm/statistics.py
41
+ src/multipolepdm/physics/amplitudes.py
42
+ src/multipolepdm/physics/joint.py
43
+ src/multipolepdm/physics/populations.py
44
+ src/multipolepdm/physics/propagation.py
45
+ src/multipolepdm/physics/symmetries.py
46
+ src/multipolepdm/plotting/__init__.py
47
+ src/multipolepdm/plotting/export.py
48
+ src/multipolepdm/plotting/intervals.py
49
+ src/multipolepdm/plotting/overview.py
50
+ src/multipolepdm/plotting/style.py
51
+ tests/test_app_regressions.py
52
+ tests/test_azimuth_average.py
53
+ tests/test_contracts.py
54
+ tests/test_export_measures.py
55
+ tests/test_forward_metadata.py
56
+ tests/test_gui.py
57
+ tests/test_gui_averaging.py
58
+ tests/test_independent_reference.py
59
+ tests/test_io.py
60
+ tests/test_jobs.py
61
+ tests/test_mapping.py
62
+ tests/test_physics.py
63
+ tests/test_plotting.py
64
+ tests/test_reference_bridge.py
65
+ tests/test_response_domain.py
66
+ tests/test_responses.py
67
+ tests/test_statistics.py
68
+ tests/reference/__init__.py
69
+ tests/reference/angular_correlation.py
70
+ tests/reference/examples.py
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ multipolepdm = multipolepdm.cli:main
3
+ pdm-gui = multipolepdm.__main__:main
@@ -0,0 +1,20 @@
1
+ numpy>=1.24
2
+ scipy>=1.10
3
+ sympy>=1.12
4
+ matplotlib>=3.7
5
+ PySide6-Essentials>=6.6
6
+
7
+ [analysis]
8
+ jupyterlab>=4
9
+ pandas>=2
10
+ openpyxl>=3.1
11
+ nbconvert>=7
12
+
13
+ [dev]
14
+ pytest>=8
15
+ pytest-qt>=4
16
+ build>=1
17
+ twine>=5
18
+ setuptools>=77
19
+ wheel
20
+ ruff
@@ -0,0 +1 @@
1
+ multipolepdm
@@ -0,0 +1,3 @@
1
+ """Probability density mapping for nuclear multipole mixing."""
2
+
3
+ __version__ = "0.1.0"