QuantumAtlas

Interactive Calculator · Algorithms and Advantage

Quantum Shot Count Calculator

Work out how many times you must run a circuit to estimate a probability, an expectation value, or a molecular energy to the precision you want.

Beginner
Presets

Use 0.5 if unknown. That is the worst case.

Shots needed

9,604

For ±0.01 at 95% confidence

Run time

1.92 seconds

at 5,000 shots per second

Shots for other margins

MarginShotsTime
±0.197.0019.21 ms
±0.05385.076.83 ms
±0.019,6041.92 seconds
±0.00538,4167.68 seconds
±0.001960,4003.20 minutes

Shots versus margin of error

100010⁵10⁷10⁻⁴10⁻³0.010.1your targetMargin of errorShots
90% confidence95% confidence99.9% confidence

Halving the margin of error multiplies the shots by four. Precision is expensive.

Compute the number of measurement shots needed for a target margin of error and confidence level, for probabilities, expectation values, sums of Pauli terms, or whole output distributions, and see the run time at your shot rate.

What this calculator does

A quantum computer does not hand you a number. It hands you a random bit string every time you run it, and the quantity you care about, a probability or an average, must be estimated from many repetitions called shots. The more shots you take, the smaller the statistical error, but only slowly: the error falls as one over the square root of the number of shots. This calculator turns that rule into planning numbers for four common situations.

The first is estimating the probability of one outcome. The second is estimating the expectation value of an observable that returns plus or minus one. The third is estimating an energy that is a weighted sum of many Pauli terms, as in variational chemistry, where you must measure many different operators. The fourth is learning an entire output distribution to a given total variation distance, which shows why full tomography of large systems is impossible. For each, the calculator gives the shots needed for your margin and confidence, the run time, and a table of how the cost changes with the margin.

How to use it

Start with the Fair-coin outcome preset. To estimate an outcome probability of 0.5 within ±1 percentage point at 95 percent confidence, you need about 9,600 shots. Now change the margin to 0.1 percentage points, ten times smaller, and watch the shots grow a hundred times, to 960,000. That is the square-root law at work. The chart plots shots against margin on log-log axes, and the lines for different confidence levels are parallel straight lines with slope minus two.

Next, switch to the Rare outcome preset. For a probability of 0.001 and a margin of 0.0005, the estimate needs about 15,000 shots. Rare events are cheap in absolute terms but expensive in relative terms, because the margin you need shrinks with the probability. A warning appears because the normal approximation is poor for rare events; if you see no events at all, the rule of three says that the 95 percent upper bound on the probability is about three divided by the number of shots.

Then try the Chemistry energy preset. A molecular energy is a sum of hundreds or thousands of Pauli terms, and reaching chemical accuracy of 1.6 milli-Hartree for a 500-term Hamiltonian with average coefficient 0.05 requires about 940 million shots under the standard optimal allocation. At 5,000 shots per second that is more than two days. This kind of arithmetic is why measurement cost, not circuit depth alone, is one of the bottlenecks of variational algorithms, and why researchers invented grouping of commuting terms and techniques such as classical shadows.

The last preset learns a 20-qubit distribution to total variation distance 0.05, which takes of the order of 2²⁰ over 0.05² samples, about 420 million. The count doubles with each added qubit, so learning a full 40-qubit distribution this way is hopeless. Practical protocols avoid learning everything and estimate only the properties they need.

Reading the result

For a probability p estimated from n shots, the standard error is √(p(1−p)/n). A confidence interval of ±m at confidence level with z-score z needs n = z² p(1−p)/m². The worst case is p = 0.5, so if you do not know p, use it. For an expectation value of an observable with eigenvalues ±1, the variance is 1 − E², so the cost is largest when E = 0. For a sum of Pauli terms with coefficients c_i, the best allocation of shots among terms makes the variance (Σ|c_i|σ_i)²/N, where σ_i ≤ 1 is the standard deviation of term i, so the total shots scale with the square of the one-norm of the coefficients.

