Learn / How the Chilzer QPU Doctor works
How the Chilzer QPU Doctor works
This explains what the doctor does on the chip when you run it, why each step is there, and how to judge its answers.
It uses real data from IBM Heron r2 processors (2026-12-04). The user guide is cqd/README.md; the full experimental
record is RESULTS_PHASE7.md.
1. The problem
A circuit fails if any qubit it uses fails during the circuit. Listed calibration (readout error, T1, T2, gate errors) is measured by the provider at intervals, mostly on qubits tested one at a time. Two things it can miss:
- A qubit that loses its phase while its neighbours are busy. Inside a circuit, a qubit often waits a microsecond or more while gates run beside it. A small error in its frequency, or crosstalk from those gates, turns its state while it waits.
- Change since the last calibration. Qubits drift within the hour (section 8).
The doctor tests every qubit in the situation a circuit puts it in: waiting next to running gates, on the chip as it is now. To do that it needs a computation whose correct answer is known exactly, so that any deviation is an error.
2. A computation with a known answer
The Chilzer State Engine (Thomas Michael Chilzer Jr.) builds quantum states from the repeating decimals of primes. The doctor uses plane 17.
1/17 = 0.0588235294117647 0588…, a cycle of 16 digits, and 16 = 2⁴, so one cycle fills a 4-qubit register: tick t (0 to 15) is the basis state |t⟩. Doing the long division, the remainder after t steps is r_t = 10^t mod 17. Tick t is a Hit when 3 divides 17 + r_t. Hits get the sign −1, the other ticks +1:
| tick t | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| remainder r_t | 1 | 10 | 15 | 14 | 4 | 6 | 9 | 5 | 16 | 7 | 2 | 3 | 13 | 11 | 8 | 12 |
| 17 + r_t | 18 | 27 | 32 | 31 | 21 | 23 | 26 | 22 | 33 | 24 | 19 | 20 | 30 | 28 | 25 | 29 |
| sign | − | − | + | + | − | + | + | + | − | − | + | + | − | + | + | + |
The circuit puts the 4 qubits in an equal superposition of all 16 ticks, applies these signs (a phase oracle), and reads the result with an inverse quantum Fourier transform. The output k (0 to 15) then has exactly these probabilities:
| k | 0 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | every odd k |
|---|---|---|---|---|---|---|---|---|---|
| P(k) | 1/16 | 1/16 | 5/16 | 1/16 | 1/16 | 1/16 | 5/16 | 1/16 | 0 |
One of these numbers carries arithmetic: P(8) = (2h/16)², with h = h(−51) = 2, the class number of the field ℚ(√−51). In every patch the doctor reads h back as 8·√P(8). A patch that returns 2 (between 1.5 and 2.5) computed correctly.
3. Forbidden outcomes
Every odd k has probability exactly zero. The reason is Theorem 2 of the engine (Thomas Michael Chilzer Jr.): the sign pattern repeats after half a turn, sign(t + 8) = sign(t). In the table, ticks 8–15 repeat ticks 0–7.
For plane 17 the reason fits in one line. 10⁸ leaves remainder 16 = −1 on division by 17, so half a turn sends each remainder r to 17 − r. Then 17 + r is divisible by 3 exactly when r leaves remainder 1 on division by 3, and so is 17 + (17 − r) = 34 − r. A Hit stays a Hit.
A pattern that repeats every 8 ticks out of 16 has no odd frequencies, so the Fourier transform puts no weight on any odd k. There is a second consequence: the sign at tick t depends only on t mod 8, the lower 3 bits of t. The top qubit of the register is never acted on. It starts in |+⟩ (an equal superposition of 0 and 1), nothing touches it, and at the end of the inverse Fourier transform it decides whether k is odd or even.
4. The sentinel
So each 4-qubit patch splits exactly in two (the test suite checks the compiled circuits against the exact answer):
- a block of 3 qubits that does all the computation: the 8 signs and the rest of the Fourier transform, compiled to 12 CZ gates plus single-qubit gates;
- a sentinel: one qubit that gets a Hadamard gate (H), waits while its block runs (the block's scheduled time, 1.488 µs on Heron r2), gets a second H, and is measured.
H takes |0⟩ to |+⟩; the second H takes |+⟩ back to |0⟩. A healthy sentinel reads 0 every time. It reads 1 when:
- its phase turned during the wait: |+⟩ moved toward |−⟩, which the second H turns into 1. A frequency offset, dephasing noise or crosstalk from the gates next door all do this;
- its readout reported 1 for a 0 (a 0 → 1 readout error).
Either way the cause is that qubit's own. The block's errors cannot reach the sentinel's bit, because the sentinel shares no gate with its block. This is what makes a whole-chip test possible: each sentinel is a witness for exactly one physical qubit, even with every other qubit on the chip busy.
The fraction of shots in which a sentinel reads 1 is its leak. On IBM Heron r2 the typical qubit leaked 0.035–0.061 (the chip medians in our 8 scans): ordinary dephasing over 1.5 µs plus readout. The faults the doctor found leaked 0.10 to 0.93.
5. Checking a whole chip in one job
The doctor reads the chip's coupling map and tiles it with patches: a path of 3 connected qubits for the block, plus one neighbouring qubit as the sentinel. Patches in the same round share no qubit, so they all run side by side in one circuit. It searches for a set of rounds in which every qubit is the sentinel at least once. On a 156-qubit Heron chip that takes 6 rounds, so 6 circuits. Two more circuits measure readout directly: all qubits prepared in 0, then all in 1. That gives 8 circuits, 4096 shots each, one job: about 11 s of charged QPU time (IBM's figure for our runs).
Running many patches side by side could in principle disturb them. In Phase 7 we measured this directly on each chip (one patch run alone versus the same patch inside a full round): it made no meaningful difference to the sentinel's leak. Some qubits are covered twice; their two readings agreed (r = 0.984–0.998).
6. From counts to a verdict
For every qubit the doctor computes:
- e0, e1: how often it misread a prepared 0 or 1 (from the two readout circuits);
- leak: its sentinel's rate of 1s (the mean, if it was a sentinel twice).
It then sets a flag line: 0.10, or twice the chip's median leak if that is higher. A noisy chip is judged against itself: on a noisy day, ordinary qubits are not all flagged. Each qubit gets a status, from its own numbers only:
| Status | Rule |
|---|---|
| readout fault | e0 or e1 ≥ 0.15 |
| phase fault | readout below 0.10, leak at or above the strong line = max(0.15, flag line + 0.05) |
| borderline | readout 0.10–0.15, or leak between the flag line and the strong line |
| healthy | everything below the lines |
Why borderline exists. Readings near a line are close calls. In Phase 7, flags that did not repeat in a second scan two hours later had a median leak of 0.11–0.16; flags that did repeat had 0.17–0.28. The doctor still reports borderline qubits, but it treats them as "watch", not "avoid", unless a second check confirms them (section 8).
The known-answer check. For every "clean" patch (all four qubits with readout below 0.10) the doctor removes the measured readout errors (tensored mitigation), compares the block's 8 outcomes with the exact table of section 2 (total variation distance, TV), and reads the class number 8·√P(8). If most clean patches read h = 2, the job ran as intended: compilation, gates and timing are all right. In our 8 whole-chip scans, 96.4–100% did, with median TV 0.054–0.070. If your report shows a low share here, distrust that report and run it again.
Listed calibration. The doctor also reads the provider's listed readout errors and names the flagged qubits whose listed error is under 5%: the ones you would have chosen if you went by the listed numbers.
7. Diagnosis: why a qubit fails
A leak says that a qubit fails, not why. cqd diagnose re-tests the flagged and borderline qubits:
- Quiet waits. Each qubit gets H, waits W, gets H, and is measured, with every neighbour resting in |0⟩. Waits are 0, 1.5 and 3.1 µs. Heavy-hex chips split into two groups of qubits in which no two are neighbours (two-colouring), so one circuit tests half the chip at once in quiet.
- A spin echo. The same 1.5 µs wait with an X flip in the middle. A steady frequency offset turns the phase one way in the first half and back in the second, so the echo cancels it; random noise is not cancelled.
- The patch again, with and without the echo, to see whether busy neighbours matter.
| What it sees | Cause reported |
|---|---|
| clean at W = 0, grows with W, echo cancels it | frequency drift, with the offset Δf in kHz |
| echo cannot cancel it | noise |
| clean in quiet, flips only next to running gates | crosstalk from neighbouring gates |
| already fails at W = 0 | readout or gate error |
Reading a frequency offset. A qubit whose frequency is off by Δf turns its phase by 2π·Δf·W in a wait W. Its flip probability is
leak(W) = c + a · sin²(π · Δf · W)
where c is the floor (readout and dephasing at W = 0) and a is the contrast. The doctor fits Δf over 0–325 kHz.
Worked example: ibm_fez, qubit 82 (Phase 7 experiment E49, waits 0, 1.5, 3.1 and 4.6 µs). Readout error 0.2%; listed T2 normal. Fitted offset: Δf = 290.5 kHz.
| wait W | 0 µs | 1.536 µs | 3.072 µs | 4.608 µs |
|---|---|---|---|---|
| measured leak | 0.002 | 0.947 | 0.106 | 0.829 |
| sin² law, Δf = 290.5 kHz (c = 0.002) | 0.002 | 0.970 | 0.112 | 0.763 |
The offset was fitted from the 1.5 and 3.1 µs waits; the 4.6 µs value is a prediction, held out from the fit.

