Mid-Circuit Measurement and Fast Feedback
Mid-circuit measurement reads a qubit while the circuit is still running, enabling classically-controlled gates and dynamic circuits — the real if-statement of quantum computing.
What it means
A CX gate is not an if-statement — it contains no measurement and simply entangles two qubits.But quantum circuits do have a real if: measure a qubit in the middle of the circuit and, conditioned on the classical result, apply a gate to another qubit (e.g.Qiskit's if_test applying X when both measured bits are 1).This requires fast feedback, and the entire loop must fit inside the coherence window: readout, signal propagation up (~50–100 ns), classical decision, signal propagation back down (~50–100 ns), and gate application (10–50 ns) — hundreds of nanoseconds to microseconds in total, against a coherence time of hundreds of microseconds.Light travels only about 30 cm per nanosecond, so even cable lengths enter the timing budget.Ordinary CPUs under an operating system are non-deterministic (schedulers, interrupts, I/O), so the decision is made by FPGAs, whose logic is synthesized as circuitry with deterministic clock-cycle timing — the ADC-to-FPGA path can demodulate, threshold, and emit the gate command within the same clock cycle.Textbook measurement is non-destructive, but real readout can destroy the state: QND (quantum non-demolition) is a property many commercial machines do not guarantee by default.A simple application is active reset — measure first, and if the qubit is not 0, pulse it back to 0 instead of waiting.Everyday analogy
Common misconceptions
- Measurement in textbooks is non-destructive — measure again and you get the same value. But real readout can be destructive: the value is read correctly, yet the qubit may not remain in that state. QND (quantum non-demolition) is a property many 2024–2025 commercial machines do NOT guarantee by default, because non-QND readout is easier to calibrate.
- CX is not a classical if-statement — no measurement occurs inside it; it entangles the qubits while the control's state remains undetermined.
- Mid-circuit measurement is not free: readout errors can send the classical branch the wrong way, the feedback loop consumes coherence time, and non-QND readout makes reusing the measured qubit hard. Dynamic circuits are powerful but never free.
Key takeaways
- Latency budget: readout + ~50–100 ns signal up + ns-scale classical decision (FPGA) + 50–100 ns signal down + 10–50 ns gate — all within a coherence time of hundreds of microseconds.
- Light travels about 30 cm (roughly a foot) per nanosecond — cable lengths are part of the nanosecond synchronization math.
- FPGAs, not ordinary CPUs, make the feedback decision: their logic is synthesized as circuitry with deterministic timing, while OS-driven CPUs cannot guarantee 50 ns.
- Dynamic circuits reached utility scale — one simulation experiment cut two-qubit gates by 28% per Trotter step — and active reset saves circuit startup time by measuring and flipping back to 0.
Check your understanding
What makes a CX gate fundamentally different from a classical if-statement?
- A.A CX gate runs faster than any classical branch instruction
- B.A CX gate contains no measurement — it entangles the qubits while the control's state remains undetermined
- C.A CX gate first measures the control qubit and flips the target only if the result is 1
- D.A CX gate can only be applied at the very end of a circuit
Show the answer
Answer: B. A CX gate contains no measurement — it entangles the qubits while the control's state remains undetermined
Why: An if-statement requires reading a value, but CX contains no measurement. After CX the control qubit's state is still undetermined; the target is simply entangled with it — think entangle(q0, q1), not if (q0 == 1) flip(q1). The real quantum if is a mid-circuit measurement followed by a classically-controlled gate.
Why do fast-feedback systems use FPGAs rather than ordinary CPUs for the classical decision?
- A.FPGAs have higher clock frequencies than any CPU
- B.FPGAs can store more calibration data in memory
- C.FPGA logic is synthesized as circuitry with deterministic nanosecond-scale timing, whereas OS-driven CPUs are non-deterministic due to schedulers, interrupts, and I/O
- D.CPUs cannot be physically connected to the readout electronics
Show the answer
Answer: C. FPGA logic is synthesized as circuitry with deterministic nanosecond-scale timing, whereas OS-driven CPUs are non-deterministic due to schedulers, interrupts, and I/O
Why: A CPU under Windows/macOS/Linux cannot guarantee a decision within ~50 ns because schedulers, interrupts, and I/O make its timing non-deterministic. An FPGA does not 'execute code' — its VHDL/Verilog logic is synthesized into actual circuitry, so the ADC-to-FPGA path can demodulate, threshold, and emit the gate command within a deterministic clock cycle.
Builds on
Dynamic-circuit capability and QND-by-default vendor behavior are current-state claims (2024-2026) and will change; physics of classically-controlled gates itself is standard. Re-verified 2026-07-10: no material drift.
Learn it hands-on
This concept is part of a 46-level curriculum with an interactive simulator and Lumen, a tutor whose answers are verified before you see them. Levels 1–5 are free.
