You are reading without signing in. Sign in or continue as guest to take quizzes and climb the ranks.
Measurement
What a measurement does to a state, why shots matter and how to read a histogram.
- 01State the Born rule.
- 02Explain why one shot tells you almost nothing and 4096 shots tell you a lot.
- 03Read a QubitLab histogram and estimate its statistical error.
A measurement asks the qubit a yes/no question in a chosen basis. The answer is random, with probabilities given by the squared amplitudes, and afterwards the qubit is in the state matching the answer. The superposition is gone; you cannot measure the same copy twice to learn more.
01Shots and statistical error
Because each run gives one bit string, you repeat the circuit many times (shots) and count. With N shots the estimate of a probability p has standard error about √(p(1−p)/N). For p = 0.5 and 1024 shots that is ±1.6 percentage points; for 4096 shots ±0.8. QubitLab defaults to 4096 shots for that reason.
Shots in action
Run this with 64 shots, then 4096 (Run panel → Shots). Watch how the two bars approach 50/50 and how the ideal reference line stays fixed.
OPENQASM 3.0;
include "stdgates.inc";
qubit[1] q;
bit[1] c;
h q[0];
c[0] = measure q[0];
02Measuring in another basis
Hardware only measures in the computational basis. To measure in the X basis you rotate first: apply H, then measure. The sequence H then measure answers the question 'was the qubit |+⟩ or |−⟩?'. This trick is how every algorithm turns phase information into bits.
2 questions · one try each counts
A single shot of a circuit returns 1. What do you know about the state before measurement?
Sign in to answer and climb the ranks; you will come back to this lesson.
To estimate a probability near 0.5 to within ±1 percentage point, roughly how many shots are needed?
Sign in to answer and climb the ranks; you will come back to this lesson.