Paper 1 · published · Discover Quantum Science (2026) · doi:10.1007/s44464-026-00032-w
A quantum circuit that diagnoses why classical AI fails at seizure detection
The A-Gate architecture running on IBM quantum hardware revealed a hidden geometric structure in neural signals — one that explains a known limitation of classical methods and was invisible until a quantum circuit made it measurable.
The challenge
Seizure detection doesn’t work the same for everyone
Epileptic seizures leave electrical signatures in brain activity. But those signatures look different from person to person — not just in intensity, but in direction. For some patients, a seizure pushes brain activity one way. For others, it pushes the opposite way.
Standard AI methods trained on many patients implicitly average these opposite signals together, canceling them out. The result is a model that performs poorly on anyone whose seizure pattern runs counter to the crowd.
This isn’t a data problem or a model size problem. It’s a geometry problem. The question is whether anyone was looking at it that way.
Cross-patient polarity on the SPD manifold
EEG covariance matrices live on the Symmetric Positive Definite (SPD) manifold. Cross-patient aggregation using Riemannian tangent space projection consistently underperforms simpler eigenvalue methods — a pattern attributed to inter-subject variability without a specific geometric mechanism.
We identify the mechanism: manifold polarity. Seizure-related covariance shifts point in opposite directions for different patients. Any method that preserves this directional information — Riemannian tangent space, quantum circuits with fixed measurement bases — suffers cross-patient degradation when opposing-polarity patients are aggregated without calibration.
Eigenvalue methods succeed by discarding directional information entirely (sorted eigenvalues are polarity-invariant). This implicit polarity invariance, not superior feature extraction, explains their consistent cross-patient performance advantage.
The finding
The quantum circuit didn’t solve the problem. It made the problem visible.
A classical classifier learns to accommodate polarity silently — it adjusts its decision boundary per patient during training. The A-Gate quantum circuit uses a fixed measurement basis. There is no accommodation. For a patient whose seizure states sit on the wrong side of that basis, the circuit outputs AUC below 0.5 — below random chance. That sub-chance result is not failure. It is a signal. It tells you exactly which side of the manifold that patient’s seizures occupy.
Polarity is a continuous strength
For a given measurement basis and channel configuration, each patient shows a stable polarity direction with varying strength (AUC 0.28–0.68). Polarity is not binary — it is a geometric signal whose magnitude depends on circuit depth, channel count, and coherence budget.
Polarity is basis-dependent
Quantum hardware, quantum simulation, and Riemannian methods each impose different reference orientations on the same manifold. Their polarity maps agree 57–71% of the time — more than chance, less than identical. Same brain, different measurement geometry.
Simulation is wrong in a useful way
Statevector simulation of the same circuit that achieves 0.637 calibrated AUC on hardware produces 0.460 raw AUC — below chance. Longer windows make it worse (0.386 at 20s). Exact amplitude computation causes opposing-polarity patients to cancel precisely. Hardware shot noise breaks the cancellation.
The inversion: hardware outperforms its own simulation
Statevector simulation of the A-Gate circuit consistently underperforms the noisy hardware execution — and the gap widens as input data quality improves.
| Mode | 1.95s window | 20s window |
|---|---|---|
| Statevector simulation | 0.460 AUC | 0.386 AUC |
| IBM Heron hardware | 0.524 raw · 0.637 calibrated | pending |
At 20-second windows, 6 of 7 patients become polarity-inverted in simulation. More data, worse result.
The mechanism: exact arithmetic causes the contributions of opposing-polarity patients to cancel precisely. The circuit becomes blind to the structure it was built to detect. Hardware shot noise breaks that cancellation stochastically — the imprecision is what preserves the signal.
This inverts the standard assumption in quantum ML, where noiseless simulation is treated as an upper bound on hardware performance. Here it is a lower bound.
The A-Gate instrument
The A-Gate encodes EEG phase synchrony (PLV theta-alpha, 4–13 Hz) as rotation angles on 17 physical qubits on IBM Heron. 97 CZ entangling gates at transpiled depth 114. The circuit’s fixed measurement basis is what makes polarity an explicit observable.
Key distinction: The A-Gate is not designed to outperform classical methods at classification. It is designed to expose geometric structure that classical methods absorb silently. The contribution is interpretability, not accuracy.
Full circuit architecture, gate diagrams, and IBM Heron topology →
Empirical results — CHB-MIT seizure detection, cross-patient LOSO
| Method | Window | AUC (raw) | AUC (calibrated) | Notes |
|---|---|---|---|---|
| Tier 2 — Eigenvalues + XGBoost | 20s | 0.873 | 0.873 | Polarity-invariant by design |
| Tier 2 — Eigenvalues + XGBoost | 1.95s | 0.723 | 0.723 | No calibration lift |
| Tier 3 — Riemannian + LDA | 30s | 0.490 | 0.724 | Matches Tier 2 after calibration |
| A-Gate — IBM Heron hardware | 1.95s | 0.524 | 0.637 | 3/7 patients inverted |
| A-Gate — Statevector simulation | 1.95s | 0.460 | 0.540 | Below chance without calibration |
| A-Gate — Statevector simulation | 20s | 0.386 | 0.630 | More inversion, better calibrated |
The calibration operation is a single sign bit per patient. Riemannian methods go from 0.490 → 0.724. Quantum hardware goes from 0.524 → 0.637. Both improve by the same mechanism. The quantum circuit exposes what was already there.
Per-patient hardware AUC
| Patient | Raw AUC | Calibrated AUC | Polarity |
|---|---|---|---|
| chb01 | 0.686 | 0.686 | Standard |
| chb03 | 0.436 | 0.564 | Inverted |
| chb05 | 0.610 | 0.610 | Standard |
| chb07 | 0.667 | 0.667 | Standard |
| chb11 | 0.283 | 0.717 | Inverted |
| chb14 | 0.600 | 0.600 | Standard |
| chb21 | 0.388 | 0.613 | Inverted |
See the polarity signal
Watch two patients — standard and inverted polarity — diverge on the same circuit in real time: launch the interactive visualization →
Publication & data
Manifold polarity in EEG classification
Cross-patient EEG seizure detection using Riemannian geometry on the SPD manifold consistently underperforms simpler eigenvalue methods. We identify the mechanism: patient-specific manifold polarity. A quantum circuit with a fixed measurement basis makes this polarity an explicit observable — patients with sub-chance AUC are simply inverted, not unclassifiable.
Published article (DOI: 10.1007/s44464-026-00032-w) · GitHub · CHB-MIT dataset
IBM Quantum
Experiments run on IBM Heron r1 (ibm_torino), 133-qubit processor. 17 physical qubits active, 97 CZ gates, circuit depth 114. 1024 shots per circuit, no error mitigation.
Dataset
CHB-MIT Scalp EEG Database, 7 of 23 patients. Leave-One-Subject-Out cross-validation throughout. Window sizes tested: 1–30 seconds.
What changed since
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.