Skip to content
Current section
The Quantum Computing Enthusiast’s Hub
Saved
All sections

All sections

Saved
Skip Learn navigation
Encyclopedia
Topic

Shot allocation for observable estimation

The distribution of a finite measurement budget among observable terms to control estimator variance.

Also called measurement budget allocation

Edition released Coverage: Overview · Technical
On this page

Definition and significance

A Hamiltonian expectation often combines many independently measured terms. Giving every term the same number of shots is simple but can waste resources when coefficients or variances differ. Shot allocation is a statistical resource decision under an explicit estimator model.

Mechanism and mathematical treatment

For independent term estimators, Var(E_hat)=sum_j c_j^2 sigma_j^2/N_j. With total shots N=sum_j N_j and known sigma_j, minimizing this expression gives N_j proportional to |c_j|sigma_j. Integer rounding and unknown variances require practical adjustments.

Fully worked reference example

Take two terms with coefficients 2 and 1 and equal unit variance. With 900 shots, equal allocation gives variance 4/450+1/450=1/90. Allocating 600 and 300 gives 4/600+1/300=1/100, a smaller variance at the same budget. The improvement follows from the unequal coefficient weights.

Limitations and common misconceptions

The formula assumes independent groups. Joint measurements introduce covariance; adaptive allocation can introduce additional statistical considerations. A zero estimated variance from a tiny pilot sample should not be treated as proof that no further shots are needed.

Scientific relationships

Term coefficients and variances guide a finite measurement budget.

Additional treatment: fully worked reference example

Take two terms with coefficients 2 and 1, and per-shot standard deviations 1 and 0.5. Their allocation weights are 2 and 0.5, so 80% of N goes to the first and 20% to the second. Total variance is 4/(0.8N)+0.25/(0.2N)=6.25/N. Equal allocation gives 4/(0.5N)+0.25/(0.5N)=8.5/N. At N=10,000, standard errors are 0.025 and approximately 0.029155 respectively.

Additional treatment: limits and misconceptions

Adaptive allocation can introduce bias if stopping decisions depend improperly on the same data. A zero pilot variance does not prove a term is exactly deterministic. Include readout mitigation and correlated measurement variance in the allocation model.

Allocating a time budget instead of an equal shot budget

Consider H=X+2Y+(1/2)Z on a maximally mixed qubit, so every Pauli mean is zero and every unweighted Pauli outcome has unit variance. Suppose an X or Z shot takes one model time unit, while a Y shot takes four. These are stipulated durations for a resource example, not measured device characteristics. The weighted per-shot variances are v=(1,4,1/4), and the durations are t=(1,4,1).

For independent estimators, minimize sum_g v_g/N_g subject to sum_g t_g N_g=T. A Lagrange multiplier gives N_g=sqrt(v_g/(lambda t_g)). Enforcing the budget yields N_g=T sqrt(v_g/t_g)/sum_h sqrt(v_h t_h), and the resulting variance is [sum_g sqrt(v_g t_g)] squared divided by T. Thus optimal shot numbers depend on standard deviation divided by the square root of duration, whereas the fraction of time spent on a group is proportional to sqrt(v_g t_g).

Here the denominator is 1+4+1/2=11/2. With T=1,100, the optimal integer counts are N_X=200, N_Y=200, and N_Z=100. Their time consumption is 200+800+100=1,100. The energy variance is 1/200+4/200+(1/4)/100=11/400=0.0275. Y receives the same number of shots as X but four times as much time, because its larger coefficient and longer duration balance in the count formula.

An idealized equal-shot allocation gives each term 1,100/6 shots and variance 31.5/1,100, approximately 0.0286364, before integer rounding. Equal time per term gives variance 51.75/1,100, approximately 0.0470455. These two meanings of equal allocation are different, and neither is the optimum for this example. A comparison must specify which budget is actually fixed.

Unknown variances and the role of pilot measurements

The preceding optimum assumes the variances are known. A finite pilot sample only estimates them. If a binary observable produces the same outcome in twenty pilot shots, its sample variance is zero, but its true outcome probability need not be deterministic. With no observed negative results, a one-sided 95 percent upper confidence bound on the negative probability is 1-0.05 raised to the power 1/20, approximately 0.139108.

The corresponding possible outcome variance remains as large as 4p(1-p) at that endpoint, approximately 0.479. Assigning no further measurements on the basis of the zero sample variance would therefore be unjustified. A conservative allocation can retain variance bounds or a minimum measurement floor until the uncertainty is small enough for the intended energy error.

Pilot results can be used to choose later fixed allocations, with the subsequent inference explicitly accounting for which samples enter the final estimator. More elaborate adaptive stopping schemes can be valid, but they require their own statistical analysis. Reusing an ordinary fixed-sample confidence formula after data-dependent stopping is not automatically justified by the fact that each individual shot is a legitimate quantum measurement.

Covariance can dominate a grouping decision

Take a Bell state |Phi+> and the observable H=Z0-Z1. A joint computational measurement always returns equal Z values, so the per-shot score Z0-Z1 is exactly zero. The expectation and its sampling variance are both zero in this ideal example. The covariance term cancels the two individual variances: Var(Z0-Z1)=1+1-2Cov(Z0,Z1)=0.

