Archived April 2026 site. Kept as the record; see the current site at qdnu.ai.

The Pipeline

EEG Window
1.95s or 20s
→
Covariance
8×8 matrix
→
PLV Features
28 values
→
Encoding
RY rotations
→
Entangling
CZ/ECR gates
→
Measurement
0 or 1

Each PLV value becomes a rotation angle. The rotation angle becomes a quantum state. The collection of quantum states — one per channel pair — becomes entangled. The entangled state is measured. That measurement is the prediction.

Feature Encoding

Phase Locking Values (PLV) from EEG channel pairs are encoded as rotation angles on individual qubits:

|0⟩ |1⟩ → measures 0 → measures 1 Patient A Patient B PLV value +0.70 θ = π × PLV = 0.70π rad Patient A PLV = +0.70 θ = +0.70π → 0 Patient B PLV = -0.70 θ = -0.70π → 1 Same signal magnitude. Opposite rotation. Opposite measurement.
-1.0 0 +1.0

Full A-Gate Circuit

Each channel pair produces one A-Gate — a 2-qubit circuit with excitatory and inhibitory paths coupled by entangling gates. The full gate sequence:

PREPARATION ENCODING PREPARATION COUPLING MEASURE |E⟩ q0 H P(b) Rx(2a) P(b) H |I⟩ q1 H P(b) Ry(2c) P(b) H CRy(π/4) E→I CRz(π/4) I→E Parameters a = amplitude envelope (EEG power) c = PLV synchrony (phase locking) b = π (fixed phase) — retired 2026-09: uniform across windows on two datasets; carries no information. CRy/CRz couple E-I before measurement
The polarity signal emerges from the E-I coupling — neither qubit alone determines the outcome. The excitatory path encodes amplitude, the inhibitory path encodes synchrony, and the entangling gates mix them into a joint state that is sensitive to the sign of the input.

Why Polarity Matters

A classical classifier has learned parameters — weights that adjust during training to accommodate whatever pattern exists in the data. If Patient A's seizures increase PLV values and Patient B's decrease them, the classifier silently learns asymmetric boundaries. It never reports the asymmetry. It just works around it.

Classical Classifier A-Gate Circuit Learned boundary ictal (A + B mixed) interictal (A + B mixed) Polarity absorbed silently eigenvalues are rotation-invariant — A and B ictal look identical Fixed measurement axis B ictal (inverted) A ictal (standard) AUC < 0.5 = polarity signal rotation angles preserved — A and B ictal land on opposite sides The classifier's flexibility is its blindness. The circuit's rigidity is its instrument. A ictal A interictal B ictal B interictal

The classifier separates ictal from interictal with high confidence — the clusters are well-separated and the boundary is clean. But both patients' ictal windows land in the same cluster. The polarity dimension was discarded at feature extraction, before the boundary was ever drawn. The classifier cannot recover what it was never given.

The A-Gate has no learned parameters. The rotation angle for a PLV of 0.7 is always RY(0.7π). The rotation angle for a PLV of -0.7 is always RY(-0.7π). There is no accommodation mechanism. When Patient B's polarity is inverted, the circuit produces the wrong answer — and that wrong answer is the signal. Sub-chance AUC is not failure. It is a signed geometric readout.

Classical methods compute eigenvalues of covariance matrices, which are invariant under polarity flips. But quantum circuits see the full rotation angles:

Patient A (Standard Polarity)

PLV value: 0.7
Rotation: RY(0.7π)
State: cos(0.35π)|0⟩ + sin(0.35π)|1⟩
Measurement outcome: 0

Patient B (Inverted Polarity)

PLV value: -0.7 (flipped)
Rotation: RY(-0.7π)
State: cos(-0.35π)|0⟩ + sin(-0.35π)|1⟩
Measurement outcome: 1

This simplified view shows the rotation for a single qubit. In the full circuit, a encodes amplitude on the excitatory qubit and c encodes PLV synchrony on the inhibitory qubit. The coupling layer mixes these two encoded states before measurement — the outcome depends on their joint configuration.

Same EEG pattern, opposite polarity → opposite quantum measurement → opposite prediction! This reveals hidden structure invisible to eigenvalue-based methods.

IBM Heron r1 Topology

We use 17 qubits (q8–q12, q17–q18, q27–q31, q36, q46–q49) arranged in a heavy-hex subgraph of ibm_torino:

17-Qubit Heavy-Hex Subgraph — ibm_torino (Heron r1) q8 q9 q10 q11 q12 q17 q18 q27 q28 q29 q30 q31 q36 q46 q47 q48 q49 Excitatory Inhibitory

The heavy-hex lattice limits which qubits can directly entangle. Circuit transpilation maps the logical A-Gate connections onto physically adjacent qubits, introducing SWAP operations where direct connections don't exist. The transpiled circuit uses 97 CZ gates at depth 114 — confirmed by hardware execution to follow linear scaling: CZ gates = 14.1M − 17.5 (R² > 0.99).

What was learned about the instrument (2026-09)

Every gate after the encoding layer is a fixed unitary. That means anything the circuit measures is a fixed linear transformation of the three classical numbers encoded per channel — amplitude, absolute phase, and phase-locking value — and the same observable can be computed without the circuit. The A-Gate is a feature map with a fixed measurement basis, not a computation.

One of the three numbers carries no information. The absolute phase parameter b is uniformly distributed across windows in both CHB-MIT (resultant 0.044, PROMPT 038) and PhysioNet eyes-open/closed (resultant 0.010 over 13,080 windows, PROMPT 041). It is a gauge: the E/I unit’s balanced oscillation is a complex amplitude, and its absolute phase is unobservable in a covariance. The parameter is retired from any future encoding.

What the fixed basis did do was expose a sign. A flexible classifier absorbs a patient-specific flip in the direction of the ictal covariance shift; a fixed basis cannot, so those patients come out below chance. That is the polarity finding, and it is why the work moved from the circuit to the state it was implicitly measuring. The circuit is kept here as the history of how the state formulation was reached.

Full derivation: docs/AGATE_OBSERVABLE_NOTES.md in the repository.

What the Circuit Is

The A-Gate is not designed to outperform classical seizure detection. It is designed to make geometry visible. A trained classifier absorbs polarity silently — it adjusts its boundary and moves on. The A-Gate cannot do that. Its architectural rigidity is the instrument.

This is the same principle as any physical measurement device: a fixed orientation exposes what a rotating detector would average away. The quantum circuit's fixed measurement basis is its orientation. Manifold polarity is what it measures.

Watch the A-Gate circuit execute in real-time →

See both patients' trajectories through quantum state space

← Framework Home ↑ Invariants →