Library / Circuits / sampling

Sampling

A shot is one classical bitstring drawn from the measurement distribution. A Lumen sample is a multiset of shots plus the exact distribution when the engine still has it. Confusing the two is the usual way a backtest lies.

Documents on this site

Drawing

State draws from the exact |α_b|² using a prefix sum. Weave draws by contracting projectors for a sequential bit decision, one bit at a time, which is exact for the computational distribution and does not need the full vector. Drift draws from the diagonal of ρ. Trace does not sample in 1.0 because it never built a distribution, only an expectation.

The seed is part of the request. The same seed, circuit, and engine version return the same shots. A missing seed is filled by the server and echoed, so a result can be replayed.

What to publish

A research note that quotes a probability from 200 shots should quote the count and the interval, or quote the exact probability from reference mode. Lumen’s sample payload includes both when the engine computed the exact weights anyway. Hiding the exact weight to make a figure look noisy is a presentation choice outside the API.

Rare bitstrings are not truncated from the exact distribution. They may be absent from a short sample. The payload distinguishes ‘count zero’ from ‘probability reported as zero’.

  • Maximum shots per call is a deployment quota, returned in the account profile.
  • Bitstrings are printed with wire 0 as the rightmost character, matching the index convention.
  • Marginals are a separate query. They are not estimated by discarding columns of a sample unless the caller asks for that estimator.