Measurement Sampling & Shots
Track: Quantum Gates & Circuits · Difficulty: Beginner · Est: 12 min
Measurement Sampling & Shots
Overview
A common point of confusion is this:
- “If the circuit is deterministic, why do I get different answers when I run it again?”
This page addresses the practical execution problem:
- measurement produces random samples from a probability distribution,
- so you need repeated runs (called shots) to estimate probabilities.
By the end, “shots,” “histograms,” and “randomness” should feel natural and non-mystical.
Intuition
When you measure a qubit in the computational basis, quantum theory predicts probabilities. For a single qubit,
- you get outcome 0 with probability ,
- and outcome 1 with probability .
A single run gives one outcome, not the full distribution. So you repeat the experiment.
A shot is one complete execution of the circuit, including measurement.
If you run the same circuit many times:
- the list of observed bitstrings is a set of samples,
- the fraction of each outcome approaches the true probability.
A histogram is just a visual summary of those counted outcomes.
Formal Description
Why measurement is probabilistic
Suppose (just before measurement) the system is in a state
If you measure in the computational basis, quantum theory says:
Measurement returns one bitstring drawn according to this distribution.
What a “shot” is
One shot means:
- prepare the initial state,
- apply the circuit’s gates,
- measure,
- record the classical outcome.
Repeat for shots to get samples.
Why repeated runs are required
If for a single-qubit experiment, a single shot is just one outcome. You might see 0 or 1.
Only after many shots can you estimate the probability. A simple estimator is frequency:
As grows, these frequencies become more stable.
How histograms arise
For multi-qubit measurement, each shot produces a bitstring like 00, 01, 10, 11 (for two qubits), or longer strings for more qubits.
A histogram is a map:
- bitstring → count (or percentage).
Worked Example
Suppose a 2-qubit circuit ideally produces the Bell state
The ideal measurement distribution in the computational basis is:
Now imagine you run shots. You might see outcomes like:
00, 11, 00, 00, 11, 00, 11, 11, 00, 11Counts:
- 00 occurred 5 times
- 11 occurred 5 times
So the histogram is 50% / 50%.
But with only 10 shots, you could easily get 6/4 or 7/3. That doesn’t mean the circuit “changed.” It means sampling has variation at small sample sizes.
Turtle Tip
A circuit run gives you a sample, not a probability. Shots are how you turn samples into probability estimates.
Common Pitfalls
- Don’t interpret shot-to-shot variation as “the circuit is unstable.” In the ideal model, the pre-measurement state is fixed; measurement is the random step.
- Don’t confuse “probability” with “frequency.” Frequency is an estimate that improves as shots increase.
Quick Check
- What is one “shot” in circuit execution?
- Why do you need many shots to estimate ?
What’s Next
Samples and histograms are the raw measurement output. Often, algorithms don’t use raw bitstrings directly—they use expectation values like or computed from samples. Next we explain how expectation values are estimated from circuit measurements.
