Shots and Sampling
A quantum computer cannot read out the full state vector directly. Instead, you measure the
circuit — and each measurement produces a single classical bit: 0 or 1. That single result tells
you almost nothing on its own. The power comes from running the same circuit many times and counting
the outcomes.
From amplitudes to probabilities
The Born rule connects the quantum state to measurement statistics. For a single qubit in state , the probability of each outcome is the squared magnitude of the corresponding amplitude:
Because probabilities must sum to one, — the normalization condition. The amplitudes themselves encode more information (phase, interference), but a single measurement discards that; only and survive.
Shots: the law of large numbers in quantum form
A single shot is one prepare-and-measure cycle. With shots, the fraction of 0 outcomes
converges to as grows. More precisely, the statistical error in a frequency estimate
scales as : doubling the number of shots reduces the uncertainty by a factor of
, so obtaining one extra decimal digit of precision requires one hundred times more
shots.
For the equal-superposition state , both amplitudes have the same magnitude:
Running 100 shots you might see 47 zeros and 53 ones. Run 10 000 shots and you will be much closer to 5000/5000. The underlying probability is always exactly ; the fluctuations are ordinary sampling noise.
Try it
Build a circuit that prepares and measures it. The grader checks the probability distribution — it should show .
Switch to the Probabilities tab after running: the two bars should be equal. Vary the gate (try
c.x(0) instead of c.h(0)) and observe how the distribution changes — a definite state gives a
single bar at 1.0, while a superposition spreads probability across outcomes.
Sign in on the full site to ask questions and join the discussion.