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.

17 qubits · IBM Heron · CHB-MIT dataset · 7 patients · LOSO validation

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.

Mode1.95s window20s window
Statevector simulation0.460 AUC0.386 AUC
IBM Heron hardware0.524 raw · 0.637 calibratedpending

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

Leave-One-Subject-Out · IBM Heron r1 (ibm_torino) · 1024 shots · Tier 2/3 classical results from 22-patient LOSO cohort; A-Gate quantum results from 7-patient subset.

MethodWindowAUC (raw)AUC (calibrated)Notes
Tier 2 — Eigenvalues + XGBoost20s0.8730.873Polarity-invariant by design
Tier 2 — Eigenvalues + XGBoost1.95s0.7230.723No calibration lift
Tier 3 — Riemannian + LDA30s0.4900.724Matches Tier 2 after calibration
A-Gate — IBM Heron hardware1.95s0.5240.6373/7 patients inverted
A-Gate — Statevector simulation1.95s0.4600.540Below chance without calibration
A-Gate — Statevector simulation20s0.3860.630More 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

PatientRaw AUCCalibrated AUCPolarity
chb010.6860.686Standard
chb030.4360.564Inverted
chb050.6100.610Standard
chb070.6670.667Standard
chb110.2830.717Inverted
chb140.6000.600Standard
chb210.3880.613Inverted

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

The following is the “What was learned about the instrument (2026-09)” note, verbatim.

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.