QuantumNative

How to Read Quantum Measurement Results: Shots, Counts and Histograms

Why the same quantum circuit returns different bitstrings, what a shot is, how counts approximate probabilities, and why two different states can draw the same histogram. Worked through with the plus/minus states and the Bell pair.

One circuit, many answers

Run a quantum circuit and you get a bitstring, something like 01. Run it again and you may get 10. Nothing was wrong with the first run. A measurement does not copy the quantum state out of the machine; it returns one outcome, drawn at random, with probabilities fixed by the state.

The rule that sets those probabilities is the Born rule: each possible bitstring has an amplitude, a complex number, and the chance of seeing that bitstring is the squared magnitude of its amplitude. The amplitudes themselves are never displayed by a measurement. You only ever see the outcomes they make likely.

So the honest way to read a quantum result is as a sample from a distribution, not as an answer. The rest of this page is about reading that sample well.

Shots and the shape of a histogram

A shot is one full run of the circuit: prepare, apply gates, measure, write down one bitstring. A histogram is the tally of many shots, one bar per bitstring that appeared.

Two facts follow:

  • The fraction of shots on a bar estimates that bitstring's probability. It is an estimate, in the same way that the fraction of heads in a run of coin flips estimates one half.
  • The estimate has scatter, and the scatter shrinks slowly. It falls roughly with the square root of the number of shots. Four times as many shots buys you about half the scatter, not a quarter of it.

In practice this means you should not read meaning into small gaps. If two bars should be equal and they come out slightly uneven, that is what finite sampling looks like. If you need to tell a small real difference from noise, you need more shots, and usually many more than intuition suggests.

On real hardware there is a second source of unevenness on top of sampling: noise from imperfect gates and readout, which can put a few counts on bitstrings that an ideal circuit would never produce. An ideal simulator has neither problem unless it deliberately samples.

Read the labels before the bars

Before comparing bars, check how the tool writes its bitstrings. With two qubits, the label 10 means one qubit read one and the other read zero, but which is which depends on a convention that is not the same everywhere. Some toolkits put qubit zero on the right; others put it on the left.

Getting this backwards makes a correct circuit look broken. If you expected the target qubit to flip and the "wrong" bar is tall, read the label in the other direction before you change anything.

Two more reading habits help:

  • A missing bar can be information. If a bitstring never appears, its probability is zero (or, on hardware, close to it). In an ideal simulator the absent bars often carry the most meaning.
  • You can read one qubit from a multi-qubit histogram. To get the chance that a particular qubit read one, add up every bar whose label has a one in that qubit's position. This is called a marginal, and it is how you check a single qubit inside a larger circuit.

Worked example: the plus and minus states

Start with one qubit in zero and apply a Hadamard. That makes the plus state, an equal-weight combination of zero and one. Measure it, and the histogram is an even split.

Now apply a Hadamard and then a Z gate. That makes the minus state. The two amplitudes have the same size as before, but one of them has flipped sign. Measure it, and the histogram is again an even split.

The two histograms are identical. The two states are not. The difference is a relative phase, and a measurement in the zero-one basis is blind to phase: squaring the magnitude throws the sign away.

To make the difference visible, change what you measure. Add a second Hadamard just before the measurement. The plus state turns back into zero, every shot. The minus state turns into one, every shot. The phase difference that the first histogram hid has become the whole difference between the two results.

The lesson generalises. A histogram tells you about the probabilities in the basis you measured in, and nothing else. When two circuits draw the same bars, that is not proof that they built the same state.

Worked example: the Bell pair

Apply a Hadamard to the first of two qubits, then a CNOT from the first to the second. The resulting Bell pair gives 00 about half the time and 11 about half the time. The mixed outcomes, 01 and 10, do not appear in an ideal run.

The empty bars are the interesting part: the two qubits always agree. But the histogram alone cannot tell you whether that agreement is quantum. Picture a machine that secretly flips a fair coin and then prepares either 00 or 11. Its histogram looks the same.

Again the fix is to measure differently. Put a Hadamard on each qubit before measuring. The Bell pair still gives only 00 and 11. The coin-flip machine now gives all four bitstrings in roughly equal numbers. The agreement that survives a change of basis is the signature of entanglement; agreement in one basis alone is not.

What the QuantumNative Circuit Lab shows

QuantumNative's web app includes a Circuit Lab where you place gates on a click-to-place circuit grid (H, X, Y, Z, CNOT, T and S) and run the circuit on a classical state-vector simulator. Results are labelled simulated; nothing runs on quantum hardware.

When you run a circuit, the result panel shows two things:

  • Probability bars for each bitstring, computed exactly from the simulated state.
  • Expected counts for each outcome, meaning each probability multiplied by the number of shots, rounded so the counts add up. These are not random samples, so the same circuit returns the same counts on every run. You see the shape that a long experiment approaches, without the scatter described above.

Two details from the reading section apply directly. In this lab, q0 is the leftmost character of each bitstring. And outcomes with zero probability are left out of the panel, so a missing bar means that bitstring cannot occur in the ideal circuit.

The lab also has machine-checked missions, including a plus state, a minus state, a Bell pair, a GHZ state and Deutsch's algorithm. A mission compares the state, not the histogram: after each run the simulated state is compared with the target by fidelity, which ignores global phase but not relative phase. That is why the minus-state mission does not accept a plus state, even though their histograms look the same. It is a direct, checkable version of the worked example above.

The Circuit Lab is part of the signed-in app and is included in the Free plan, with a higher qubit-wire limit on the Pro plan.

A short checklist for any histogram

  • Treat each bar as an estimate with scatter, unless the tool tells you it shows exact or expected values.
  • Check the bit order convention before deciding a result is wrong.
  • Look at which bars are missing, not only which are tall.
  • Sum bars to read a single qubit.
  • When two circuits draw the same histogram, change the measurement basis before concluding they made the same state.

Open the QuantumNative Circuit Lab, build the plus state and the minus state, and compare their result panels before you add a second Hadamard.

Get started