multipolePDM 0.1.0__py3-none-any.whl
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.
- multipolepdm/__init__.py +3 -0
- multipolepdm/__main__.py +32 -0
- multipolepdm/cli.py +127 -0
- multipolepdm/config/common.py +7 -0
- multipolepdm/config/p_ado.py +3 -0
- multipolepdm/config/p_dco.py +10 -0
- multipolepdm/config/pdco.py +13 -0
- multipolepdm/contracts.py +222 -0
- multipolepdm/examples/README.md +56 -0
- multipolepdm/examples/example.json +45 -0
- multipolepdm/examples/example_PDCO.json +55 -0
- multipolepdm/examples/example_P_DCO.json +55 -0
- multipolepdm/examples/example_batch.json +159 -0
- multipolepdm/gui/results.py +191 -0
- multipolepdm/gui/self_test.py +89 -0
- multipolepdm/gui/window.py +560 -0
- multipolepdm/io/export.py +255 -0
- multipolepdm/io/input.py +115 -0
- multipolepdm/jobs/manager.py +186 -0
- multipolepdm/jobs/workers.py +26 -0
- multipolepdm/models/p_ado.py +5 -0
- multipolepdm/models/p_dco.py +5 -0
- multipolepdm/models/pdco.py +5 -0
- multipolepdm/models/registry.py +88 -0
- multipolepdm/pdm/mapping.py +200 -0
- multipolepdm/pdm/observations.py +63 -0
- multipolepdm/pdm/statistics.py +229 -0
- multipolepdm/physics/amplitudes.py +99 -0
- multipolepdm/physics/joint.py +131 -0
- multipolepdm/physics/populations.py +52 -0
- multipolepdm/physics/propagation.py +43 -0
- multipolepdm/physics/symmetries.py +34 -0
- multipolepdm/plotting/__init__.py +16 -0
- multipolepdm/plotting/export.py +86 -0
- multipolepdm/plotting/intervals.py +199 -0
- multipolepdm/plotting/overview.py +229 -0
- multipolepdm/plotting/style.py +94 -0
- multipolepdm-0.1.0.dist-info/METADATA +40 -0
- multipolepdm-0.1.0.dist-info/RECORD +43 -0
- multipolepdm-0.1.0.dist-info/WHEEL +5 -0
- multipolepdm-0.1.0.dist-info/entry_points.txt +3 -0
- multipolepdm-0.1.0.dist-info/licenses/LICENSE +21 -0
- multipolepdm-0.1.0.dist-info/top_level.txt +1 -0
multipolepdm/__init__.py
ADDED
multipolepdm/__main__.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Launch the desktop editor; no browser or web server required."""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def main(argv=None):
|
|
5
|
+
import argparse
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
parser = argparse.ArgumentParser(description="PDM desktop application")
|
|
9
|
+
parser.add_argument(
|
|
10
|
+
"--self-test",
|
|
11
|
+
action="store_true",
|
|
12
|
+
help="Run the packaged Qt smoke test and exit",
|
|
13
|
+
)
|
|
14
|
+
parser.add_argument("--report", default="pdm-platform-report.json")
|
|
15
|
+
args = parser.parse_args(argv)
|
|
16
|
+
if args.self_test:
|
|
17
|
+
from multipolepdm.gui.self_test import run_self_test
|
|
18
|
+
|
|
19
|
+
return run_self_test(args.report)
|
|
20
|
+
|
|
21
|
+
from PySide6.QtWidgets import QApplication
|
|
22
|
+
from multipolepdm.gui.window import MainWindow
|
|
23
|
+
|
|
24
|
+
app = QApplication.instance() or QApplication(sys.argv)
|
|
25
|
+
app.setApplicationName("PDM")
|
|
26
|
+
window = MainWindow()
|
|
27
|
+
window.show()
|
|
28
|
+
return app.exec()
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
if __name__ == "__main__":
|
|
32
|
+
raise SystemExit(main())
|
multipolepdm/cli.py
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"""Batch calculation and exact pure-multipole forward calibration."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
from dataclasses import replace
|
|
5
|
+
import json
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
import numpy as np
|
|
9
|
+
|
|
10
|
+
from multipolepdm.contracts import OutputSpec
|
|
11
|
+
from multipolepdm.io.export import export_result, result_directory
|
|
12
|
+
from multipolepdm.io.input import (
|
|
13
|
+
example_data,
|
|
14
|
+
export_example,
|
|
15
|
+
job_from_dict,
|
|
16
|
+
job_to_dict,
|
|
17
|
+
load_jobs,
|
|
18
|
+
)
|
|
19
|
+
from multipolepdm.jobs.workers import compute_job
|
|
20
|
+
from multipolepdm.models.registry import evaluate_response
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def forward_calibration(job, directory):
|
|
24
|
+
"""A pure transition supplies a response curve, not a fabricated delta PDF."""
|
|
25
|
+
if len(job.target.multipoles) != 1:
|
|
26
|
+
raise ValueError("Forward calibration requires a single target multipole.")
|
|
27
|
+
if job.reference_spin == 0:
|
|
28
|
+
sigma = np.array([1.0])
|
|
29
|
+
else:
|
|
30
|
+
_, sigma = job.grid.axes(job.reference_spin)
|
|
31
|
+
r = evaluate_response(job, np.array([0.0]), sigma)
|
|
32
|
+
directory = Path(directory)
|
|
33
|
+
directory.mkdir(parents=True, exist_ok=True)
|
|
34
|
+
np.savetxt(
|
|
35
|
+
directory / "forward_calibration.csv",
|
|
36
|
+
np.column_stack(
|
|
37
|
+
(sigma, r.polarization[:, 0], r.angular_ratio[:, 0], r.valid[:, 0])
|
|
38
|
+
),
|
|
39
|
+
delimiter=",",
|
|
40
|
+
header=f"source_sigma,polarization_P,{job.ratio_name},response_defined",
|
|
41
|
+
comments="",
|
|
42
|
+
)
|
|
43
|
+
(directory / "forward_calibration.json").write_text(
|
|
44
|
+
json.dumps(
|
|
45
|
+
{
|
|
46
|
+
"input": job_to_dict(job),
|
|
47
|
+
"observations_used_for_inference": False,
|
|
48
|
+
"undefined_points": int(np.count_nonzero(~r.valid)),
|
|
49
|
+
"target_multipole": job.target.multipoles[0],
|
|
50
|
+
"reference_spin": job.reference_spin,
|
|
51
|
+
"sigma_meaning": "irrelevant for I_ref=0"
|
|
52
|
+
if job.reference_spin == 0
|
|
53
|
+
else "Gaussian width at reference state",
|
|
54
|
+
"density_status": "No delta PDF: a pure target has no mixing degree of freedom.",
|
|
55
|
+
"response_metadata": r.metadata,
|
|
56
|
+
},
|
|
57
|
+
indent=2,
|
|
58
|
+
)
|
|
59
|
+
+ "\n"
|
|
60
|
+
)
|
|
61
|
+
return r
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def main(argv=None):
|
|
65
|
+
parser = argparse.ArgumentParser(
|
|
66
|
+
description="PDM: measured polarization and angular ratios to parameter densities."
|
|
67
|
+
)
|
|
68
|
+
parser.add_argument("input", nargs="?", help="Single-job or batch JSON file")
|
|
69
|
+
parser.add_argument("--example", choices=["P_ADO", "P_DCO", "PDCO", "batch"])
|
|
70
|
+
parser.add_argument("--export-example", metavar="PATH")
|
|
71
|
+
parser.add_argument("--output-dir", type=Path)
|
|
72
|
+
parser.add_argument("--full-csv", action="store_true")
|
|
73
|
+
parser.add_argument(
|
|
74
|
+
"--forward",
|
|
75
|
+
action="store_true",
|
|
76
|
+
help="Pure-target forward calibration only (no parameter PDF)",
|
|
77
|
+
)
|
|
78
|
+
args = parser.parse_args(argv)
|
|
79
|
+
if args.export_example:
|
|
80
|
+
export_example(args.example or "P_ADO", args.export_example)
|
|
81
|
+
return 0
|
|
82
|
+
if args.input:
|
|
83
|
+
jobs = load_jobs(args.input)
|
|
84
|
+
elif args.example:
|
|
85
|
+
data = example_data(args.example)
|
|
86
|
+
jobs = (
|
|
87
|
+
tuple(job_from_dict(d) for d in data["jobs"])
|
|
88
|
+
if args.example == "batch"
|
|
89
|
+
else (job_from_dict(data),)
|
|
90
|
+
)
|
|
91
|
+
else:
|
|
92
|
+
parser.error("Provide an input JSON file or --example MODE.")
|
|
93
|
+
errors = 0
|
|
94
|
+
for job in jobs:
|
|
95
|
+
if args.output_dir is not None or args.full_csv:
|
|
96
|
+
job = replace(
|
|
97
|
+
job,
|
|
98
|
+
output=OutputSpec(
|
|
99
|
+
str(args.output_dir or job.output.directory),
|
|
100
|
+
args.full_csv or job.output.full_csv,
|
|
101
|
+
),
|
|
102
|
+
)
|
|
103
|
+
try:
|
|
104
|
+
directory = result_directory(job)
|
|
105
|
+
if args.forward:
|
|
106
|
+
forward_calibration(job, directory)
|
|
107
|
+
else:
|
|
108
|
+
result, summary = compute_job(job)
|
|
109
|
+
print(
|
|
110
|
+
f"{job.label}: calculation ready; saving to {directory}", flush=True
|
|
111
|
+
)
|
|
112
|
+
export_result(result, summary, directory)
|
|
113
|
+
from multipolepdm.plotting.overview import make_preview
|
|
114
|
+
from matplotlib import pyplot as plt
|
|
115
|
+
|
|
116
|
+
preview = make_preview(result, summary)
|
|
117
|
+
preview.figure.savefig(directory / "overview.pdf")
|
|
118
|
+
plt.close(preview.figure)
|
|
119
|
+
print(f"OK: {directory}", flush=True)
|
|
120
|
+
except Exception as exc:
|
|
121
|
+
print(f"FAILED {job.label}: {exc}", flush=True)
|
|
122
|
+
errors += 1
|
|
123
|
+
return int(errors > 0)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
if __name__ == "__main__":
|
|
127
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
MODE = "PDCO"
|
|
2
|
+
DESCRIPTION = "Direction-gated polarization + directional-correlation ratio."
|
|
3
|
+
FIELDS = (
|
|
4
|
+
"R_DCO",
|
|
5
|
+
"gate",
|
|
6
|
+
"target_first",
|
|
7
|
+
"intermediates",
|
|
8
|
+
"relative_phi_deg",
|
|
9
|
+
"theta_gate_p_deg",
|
|
10
|
+
"phi_gate_p_deg",
|
|
11
|
+
"ratio_azimuth_average",
|
|
12
|
+
"polarization_gate_azimuth_average",
|
|
13
|
+
)
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"""Immutable inputs and explicitly named scientific output containers."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from math import isfinite, pi
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
import numpy as np
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def spin(value: float) -> float:
|
|
11
|
+
value = float(value)
|
|
12
|
+
if not isfinite(value) or value < 0 or abs(2 * value - round(2 * value)) > 1e-10:
|
|
13
|
+
raise ValueError("Spin must be a nonnegative integer or half-integer.")
|
|
14
|
+
return round(2 * value) / 2
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass(frozen=True)
|
|
18
|
+
class Transition:
|
|
19
|
+
spin_initial: float
|
|
20
|
+
spin_final: float
|
|
21
|
+
multipoles: tuple[str, ...] = ("M1", "E2")
|
|
22
|
+
delta: float = 0.0
|
|
23
|
+
|
|
24
|
+
def __post_init__(self):
|
|
25
|
+
object.__setattr__(self, "spin_initial", spin(self.spin_initial))
|
|
26
|
+
object.__setattr__(self, "spin_final", spin(self.spin_final))
|
|
27
|
+
object.__setattr__(self, "multipoles", tuple(self.multipoles))
|
|
28
|
+
if self.multipoles not in (("M1",), ("E1",), ("E2",), ("M2",), ("M1", "E2")):
|
|
29
|
+
raise ValueError("Supported multipoles: M1, E1, E2, M2, or M1/E2.")
|
|
30
|
+
for component in self.multipoles:
|
|
31
|
+
rank = int(component[1:])
|
|
32
|
+
if not (
|
|
33
|
+
abs(self.spin_initial - self.spin_final)
|
|
34
|
+
<= rank
|
|
35
|
+
<= self.spin_initial + self.spin_final
|
|
36
|
+
):
|
|
37
|
+
raise ValueError(f"{component} is forbidden by the spin triangle rule.")
|
|
38
|
+
if (self.spin_initial - self.spin_final) % 1:
|
|
39
|
+
raise ValueError(
|
|
40
|
+
"A photon transition cannot change integer to half-integer spin."
|
|
41
|
+
)
|
|
42
|
+
if not isfinite(self.delta):
|
|
43
|
+
raise ValueError(
|
|
44
|
+
"Known mixing ratio must be finite; select a pure multipole for pure limits."
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@dataclass(frozen=True)
|
|
49
|
+
class Measurement:
|
|
50
|
+
value: float
|
|
51
|
+
err_minus: float
|
|
52
|
+
err_plus: float
|
|
53
|
+
|
|
54
|
+
def __post_init__(self):
|
|
55
|
+
if not all(isfinite(x) for x in (self.value, self.err_minus, self.err_plus)):
|
|
56
|
+
raise ValueError("Measurement and errors must be finite.")
|
|
57
|
+
if min(self.err_minus, self.err_plus) <= 0:
|
|
58
|
+
raise ValueError("Both errors must be positive magnitudes.")
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@dataclass(frozen=True)
|
|
62
|
+
class Geometry:
|
|
63
|
+
theta_a_deg: float = 90.0
|
|
64
|
+
theta_b_deg: float = 30.0
|
|
65
|
+
theta_p_deg: float = 90.0
|
|
66
|
+
relative_phi_deg: float = 0.0
|
|
67
|
+
phi_p_deg: float = 0.0
|
|
68
|
+
theta_gate_p_deg: float = 90.0
|
|
69
|
+
phi_gate_p_deg: float = 0.0
|
|
70
|
+
ratio_azimuth_average: bool = False
|
|
71
|
+
polarization_gate_azimuth_average: bool = False
|
|
72
|
+
|
|
73
|
+
def __post_init__(self):
|
|
74
|
+
for key, value in vars(self).items():
|
|
75
|
+
if key.endswith("_azimuth_average"):
|
|
76
|
+
if not isinstance(value, bool):
|
|
77
|
+
raise ValueError(f"{key} must be a boolean.")
|
|
78
|
+
continue
|
|
79
|
+
if not isfinite(value) or (
|
|
80
|
+
key.startswith("theta") and not 0 <= value <= 180
|
|
81
|
+
):
|
|
82
|
+
raise ValueError(f"Invalid detector angle: {key} (degrees).")
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@dataclass(frozen=True)
|
|
86
|
+
class GridSpec:
|
|
87
|
+
xi_min_rad: float = -1.56
|
|
88
|
+
xi_max_rad: float = 1.56
|
|
89
|
+
xi_points: int = 3121
|
|
90
|
+
sigma_min: float | None = None
|
|
91
|
+
sigma_max: float | None = None
|
|
92
|
+
sigma_points: int = 201
|
|
93
|
+
|
|
94
|
+
def axes(self, reference_spin: float) -> tuple[np.ndarray, np.ndarray]:
|
|
95
|
+
if reference_spin <= 0:
|
|
96
|
+
raise ValueError(
|
|
97
|
+
"I_ref=0 is a forward-response case, not a two-parameter sigma scan."
|
|
98
|
+
)
|
|
99
|
+
lo = (
|
|
100
|
+
self.sigma_min
|
|
101
|
+
if self.sigma_min is not None
|
|
102
|
+
else (0.15 if reference_spin % 1 == 0 else 0.20)
|
|
103
|
+
)
|
|
104
|
+
hi = self.sigma_max if self.sigma_max is not None else reference_spin
|
|
105
|
+
if not (isfinite(lo) and isfinite(hi) and 0 < lo < hi):
|
|
106
|
+
raise ValueError("Require 0 < sigma_min < sigma_max.")
|
|
107
|
+
if not (-pi / 2 < self.xi_min_rad < self.xi_max_rad < pi / 2):
|
|
108
|
+
raise ValueError("xi grid must lie strictly inside (-pi/2, pi/2) radians.")
|
|
109
|
+
for n in (self.xi_points, self.sigma_points):
|
|
110
|
+
if isinstance(n, bool) or not isinstance(n, int) or n < 3:
|
|
111
|
+
raise ValueError("Each grid axis requires at least three points.")
|
|
112
|
+
if self.xi_points * self.sigma_points > 20_000_000:
|
|
113
|
+
raise ValueError(
|
|
114
|
+
"Grid exceeds 20 million points; reduce resolution or split the study."
|
|
115
|
+
)
|
|
116
|
+
return np.linspace(
|
|
117
|
+
self.xi_min_rad, self.xi_max_rad, self.xi_points
|
|
118
|
+
), np.linspace(lo, hi, self.sigma_points)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@dataclass(frozen=True)
|
|
122
|
+
class OutputSpec:
|
|
123
|
+
directory: str = "pdm-results"
|
|
124
|
+
full_csv: bool = False
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
@dataclass(frozen=True)
|
|
128
|
+
class JobRequest:
|
|
129
|
+
mode: str
|
|
130
|
+
target: Transition
|
|
131
|
+
polarization: Measurement
|
|
132
|
+
angular_ratio: Measurement
|
|
133
|
+
label: str = "Transition"
|
|
134
|
+
gate: Transition | None = None
|
|
135
|
+
target_first: bool = True
|
|
136
|
+
intermediates: tuple[Transition, ...] = ()
|
|
137
|
+
geometry: Geometry = field(default_factory=Geometry)
|
|
138
|
+
grid: GridSpec = field(default_factory=GridSpec)
|
|
139
|
+
output: OutputSpec = field(default_factory=OutputSpec)
|
|
140
|
+
|
|
141
|
+
def __post_init__(self):
|
|
142
|
+
if self.mode not in ("P_ADO", "P_DCO", "PDCO"):
|
|
143
|
+
raise ValueError("Unknown mode; choose P_ADO, P_DCO, or PDCO.")
|
|
144
|
+
object.__setattr__(self, "intermediates", tuple(self.intermediates))
|
|
145
|
+
if not isinstance(self.target_first, bool):
|
|
146
|
+
raise ValueError("target_first must be a boolean.")
|
|
147
|
+
if self.mode == "P_ADO":
|
|
148
|
+
if self.gate is not None or self.intermediates:
|
|
149
|
+
raise ValueError(
|
|
150
|
+
"P_ADO has no directional gate or intermediate path inputs."
|
|
151
|
+
)
|
|
152
|
+
else:
|
|
153
|
+
if self.gate is None:
|
|
154
|
+
raise ValueError("DCO modes require a gate transition.")
|
|
155
|
+
first, last = (
|
|
156
|
+
(self.target, self.gate)
|
|
157
|
+
if self.target_first
|
|
158
|
+
else (self.gate, self.target)
|
|
159
|
+
)
|
|
160
|
+
path = (first, *self.intermediates, last)
|
|
161
|
+
if any(a.spin_final != b.spin_initial for a, b in zip(path, path[1:])):
|
|
162
|
+
raise ValueError(
|
|
163
|
+
"Path endpoint spins do not match; supply intermediate transitions."
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def reference_spin(self) -> float:
|
|
168
|
+
return (
|
|
169
|
+
self.target.spin_initial
|
|
170
|
+
if self.mode == "P_ADO" or self.target_first
|
|
171
|
+
else self.gate.spin_initial
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
@property
|
|
175
|
+
def ratio_name(self) -> str:
|
|
176
|
+
return "R_ADO" if self.mode == "P_ADO" else "R_DCO"
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
@dataclass(frozen=True)
|
|
180
|
+
class ResponseGrid:
|
|
181
|
+
xi_rad: np.ndarray
|
|
182
|
+
sigma: np.ndarray
|
|
183
|
+
polarization: np.ndarray
|
|
184
|
+
angular_ratio: np.ndarray
|
|
185
|
+
valid: np.ndarray
|
|
186
|
+
reference_spin: float
|
|
187
|
+
ratio_name: str
|
|
188
|
+
metadata: dict[str, Any] = field(default_factory=dict)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
@dataclass(frozen=True)
|
|
192
|
+
class MappingResult:
|
|
193
|
+
job: JobRequest
|
|
194
|
+
response: ResponseGrid
|
|
195
|
+
observation_density: np.ndarray
|
|
196
|
+
jacobian: np.ndarray
|
|
197
|
+
parameter_density: np.ndarray
|
|
198
|
+
normalization: float
|
|
199
|
+
warnings: tuple[str, ...] = ()
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
@dataclass(frozen=True)
|
|
203
|
+
class Interval:
|
|
204
|
+
mass: float
|
|
205
|
+
eti: tuple[float, float]
|
|
206
|
+
hdi: tuple[tuple[float, float], ...]
|
|
207
|
+
hdi_threshold: float
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
@dataclass(frozen=True)
|
|
211
|
+
class MarginalSummary:
|
|
212
|
+
coordinate: np.ndarray
|
|
213
|
+
density: np.ndarray
|
|
214
|
+
median: float
|
|
215
|
+
mode: float
|
|
216
|
+
intervals: tuple[Interval, ...]
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
@dataclass(frozen=True)
|
|
220
|
+
class Summary:
|
|
221
|
+
delta: MarginalSummary
|
|
222
|
+
sigma_over_i: MarginalSummary
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Input examples
|
|
2
|
+
|
|
3
|
+
These are synthetic examples, not literature measurements. Open **Load example**
|
|
4
|
+
in the GUI, edit the fields, and choose **Save input JSON**. A single-job file is
|
|
5
|
+
one JSON object. A batch has a `jobs` array containing complete job objects.
|
|
6
|
+
The examples share a 5 -> 4 mixed target and, for DCO, a 4 -> 2 pure E2 gate.
|
|
7
|
+
The Gaussian reference width is sigma = 1.2. The injected xi values are 0.6 rad
|
|
8
|
+
for P_ADO and P_DCO, and -1.2 rad for PDCO (KS/Droste convention).
|
|
9
|
+
|
|
10
|
+
| Field | Meaning |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| mode | P_ADO, P_DCO or PDCO |
|
|
13
|
+
| label | Free text identifying the transition |
|
|
14
|
+
| target | Initial/final spins and multipoles; target delta is inferred, not supplied |
|
|
15
|
+
| observations.P | Final electric-field polarization, not raw scatter asymmetry |
|
|
16
|
+
| observations.R_ADO / R_DCO | Final angular-distribution / directional-correlation ratio |
|
|
17
|
+
| value | Central measured value, treated as the median by the uncertainty model |
|
|
18
|
+
| err_minus, err_plus | Positive magnitudes defining the Phi(-1)/Phi(+1) quantiles |
|
|
19
|
+
| gate | Known spins, multipoles and delta (delta only matters for mixed gates) |
|
|
20
|
+
| target_first | True if target precedes gate; false if gate precedes target |
|
|
21
|
+
| intermediates | Ordered unobserved transitions between target and gate; [] if adjacent |
|
|
22
|
+
| theta_a_deg | Target direction in ratio numerator, gate direction in denominator |
|
|
23
|
+
| theta_b_deg | Target direction in ratio denominator, gate direction in numerator |
|
|
24
|
+
| relative_phi_deg | Relative target/gate azimuth in DCO |
|
|
25
|
+
| ratio_azimuth_average | Optional true for an ideal full-ring DCO intensity average; false keeps the specified point pair |
|
|
26
|
+
| theta_p_deg, phi_p_deg | Target direction for polarization |
|
|
27
|
+
| theta_gate_p_deg, phi_gate_p_deg | Polarization gate direction; used only in PDCO |
|
|
28
|
+
| polarization_gate_azimuth_average | Optional true to average the PDCO gate azimuth at its fixed polar angle; this is still a directional gate |
|
|
29
|
+
| xi_min_rad, xi_max_rad | Bounds strictly inside (-pi/2, pi/2), in radians |
|
|
30
|
+
| xi_points, sigma_points | At least three grid nodes in each direction |
|
|
31
|
+
| sigma_min, sigma_max | Gaussian width at I_ref; null selects .15/.20 and I_ref |
|
|
32
|
+
| output.directory | Parent output directory; each job creates its own subfolder |
|
|
33
|
+
| output.full_csv | Optional full grid text export; compact NumPy output is always written |
|
|
34
|
+
|
|
35
|
+
P_DCO uses a single-line P with no gate-direction condition. PDCO retains the
|
|
36
|
+
specified polarization gate direction. In both cases there is one Gaussian
|
|
37
|
+
reference state before the first observed photon. Later states are propagated,
|
|
38
|
+
not reset to a Gaussian. Intermediate transitions are modeled as unobserved
|
|
39
|
+
gamma radiation. Counts, efficiencies and experimental data reduction are not
|
|
40
|
+
inputs to this application.
|
|
41
|
+
|
|
42
|
+
No covariance is provided: the two observation errors are modeled as independent.
|
|
43
|
+
This is a statistical approximation, not a consequence of the gate definition.
|
|
44
|
+
Do not use a quoted literature delta as an observation input.
|
|
45
|
+
|
|
46
|
+
Spins are numbers in units of hbar: enter 5.5 for 11/2. Azimuth averages are
|
|
47
|
+
performed on joint intensities before forming P or R, never on the ratios.
|
|
48
|
+
The nine-node angular quadrature is exact for the supported dipole/quadrupole
|
|
49
|
+
harmonics, apart from roundoff. It models a declared ideal angular average,
|
|
50
|
+
not detector efficiency corrections and not a fit of an unknown azimuth.
|
|
51
|
+
An azimuth average at a selected gate polar angle is not a full 4-pi marginal.
|
|
52
|
+
|
|
53
|
+
For a pure target (for example 4 -> 2, `multipoles: ["E2"]`), use CLI
|
|
54
|
+
`multipolepdm input.json --forward`. This exports exact forward response versus
|
|
55
|
+
sigma, not an artificial two-dimensional mixing-ratio density. I_ref=0 is also
|
|
56
|
+
only a forward calibration case.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mode": "P_ADO",
|
|
3
|
+
"label": "Synthetic P_ADO",
|
|
4
|
+
"target": {
|
|
5
|
+
"spin_initial": 5.0,
|
|
6
|
+
"spin_final": 4.0,
|
|
7
|
+
"multipoles": [
|
|
8
|
+
"M1",
|
|
9
|
+
"E2"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"observations": {
|
|
13
|
+
"P": {
|
|
14
|
+
"value": -0.8765882708591118,
|
|
15
|
+
"err_minus": 0.04,
|
|
16
|
+
"err_plus": 0.04
|
|
17
|
+
},
|
|
18
|
+
"R_ADO": {
|
|
19
|
+
"value": 0.514138873717746,
|
|
20
|
+
"err_minus": 0.04,
|
|
21
|
+
"err_plus": 0.04
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"geometry": {
|
|
25
|
+
"theta_a_deg": 90.0,
|
|
26
|
+
"theta_b_deg": 30.0,
|
|
27
|
+
"theta_p_deg": 90.0,
|
|
28
|
+
"relative_phi_deg": 0.0,
|
|
29
|
+
"phi_p_deg": 0.0,
|
|
30
|
+
"theta_gate_p_deg": 90.0,
|
|
31
|
+
"phi_gate_p_deg": 0.0
|
|
32
|
+
},
|
|
33
|
+
"grid": {
|
|
34
|
+
"xi_min_rad": -1.56,
|
|
35
|
+
"xi_max_rad": 1.56,
|
|
36
|
+
"xi_points": 3121,
|
|
37
|
+
"sigma_min": null,
|
|
38
|
+
"sigma_max": null,
|
|
39
|
+
"sigma_points": 201
|
|
40
|
+
},
|
|
41
|
+
"output": {
|
|
42
|
+
"directory": "pdm-results",
|
|
43
|
+
"full_csv": false
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mode": "PDCO",
|
|
3
|
+
"label": "Synthetic PDCO",
|
|
4
|
+
"target": {
|
|
5
|
+
"spin_initial": 5.0,
|
|
6
|
+
"spin_final": 4.0,
|
|
7
|
+
"multipoles": [
|
|
8
|
+
"M1",
|
|
9
|
+
"E2"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"observations": {
|
|
13
|
+
"P": {
|
|
14
|
+
"value": 0.523967979251427,
|
|
15
|
+
"err_minus": 0.04,
|
|
16
|
+
"err_plus": 0.04
|
|
17
|
+
},
|
|
18
|
+
"R_DCO": {
|
|
19
|
+
"value": 3.4895433362026465,
|
|
20
|
+
"err_minus": 0.1,
|
|
21
|
+
"err_plus": 0.1
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"geometry": {
|
|
25
|
+
"theta_a_deg": 90.0,
|
|
26
|
+
"theta_b_deg": 30.0,
|
|
27
|
+
"theta_p_deg": 90.0,
|
|
28
|
+
"relative_phi_deg": 0.0,
|
|
29
|
+
"phi_p_deg": 0.0,
|
|
30
|
+
"theta_gate_p_deg": 90.0,
|
|
31
|
+
"phi_gate_p_deg": 0.0
|
|
32
|
+
},
|
|
33
|
+
"grid": {
|
|
34
|
+
"xi_min_rad": -1.56,
|
|
35
|
+
"xi_max_rad": 1.56,
|
|
36
|
+
"xi_points": 3121,
|
|
37
|
+
"sigma_min": null,
|
|
38
|
+
"sigma_max": null,
|
|
39
|
+
"sigma_points": 201
|
|
40
|
+
},
|
|
41
|
+
"output": {
|
|
42
|
+
"directory": "pdm-results",
|
|
43
|
+
"full_csv": false
|
|
44
|
+
},
|
|
45
|
+
"gate": {
|
|
46
|
+
"spin_initial": 4.0,
|
|
47
|
+
"spin_final": 2.0,
|
|
48
|
+
"multipoles": [
|
|
49
|
+
"E2"
|
|
50
|
+
],
|
|
51
|
+
"delta": 0.0
|
|
52
|
+
},
|
|
53
|
+
"target_first": true,
|
|
54
|
+
"intermediates": []
|
|
55
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mode": "P_DCO",
|
|
3
|
+
"label": "Synthetic P_DCO",
|
|
4
|
+
"target": {
|
|
5
|
+
"spin_initial": 5.0,
|
|
6
|
+
"spin_final": 4.0,
|
|
7
|
+
"multipoles": [
|
|
8
|
+
"M1",
|
|
9
|
+
"E2"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"observations": {
|
|
13
|
+
"P": {
|
|
14
|
+
"value": -0.8765882708591118,
|
|
15
|
+
"err_minus": 0.04,
|
|
16
|
+
"err_plus": 0.04
|
|
17
|
+
},
|
|
18
|
+
"R_DCO": {
|
|
19
|
+
"value": 0.7412356817486342,
|
|
20
|
+
"err_minus": 0.04,
|
|
21
|
+
"err_plus": 0.04
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"geometry": {
|
|
25
|
+
"theta_a_deg": 90.0,
|
|
26
|
+
"theta_b_deg": 30.0,
|
|
27
|
+
"theta_p_deg": 90.0,
|
|
28
|
+
"relative_phi_deg": 0.0,
|
|
29
|
+
"phi_p_deg": 0.0,
|
|
30
|
+
"theta_gate_p_deg": 90.0,
|
|
31
|
+
"phi_gate_p_deg": 0.0
|
|
32
|
+
},
|
|
33
|
+
"grid": {
|
|
34
|
+
"xi_min_rad": -1.56,
|
|
35
|
+
"xi_max_rad": 1.56,
|
|
36
|
+
"xi_points": 3121,
|
|
37
|
+
"sigma_min": null,
|
|
38
|
+
"sigma_max": null,
|
|
39
|
+
"sigma_points": 201
|
|
40
|
+
},
|
|
41
|
+
"output": {
|
|
42
|
+
"directory": "pdm-results",
|
|
43
|
+
"full_csv": false
|
|
44
|
+
},
|
|
45
|
+
"gate": {
|
|
46
|
+
"spin_initial": 4.0,
|
|
47
|
+
"spin_final": 2.0,
|
|
48
|
+
"multipoles": [
|
|
49
|
+
"E2"
|
|
50
|
+
],
|
|
51
|
+
"delta": 0.0
|
|
52
|
+
},
|
|
53
|
+
"target_first": true,
|
|
54
|
+
"intermediates": []
|
|
55
|
+
}
|