One Qubit from Two Electrodes
Four seconds of EEG from two occipital electrodes, turned into a mixed quantum state, loaded onto a qubit by purification, and read back. Every number on this page is the real one.
The claim being tested
A trace-normalised covariance matrix is a density matrix. Not by analogy: it is symmetric, positive semidefinite and has trace one, which is the whole definition. So a window of multichannel EEG defines a quantum state, and the question DSP-000 asks is whether that state can be prepared on a register and measured there with the answer a classical computation already knows.
This is the smallest possible instance: two channels, a 2×2 matrix, one qubit. Small enough that every intermediate value fits on the page, and small enough that if any step were wrong it would be obvious.
The window system
Subject S001 sitting with eyes closed, seconds 10 to 14 of the run. Two electrodes over visual cortex, demeaned, band-passed 0.5–40 Hz, 60 Hz notched. The alpha rhythm is plainly visible on both, and the two traces move together most of the time. That co-movement is the entire content of what follows.
Covariance, then state system
The covariance estimator is Ledoit–Wolf shrinkage (the same lwf used throughout the CHB-MIT work). Diagonals are each channel's variance in µV²; the off-diagonal is how much they co-vary. O2 carries more power than O1 in this window, and the two are strongly correlated (r = 0.76).
Dividing by the trace throws away one number, the total power, and keeps the shape. What remains is a valid density matrix:
The diagonal of ρ is the fraction of window power on each electrode. The off-diagonal is the coherence between them. In quantum language this is a mixed state — not a single pure vector, but a weighted mixture of two.
Weights and patterns system
Diagonalising ρ splits it into two orthogonal spatial patterns and a weight on each. Plotted in the O1–O2 plane, the 640 samples form an elongated cloud; the long axis is the first pattern, and its weight is the fraction of power along it.
Read in EEG terms: 89 % of the window's power is a single in-phase pattern where O2 swings about 1.35× as far as O1, and the remaining 11 % is the anti-phase remainder. The state is mostly, but not entirely, pure. Purity and entropy are two views of the same two numbers, λ0 and λ1.
Loading it onto a qubit ancilla
A single qubit on its own is always in a pure state, so a mixed ρ cannot be written onto one directly. Purification is the standard fix: add a second qubit, the ancilla, and build a pure state of the pair whose system half looks like ρ once the ancilla is ignored.
The circuit does this in three gates. The ancilla is rotated so its amplitudes are √λ0 and √λ1; a CNOT copies that choice onto the system; then the unitary V rotates the system's basis states into the two patterns.
The resulting two-qubit statevector, in the basis |anc sys⟩:
| basis | amplitude | meaning |
|---|---|---|
| |0 0⟩ | +0.5602 | √λ0 · v0[O1] = 0.942 × 0.595 |
| |0 1⟩ | +0.7574 | √λ0 · v0[O2] = 0.942 × 0.804 |
| |1 0⟩ | −0.2697 | √λ1 · v1[O1] = 0.335 × (−0.804) |
| |1 1⟩ | +0.1995 | √λ1 · v1[O2] = 0.335 × 0.595 |
Each amplitude is a weight times a pattern entry — the eigendecomposition written out as a state. The ancilla's bit labels which pattern; the system's bit labels which electrode.
Check: is the state actually ρ? system
Trace out the ancilla and compare the reduced system state to the matrix from step 2.
Agreement to floating-point precision. The qubit is holding the covariance shape of that four-second window.
Read it back shots
The simplest observable on one qubit is Z, with eigenvalue +1 on |0⟩ and −1 on |1⟩. Here |0⟩ is electrode O1 and |1⟩ is O2, so Z asks: which electrode carries more of the power?
Negative means O2. On the register this is estimated by measuring both qubits 1000 times and counting.
The register agrees with the classical calculation within half a standard error of the shot noise. And the ancilla marginal, which was only there to make the state mixed, reads out the leading eigenvalue on its own: 87.8 % versus the true 88.75 %.
Purity, from the ancilla verification
Purity and entropy are not linear in ρ, so they cannot be read the way Z was. The usual route on a register is a SWAP test, which needs two copies of the state. This circuit does not need that, because the ancilla already holds the spectrum.
The reason is the Schmidt decomposition: for any pure state of two registers, the two halves have the same nonzero eigenvalues. The purification put those eigenvalues on the ancilla's diagonal in the measurement basis, so a plain count of the ancilla bit estimates λ0 and λ1 directly, and from them:
Both within shot noise, and the small-count bias on the minor eigenvalue accounts for most of the gap (the 8-channel version of this test, at 20,000 shots, lands on 0.492 against an exact 0.493).
This is a verification, not a circuit design. The ancilla reads the eigenvalues because the preparation loaded them there, and it will keep reading them under any unitary applied to the system afterwards — which also means nothing new is learned that way, since unitaries cannot change a spectrum. The moment the system is coupled to anything else — the open-system E/I channel that this framework is heading toward — the system–ancilla pair is no longer pure, the ancilla stops tracking the system's spectrum, and purity has to be read from the system side. That is where the SWAP test comes back.
What this does and does not show
It shows that the covariance-as-density-matrix identification survives contact with a real register, end to end, with real data: the preparation is exact, and a linear observable read by sampling matches tr(ρO) to within statistical error. The method is purification; nothing in it is specific to two channels, and the same three-gate structure scales to 4 channels (2 system qubits, 2 ancilla) and 8 channels (3 + 3).
It does not show any advantage. A 2×2 matrix is trivial to diagonalise, and the circuit needs the eigendecomposition as input, so the register is holding an answer the classical side already had — including the purity read from the ancilla, which only works because the preparation put the spectrum there. That is the point of a first test, not a defect of it. The experiment that goes beyond verification is to let the system evolve under something non-unitary and read purity from the system side, with a SWAP test or randomised measurements. That was not run here.
What was run here is the floor: the state is real, it can be put on a qubit, the qubit gives it back, and its purity can be checked. The same three-gate structure was then run at 4 channels (2 + 2 qubits, 5 CNOTs) and 8 channels (3 + 3 qubits, 26 CNOTs) with the same result.