At 290 kHz the phase turns almost half a cycle in 1.5 µs (the qubit flips), almost a full cycle in 3.1 µs (it looks fine again), and about 1.3 cycles in 4.6 µs (mostly flipped again). A circuit that let this qubit idle for 1.5 µs got the wrong answer 95% of the time. A check at a single wait of 3.1 µs would have passed it. That is why the doctor uses several waits.
Across three IBM Heron r2 chips, 34 qubits had clean readout but leaked: 18 were frequency drifts (18.5–290.5 kHz), 9 noise, 6 crosstalk and 1 failed with no wait. Limits of the fit: an offset above about 325 kHz can look like a smaller one (aliasing); below about 30 kHz the fit also absorbs ordinary dephasing, so the offset is an upper bound.
What you can do with a drift. Avoid the qubit for circuits with idle time, or protect idle periods with dynamical decoupling (a train of echoes, as in step 2). A drift can also go away on its own: ibm_kingston qubit 45 leaked 0.26 at 17:15 (in a quiet test it flipped and an echo cancelled it: a drift) and 0.06 at 18:50.
8. The two-check rule
Worked example: ibm_kingston, four whole-chip scans in 2.6 hours (17:15, 18:50, 19:31, 19:49 UTC). Status by the rules of section 6; leak in brackets.
| qubit | 17:15 | 18:50 | 19:31 | 19:49 |
|---|---|---|---|---|
| 149 | phase (0.39) | phase (0.34) | phase (0.37) | phase (0.33) |
| 130 | phase (0.58) | readout (0.54) | phase (0.56) | phase (0.48) |
| 102 | healthy (0.05) | phase (0.22) | healthy (0.05) | healthy (0.06) |
| 73 | healthy (0.06) | readout (0.25) | healthy (0.06) | healthy (0.04) |

