zkit.mwigner.autocorr
zkit.mwigner.autocorr – autocorrelation / survival analysis and its rigorous quantum-information bound.
Theoretical background
Let rho_x(t) be the reduced (x-marginal) density matrix obtained by tracing the full 2D state |psi(t)><psi(t)| over the transverse coordinate(s). Its purity
P(t) = Tr[ rho_x(t)^2 ]
measures how mixed the x-degree of freedom is (P = 1 iff the x-marginal state is pure).
The autocorrelation, defined here as the Hilbert-Schmidt overlap of the reduced density matrices,
A(t) = Tr[ rho_x(0) rho_x(t) ],
is the rigorously correct “autocorrelation” for the REDUCED space (it reduces to <psi_x(0)|psi_x(t)> when the reduced state is pure). By the Cauchy-Schwarz inequality on the Hilbert-Schmidt inner product,
|A(t)|^2 <= Tr[rho_x(0)^2] * Tr[rho_x(t)^2] = P(0) * P(t).
For a PURE INITIAL reduced state (P(0) = 1, i.e. the x-marginal of |psi(0)> is itself pure) this becomes the clean bound
|A(t)|^2 <= P(t) = Tr[ rho_x(t)^2 ].
Equality holds iff the reduced state stays pure and unentangled with the traced-out mode. The gap
gap(t) = P(0)*P(t) - |A(t)|^2
is the amount of information lost to the transverse degree of freedom (entanglement / delocalisation) that is NOT captured by the simple autocorrelation – exactly the diagnostic the marginal-Wigner covariance (Sec. covariance) also probes.
IMPORTANT DISTINCTION. The conventional “survival amplitude” A_full(t) = <psi(0)|psi(t)> (the FULL 2D overlap) is a different object. It is bounded by 1 (unitary purity) but is NOT bounded by the x-marginal purity P(t): a pure separable state has |A_full|^2 = 1 while P(t) < 1, so |A_full|^2 <= P(t) is false. The rigorous Cauchy-Schwarz bound above applies specifically to the REDUCED autocorrelation A(t) = Tr[rho_x(0) rho_x(t)]. Both quantities are reported; only A_red carries the bound.
All routines work for an N-dimensional wavefunction; for a 2D state the transverse coordinate is y, for 3D it is (y, z), etc. Grid spacings are taken from dxs (one per spatial axis).
- zkit.mwigner.autocorr.reduced_density(psi_series, dxs, axis=0)
Reduced (axis-marginal) density matrices for every snapshot.
Returns (rho_series, vol_axis) where rho_series[i] = (n_a, n_a) complex matrix, rho_series[i][a, b] = (prod_{T} dT) * sum_T psi_i[a,T] psi_i*[b,T], and vol_axis is the active-axis spacing dx_a (for the trace).
- zkit.mwigner.autocorr.reduced_purity(psi_series, dxs, axis=0)
Reduced (axis-marginal) purity P(t) = Tr[rho_x(t)^2] per snapshot.
With rho_x trace-normalised (as returned by reduced_density), this is simply Tr[rho_x^2] * dx_a^2.
- zkit.mwigner.autocorr.autocorrelation(psi_series, dxs, axis=0, ref=0)
Reduced autocorrelation A(t) = Tr[ rho_x(ref) rho_x(t) ] (complex).
This is the Hilbert-Schmidt overlap of the reduced density matrices, the rigorously bounded autocorrelation (see module docstring). The conventional full survival amplitude <psi(ref)|psi(t)> is available from
survival_amplitude_full().
- zkit.mwigner.autocorr.survival_amplitude_full(psi_series, dxs, ref=0)
Conventional full survival amplitude A_full(t) = <psi(ref)|psi(t)>.
Bounded by 1 under unitary evolution; NOT bounded by the reduced purity P(t) – reported only for context (see module docstring).
- zkit.mwigner.autocorr.autocorr_analysis(psi_series, dxs, axis=0, times=None, ref=0)
Full reduced-autocorrelation / purity / bound analysis.
Returns dict with keys: times – snapshot times A – reduced autocorrelation Tr[rho(ref) rho(t)] (complex) A_full – conventional full survival amplitude (complex, context) survival – |A|^2 survival_full – |A_full|^2 (context) P – P(t) = Tr[rho(t)^2] P0 – P(ref) bound_rhs – P0 * P(t) gap – P0*P(t) - |A|^2 bound_hold – |A|^2 <= P0*P(t) (within numerical tolerance) bound_max_violation – largest (|A|^2 - P0*P(t))
- zkit.mwigner.autocorr.verify_autocorr_inequality(psi_series, dxs, axis=0, times=None, ref=0)
Return (all_hold, max_violation) for the |A|^2 <= P0*P(t) bound.
- zkit.mwigner.autocorr.schmidt_entropy(psi_series, dxs, axis=0)
Von Neumann entropy S_VN(t) = -sum_i lam_i log lam_i of the reduced (axis-marginal) density matrix, where lam_i are its normalised eigenvalues (Schmidt eigenvalues). S_VN=0 for a pure reduced state.
- zkit.mwigner.autocorr.autocorrelation_decay(psi_series, dxs, times, axis=0, ref=0)
Full survival amplitude A_full(t)=<psi(ref)|psi(t)> plus its decay.
- Returns:
A_full (complex overlap series)
survival_full (|A_full|^2 (the quantity to plot))
arg_A (unwrapped phase of A_full (radians))
Gamma_inst (instantaneous rate Gamma(t) = -d/dt ln|A_full(t)|) – = -(1/2) d/dt ln|A_full|^2
Gamma_fit (exponential decay rate fit over the *early collapse*) – segment: ln|A_full(t)| = ln|A_full(t_peak)|
Gamma_fit * (t - t_peak), i.e.
|A_full(t)| ~ exp(-Gamma_fit * t). Equivalently Gamma_fit = -(1/2) d/dt ln|A_full|^2 over the window. The window runs from the |A_full|^2 maximum to the first snapshot where |A_full|^2 drops below 1% of that maximum (or the global minimum if the signal never collapses), which isolates the physical ionisation rate and avoids the ill-defined ln(0) floor. * t_collapse (time of the 1%-collapse snapshot) * window ((t_start, t_end, i_start, i_end) used for the fit) * S_VN (von Neumann entropy of the x-marginal per snapshot) * S_VN_max (max over snapshots (delocalisation / entanglement proxy))