Coherence Theory#
This document explains the mathematical foundations of PhaseLab’s coherence calculations.
Circular Statistics#
Phase data requires circular statistics because phases are periodic (0 = 2π).
Circular Mean
The circular mean handles wrap-around correctly:
Standard (linear) mean fails for phases near 0/2π boundary.
Circular Variance
Circular variance measures phase spread:
where R is the mean resultant length:
Properties
V_φ = 0: All phases identical (perfect alignment)
V_φ = 1: Phases uniformly distributed (complete disorder)
Phase Extraction#
Different data sources require different phase extraction methods.
From Quantum Expectations
Pauli expectation values E ∈ [-1, 1] map to phases:
This maps:
E = 1 → θ = 0
E = 0 → θ = π/2
E = -1 → θ = π
From Hamiltonian Coefficients
Hamiltonian terms have coefficients that encode structure:
For real coefficients:
Coherence Computation#
From Phase Variance
The coherence R-bar is:
From Expectation Values (Direct)
For N expectation values:
Simplifies to:
Heuristic Mode
For fast screening, PhaseLab uses coefficient variance as a proxy:
This correlates with but is not identical to true phase variance.
ATLAS-Q Acceleration#
ATLAS-Q provides accelerated coherence computation through:
IR Measurement Grouping: Groups commuting Pauli terms to reduce measurements by 5x
Batch Processing: Vectorized computation over multiple circuits
GPU Kernels: Custom Triton kernels for phase statistics
The acceleration applies to quantum mode, not heuristic mode.
Variance Reduction#
IR measurement grouping reduces variance:
Without Grouping
Each Pauli term measured independently:
With Grouping
Commuting terms measured together:
Since |groups| < |terms|, variance decreases.
Typical improvement: 5x variance reduction for molecular Hamiltonians.
Statistical Considerations#
Sample Size
More measurements improve coherence estimates:
Minimum recommended: N > 100 measurements
Confidence Intervals
For large N, R-bar is approximately normal:
Bias Correction
Small samples overestimate R. Correction factor:
Implementation Details#
PhaseLab implements coherence in phaselab/quantum/coherence.py:
def compute_coherence_from_expectations(expectations, use_atlas_q=True):
# Convert to phases
phases = np.arccos(np.clip(expectations, -1, 1))
# Circular statistics
cos_sum = np.sum(np.cos(phases))
sin_sum = np.sum(np.sin(phases))
# Mean resultant length
R = np.sqrt(cos_sum**2 + sin_sum**2) / len(phases)
# Phase variance
V_phi = 1 - R
# Coherence
R_bar = np.exp(-V_phi / 2)
return CoherenceResult(R_bar=R_bar, V_phi=V_phi, ...)
See Also#
Informational Relativity - Theoretical foundation
The GO/NO-GO Threshold - Threshold derivation