Measurement Sampling
Measurement sampling turns a probability distribution or quantum instrument into individual outcomes. It adds finite-shot uncertainty to an otherwise exact simulation. The central numerical task is to preserve the distinction between a state, a probability, an observed frequency, and a conditional postmeasurement state.
Helpful background. Density-matrix simulation supplies circuit states and branches.
Categorical sampling from Born probabilities
Section titled “Categorical sampling from Born probabilities”For computational-basis measurement, or . Form cumulative sums , draw uniformly in , and select the first with .
Check normalization and nonnegativity before forming the cumulative distribution. Remove only negligible roundoff-sized negatives with an explicit diagnostic; large negatives indicate an invalid state. Set the final cumulative endpoint to one after checking the total, to avoid an unassigned outcome caused by summation roundoff.
Use the strict inequality in the selection rule, including for repeated cumulative values from zero-probability bins. For example, probabilities have cumulative values : selects bin 1 and selects bin 3 in zero-based numbering. A binary search must select the insertion point after equal cumulative values. This also avoids accidentally choosing a forbidden outcome when a generator returns exactly zero.
For measurement of a subsystem, sum over unmeasured indices first. The mapping from bitstring to integer must agree with the simulator’s qubit order. A one-hot state on each basis bit provides a better ordering test than a symmetric Bell state.
Conditional state updates
Section titled “Conditional state updates”For an outcome operator ,
A general outcome can contain several Kraus operators, in which case sum their unnormalized contributions before normalizing. Sampling a Kraus label that the experiment does not resolve describes a finer record than the observer receives.
The POVM effect determines the probability , but not the conditional state. For instance, the instruments with operators and have identical computational-basis probabilities. The second instrument resets the output to for either outcome. A sampler that is given only POVM effects has insufficient information to continue an adaptive circuit.
An important unresolved-outcome example is a projective measurement with classical reporting errors. If the actual projectors are and the report obeys the confusion matrix convention , the map conditioned on report is
Thus a noisy report generally leaves a mixed conditional state. Generate the true outcome and its report if a simulation needs both, but provide only the report to an observer’s filter or controller. Collapsing directly onto the reported basis state would incorrectly turn a classical recording error into a different measurement disturbance.
For a pure projective measurement on one qubit, zero inconsistent amplitudes and normalize the surviving slice. A nearly zero-probability branch is ill-conditioned; never force it through a division by zero. Probabilities should determine which branches can actually be sampled.
Shot uncertainty
Section titled “Shot uncertainty”For independent shots, count and estimate . Multinomial covariance is
Histogram bins are anticorrelated because their probabilities sum to one. For a observable, the mean estimator has variance .
A zero count does not establish zero probability. With no observed events, a one-sided confidence bound at level is , approximately for large . This exact binomial statement is preferable to the misleading zero standard error from substituting into a Gaussian formula.
Bell-state sampling benchmark
Section titled “Bell-state sampling benchmark”For , only 00 and 11 occur, each with probability one half. Each individual qubit is random, while the parity is exactly even. Test all three facts. A simulator that samples each qubit independently from its marginal produces incorrect 01 and 10 outcomes.
For terminal measurements, evolve once and draw repeated outcomes from the same exact distribution. For adaptive circuits, conditional collapse and later gates must be simulated in sequence, as described in density-matrix circuits.
Reproducibility and correlations
Section titled “Reproducibility and correlations”Record the pseudorandom generator and seed policy. Parallel jobs must use independent streams. Repeated output from identical seeds is not an enlarged independent data set.
Samples from a slowly drifting device model or a Markov chain are correlated. Use independent runs or an appropriate effective-sample-size analysis; the ordinary formula assumes independence. When comparing two simulators, exact probability differences can reveal bias much more efficiently than comparing two noisy histograms.
Exercise
Section titled “Exercise”How many zero-event independent shots are needed for a 95% one-sided upper bound below ?
Solution
Require , or . Thus 2995 zero-event shots suffice. This conclusion applies to the specified Bernoulli event and does not automatically provide simultaneous bounds for many histogram bins.
References
Section titled “References”- Clopper, C. J., and Pearson, E. S., “The use of confidence or fiducial limits illustrated in the case of the binomial,” Biometrika 26, 404–413 (1934), doi:10.1093/biomet/26.4.404.
- Watrous, J., The Theory of Quantum Information, Cambridge University Press (2018), author’s text — measurement probabilities and quantum instruments.