These counts are statistical minima. Hardware noise adds bias that no number of shots removes, and error mitigation adds overhead on top, as the mitigation calculator shows. Drift during a long run means that millions of shots may not be statistically identical, so practical protocols interleave calibration.

Assumptions and limits

The calculator uses the normal approximation, which is accurate when n·p and n·(1−p) are both comfortably larger than ten and rough otherwise. It treats shots as independent and identically distributed, and it assumes that the terms of a multi-term observable are measured with the optimal allocation, which is a lower bound. The distribution mode shows a scaling and not a precise count, since constants and logarithmic factors depend on the confidence you want. Real shot rates depend on circuit duration, readout, and reset times and range from about a hundred per second to a hundred thousand per second.

The formulas behind it

Probability estimate

n = z² · p(1 − p) / m²

Normal approximation for a binomial proportion with margin m and z-score z.

Expectation of a ±1 observable

n = z² · (1 − ⟨O⟩²) / m²

Variance of a ±1 random variable with mean ⟨O⟩.

Weighted sum of Paulis

n ≈ z² · (Σ|cᵢ|)² / m²

Optimal shot allocation among terms, using σᵢ ≤ 1.

Output distribution

n ≈ 2ᵏ / ε²

Samples to learn a distribution over 2ᵏ outcomes to total variation distance ε, up to constants.

Rule of three

p_upper ≈ 3/n

95 percent upper bound when no events are seen in n shots.

Worked examples

A fair coin outcome

  1. p = 0.5, margin ±0.01, 95% confidence (z = 1.96).
  2. n = 3.84 × 0.25 / 0.0001 = 9,604.

ResultAbout 9,600 shots. A margin ten times smaller needs a hundred times more.

A chemistry energy

  1. 500 Pauli terms with average |c| = 0.05, so Σ|c| = 25.
  2. Margin 1.6 × 10⁻³, z = 1.96.
  3. n = 3.84 × 625 / (1.6 × 10⁻³)² ≈ 9.4 × 10⁸.

ResultAbout 940 million shots, or roughly 2.2 days at 5,000 shots per second.

Learning a distribution

  1. 20 qubits, so 2²⁰ ≈ 10⁶ outcomes, with ε = 0.05.
  2. n ≈ 1.05 × 10⁶ / 0.0025 ≈ 4.2 × 10⁸.

ResultHundreds of millions of shots for just 20 qubits; the count doubles per added qubit.

Frequently asked questions

Why does error shrink so slowly with more shots?

Because averaging independent random samples reduces the standard error only as one over the square root of the number of samples.

How many shots do cloud quantum computers allow?

Limits vary by provider, from thousands to millions per job, and long runs can be split across jobs.

Can I avoid measuring every Pauli term?

Yes. Grouping commuting terms, symmetry reductions, and classical shadows can cut the cost substantially.

References

  1. Wecker, D., Hastings, M. B., & Troyer, M. (2015). Progress towards practical quantum variational algorithms. Physical Review A, 92, 042303.
  2. Rubin, N. C., Babbush, R., & McClean, J. (2018). Application of fermionic marginal constraints to hybrid quantum algorithms. New Journal of Physics, 20, 053020.
  3. Huang, H.-Y., Kueng, R., & Preskill, J. (2020). Predicting many properties of a quantum system from very few measurements. Nature Physics, 16, 1050-1057.
  4. Brown, L. D., Cai, T. T., & DasGupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16, 101-133.
  5. Wilson, E. B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association, 22, 209-212.
  6. McClean, J. R., Romero, J., Babbush, R., & Aspuru-Guzik, A. (2016). The theory of variational hybrid quantum-classical algorithms. New Journal of Physics, 18, 023023.

Keep exploring

These calculators use simplified, published models for education and planning. Real devices and systems differ, so treat results as estimates. They are not engineering, investment, legal, or security advice.