Skip to content

Commit 7718036

Browse files
committed
add probability_tensor
1 parent 408dd26 commit 7718036

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

physics/multipolar_wave.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ def __init__(
5050
self.amplitudes = arr
5151
self.metadata = metadata
5252

53+
# ------------------------------------------------------------------
54+
def probability_tensor(self) -> np.ndarray:
55+
"""Return the full density matrix ρ = |ψ⟩⟨ψ|.
56+
57+
The tensor keeps interference information between all poles and
58+
complements :meth:`probability_density`, which returns only the
59+
scalar Σ|ψ|² scaled by k/2.
60+
"""
61+
62+
return np.outer(self.amplitudes, np.conj(self.amplitudes))
63+
5364
# ------------------------------------------------------------------
5465
def copy(self) -> "MultiConjugateFunction":
5566
"""Return a duplicate wave, keeping metadata and n-conjugate count."""

0 commit comments

Comments
 (0)