If the two expectations are measured on separate independently prepared copies, this cancellation is unavailable. With a total of N shots split equally between them, the estimated difference has variance 4/N. The distinction comes from the estimator's joint data, not from a change in the underlying expectation. For H=Z0+Z1, the same positive covariance instead increases the variance of a joint score relative to a calculation that incorrectly drops covariance.

A measurement group should therefore be assigned the variance of its entire weighted score, including every covariance term, rather than a sum of separately estimated variances. Grouping can also change preparation or basis-change duration. The time-budget derivation remains applicable after those group-level variances and durations are defined consistently.

Integer allocation and exact deterministic information

With equal-cost shots and fixed positive starting counts, the variance reduction from giving group g one additional shot is v_g/[N_g(N_g+1)]. Repeatedly assigning the next shot to the largest such reduction solves the separable integer allocation problem under that model. The marginal gains decrease as a group's count grows. With unequal indivisible durations, a simple benefit-per-time greedy rule need not solve the resulting discrete budget problem exactly.

A term with a known zero coefficient contributes nothing and needs no measurement. An identity term likewise contributes a known constant. A truly deterministic nonidentity score can sometimes be established algebraically from a known state or symmetry, but that is stronger information than observing repeated identical pilot outcomes. Resource estimates should identify whether a zero variance is proved, assumed, or statistically inferred.

For the hypothetical 1,100-unit budget, optimal counts, equal counts, and equal time give different allocations. The Bell-state example tracks covariance between measurements, and the twenty-shot example separates confidence from variance. The durations are model inputs and the variance values are analytic predictions.

A shot budget is also a time budget

The most variable contribution to an observable may deserve extra measurement effort, but that is not the complete allocation question. Some settings take longer to prepare, some require a costly basis change, and others produce information much more cheaply. A fixed number of shots and a fixed amount of laboratory time impose different constraints. This worked model combines observable coefficients, group variances and per-shot time. The continuous calculation has a closed-form optimum under its assumptions. Converting it to integer shot counts then introduces a small implementation problem: rounding can waste time or slightly change the optimum. The worked answers expose both the lower bound and the rounded schedule instead of hiding the distinction behind an allocation score. The model assumes the groups are independently estimated and their variances are known. A real pilot experiment spends part of the budget learning those variances. Calibration and circuit switching may add costs that depend on how measurements are grouped. Increasing one time cost while holding its physical variance fixed changes the preferred allocation. The resource tradeoff is conditional on these assumptions; different Hamiltonians and acquisition workflows can require different schedules.

Model: V = sum_i (a_i sigma_i)^2 / n_i; sum_i c_i n_i <= T; n_i* = T |a_i| sigma_i / (sqrt(c_i) sum_j |a_j| sigma_j sqrt(c_j)); Continuous lower bound V* = (sum_i |a_i| sigma_i sqrt(c_i))² / T Assumptions: Group estimates are independent. Variances, coefficients and per-shot costs are known and stationary. The rounded greedy schedule is compared with a continuous bound, not certified as the integer optimum.

The continuous counts are first rounded down. Remaining affordable shots are added by greatest immediate variance reduction per time unit; the displayed integer schedule is the result of this greedy rounding, not a proof of a global integer optimum.

The rounded allocation uses 1,200 of 1,200 time units. Its variance is 0.001118% above the continuous lower bound. The calculation shows why a costly measurement may deserve fewer shots even when its contribution is noisy.

Limitations: Equal time is not the same as equal shots. Pilot variance estimates and setup overhead can alter the schedule.

Specified synthetic inputs
QuantityValue
Time costs per shot1,2,5
Group standard deviations1,1.4,0.6
Observable coefficients1,-0.5,1.2
Time budget1200
Calculated baseline results · Approximate values use up to 6 significant digits.
Calculated quantitySynthetic result
Allocated shots, group 1335
Allocated shots, group 2165
Allocated shots, group 3107
Used time1200
Allocated variance0.0107996
Equal-time variance0.01143
Continuous lower bound0.0107995
Measurement-group allocation · Approximate values use up to 6 significant digits.
GroupContinuous shotsRounded shotsEqual-time shots
1333.341335400
2164.995165200
3107.33410780

Sources

  • Alberto Peruzzo et al. · · Research paper · Publication status unspecified · arXiv · DOI 10.1038/ncomms5213
    Verification scope

    Selected source text checked ·

    Primary formal source anchor; original worked examples independently derived, not reported experiments.

  • Thomas Lubinski et al. · · Research paper · Preprint recorded · arXiv
    Verification scope

    Citation identity checked ·

    Preprint timestamp; journal article 2023. Workload and timing boundaries matter.

  • Steven T. Flammia; Yi-Kai Liu · · Research paper · Preprint recorded · arXiv
    Verification scope

    Recorded source check ·

    Pure-target Pauli importance sampling and distinction between sampled settings and finite measurement repetitions checked.

    Selected access as stated; no full proof replication, experimental replication, or present performance ranking.

  • Reference · physics.nist.gov
    Verification scope

    Citation identity checked ·

    This check establishes the source title and link. Scientific claim review is separate.