You are reading without signing in. Sign in or continue as guest to take quizzes and climb the ranks.
Measuring in the middle
What changes when a measurement is followed by more gates, and why statevector tools step aside.
- 01Describe the state after a mid-circuit measurement as a branch, not a vector.
- 02Explain why QubitLab's State tab shows one statevector per branch.
- 03Reset and reuse a qubit.
Until now every measurement came last. Put one in the middle and the circuit splits: in the shots where the bit read 0 the remaining qubits are in one state, in the shots where it read 1 they are in another. There is no longer a single statevector for 'the circuit', only one per branch, weighted by how often that branch occurs.
One state per branch
Open the State tab. Two branch chips appear (c = 0 and c = 1, about 50% each); pick one to see the statevector of the untouched qubit for that branch.
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
bit[2] c;
h q[0];
c[0] = measure q[0];
h q[1];
x q[0];
A measured qubit is not spent. `reset q[0];` returns it to |0⟩ whatever was read, so a short-lived helper qubit (an ancilla) can be used again and again. Many error-correction codes measure and reset the same ancillas thousands of times.
2 questions · one try each counts
After a mid-circuit measurement, the best description of the register is…
Sign in to answer and climb the ranks; you will come back to this lesson.
Why can't the gate-by-gate debugger trace a dynamic circuit?
Sign in to answer and climb the ranks; you will come back to this lesson.