Overview
The phase coherence test suite validates that quantum gate identities are preserved through amplitude evolution rather than symbolic substitution. These tests verify that the neural backends correctly handle phase relationships that are central to quantum interference. From README.md:197:A phase coherence test suite verified algebraic identities: HZH = X, HXH = Z, XX = I, and others, executed as amplitude evolution rather than symbolic substitution.
Test Methodology
Execution Model
From README.md:263:Phase coherence test suite: 22/22 passed.Each test executes a sequence of quantum gates and measures the resulting state. The tests verify that:
- Probability amplitudes evolve correctly
- Phase relationships are preserved
- Interference patterns emerge as expected
- Unitary constraints hold throughout
Test Groups
Group 1: Single-Qubit Phase Algebra
These tests verify fundamental single-qubit identities:HZH = X: Hadamard-Z-Hadamard Equivalence
HZH = X: Hadamard-Z-Hadamard Equivalence
HXH = Z: Hadamard-X-Hadamard Equivalence
HXH = Z: Hadamard-X-Hadamard Equivalence
HSSH = X: S-Gate Composition
HSSH = X: S-Gate Composition
H Rz(π) H = X: Rotation Equivalence
H Rz(π) H = X: Rotation Equivalence
Ry(π)|0⟩ = |1⟩: Y-Axis Rotation
Ry(π)|0⟩ = |1⟩: Y-Axis Rotation
XX = I: X Gate Self-Inverse
XX = I: X Gate Self-Inverse
HZZH = I: Phase Cancellation
HZZH = I: Phase Cancellation
Rx(π)|0⟩ = |1⟩: X-Axis Rotation
Rx(π)|0⟩ = |1⟩: X-Axis Rotation
Group 2: Two-Qubit Phase-Sensitive Interference
These tests involve entanglement and controlled operations:H CNOT CNOT H = I: CNOT Self-Inverse
H CNOT CNOT H = I: CNOT Self-Inverse
H CNOT CZ CZ CNOT H = I: Controlled-Z Cancellation
H CNOT CZ CZ CNOT H = I: Controlled-Z Cancellation
H CNOT Z(ctrl) CNOT H = X(0): Phase Transfer
H CNOT Z(ctrl) CNOT H = X(0): Phase Transfer
X(1) SWAP SWAP = I: SWAP Reversibility
X(1) SWAP SWAP = I: SWAP Reversibility
SWAP |01⟩ = |10⟩: Qubit Exchange
SWAP |01⟩ = |10⟩: Qubit Exchange
Group 3: Norm Preservation (Unitarity)
These tests verify that probability normalization holds:| Circuit | Sum of Probabilities | Tolerance | Result |
|---|---|---|---|
| After H | 1.00000000 | 1e-10 | PASS |
| After X | 1.00000000 | 1e-10 | PASS |
| After HXH | 1.00000000 | 1e-10 | PASS |
| After Bell | 1.00000000 | 1e-10 | PASS |
| After GHZ | 1.00000000 | 1e-10 | PASS |
| After QFT-3 | 1.00000000 | 1e-10 | PASS |
Born probabilities are computed by integrating the squared modulus over the spatial grid: P(k) = Sum_ (alpha_^2 + alpha_^2) normalized so that Sum_k P(k) = 1.
Group 4: Entanglement (Shannon Entropy)
These tests verify correct entropy for known states:Bell State Entropy
Bell State Entropy
GHZ-3 Entropy
GHZ-3 Entropy
QFT-3 Entropy
QFT-3 Entropy
Ground State Entropy
Ground State Entropy
Complete Test Log
Full Test Output (RESULTS.md:334-374)
Full Test Output (RESULTS.md:334-374)
State Representation
From README.md:173-182:The simulator represents an n-qubit state as a tensor of shape (2^n, 2, G, G), where G = 16 is the spatial grid size. The first index labels computational basis states. The second index holds real and imaginary components. The last two indices represent a spatial wavefunction. Born probabilities are computed by integrating the squared modulus over the spatial grid: P(k) = Sum_ (alpha_^2 + alpha_^2) normalized so that Sum_k P(k) = 1.
Backend Agreement
From README.md:184-192:Three neural backends were used:All 22 tests passed identically on all three backends.Each backend was loaded from its own checkpoint file. No weights were shared. No caches were synchronized. All three ran on CPU with identical random seeds.
- Hamiltonian: A spectral convolution network that applies a learned Hamiltonian operator
- Schrödinger: A 2-channel network trained to propagate wavefunctions
- Dirac: An 8-channel network operating on 4-component spinors
Significance
From README.md:371:The perfect symmetry |E(+F) - E(-F)| at machine precision tells me that the backends are not introducing spurious field-dependent artifacts. They are not breaking parity. They are not leaking information between positive and negative field directions.These phase coherence tests establish that the neural backends preserve quantum interference patterns exactly. This is not approximate behavior—the tests verify exact algebraic identities through amplitude evolution.
Related Documentation
- Constraint Preservation - Full test suite overview
- Results Summary - All experimental results