Nine qubits (92, 112, 113, 121, 127, 130, 131, 146, 149) were faulty in all four scans. Four (6, 73, 87, 102) went bad together at 18:50 and were fine by 19:31. Qubit 73's readout error went 2% → 20% → 2%.
One check cannot tell these apart. Two can:
- avoid a qubit if it is not healthy in both checks, or if it is firmly faulty (readout or phase fault) in the latest;
- watch a qubit that is flagged in only one check, or only borderline.
When the doctor ran at 19:49 with the 18:50 report as its previous check, it confirmed exactly the 9 persistent
qubits and cleared all 4 transient ones. If you run a check, then another an hour or more later, cqd avoid applies
the rule for you.
9. What the doctor cannot tell you
- A reading belongs to a qubit in its patch. Next to a badly faulty qubit, a sentinel's reading can rise: ibm_kingston qubit 131 read 0.45 with faulty qubit 130 in its block and 0.12 otherwise. In bulk this did not matter (changing the patch plan moved a typical reading by 0.005, the same as repeating the plan), but treat a flag next to a confirmed bad qubit with care.
- 1 → 0 readout errors do not show in the sentinel; they come from the readout circuits in the same job.
- Gate errors inside a block are not assigned to individual qubits; the known-answer check tests them together.
- Between checks the chip can change. Two checks, or
cqd monitor, narrow that window but do not close it. - Hardware tested: IBM Heron r2 (156 qubits) only, and the packaged
diagnosecommand on a simulated chip only (its measurements were run on hardware as experiments E48 and E49). Other chips are planned from their coupling map; the quiet tests ofdiagnoseneed a coupling graph that splits into two groups of non-neighbours. If you run on real machines, please help confirm and benchmark it: see "An open invitation" incqd/README.md. - Not a quantum-advantage claim. The answer is known in advance. That is what makes it a test.
Credits. The Chilzer State Engine, plane 17, the Hit rule and Theorem 2: Thomas Michael Chilzer Jr. The doctor's design, code and this explanation: written with Claude (Anthropic, Claude Opus 5.5), directed and reviewed by the author. Standard tools used: the quantum Fourier transform, phase oracles, Ramsey and spin-echo measurements, tensored readout mitigation, symmetry verification, heavy-hex two-colouring, Qiskit. Licensed under CC BY-NC 4.0 with the Stewardship & Peace Clause.
Source: docs/HOW_IT_WORKS.md at v0.1.1 · DOI 10.5281/zenodo.24847073