Library / Circuits / amplitudes

Amplitudes

An amplitude is a complex weight on a basis bitstring. A probability is the squared modulus. A measurement in Lumen Lattice is a declared query against those weights, not a hidden side effect of running a gate.

Documents on this site

From amplitude to probability

For a pure state the probability of bitstring b is |α_b|². For a density operator it is the diagonal entry ⟨b|ρ|b⟩. The product pages that return ‘probability’ always state which object they used. Callers who add amplitudes and then square have left the contract; the API will not do that for them.

Shot noise is separate from numerical error. A sample of S shots estimates a probability with a binomial width √(p(1−p)/S). Lumen returns counts and S, not a pretended exact frequency. Reference mode can also return the exact probability beside the sample so a test can see the gap.

Bases

Computational-basis measurement is the default. An X-basis measurement is specified as a layer of Hadamards on the measured wires followed by a computational query, and the API has a shorthand that inserts those Hadamards without mutating the stored circuit. The stored circuit remains what the caller wrote. The query is a view.

Mid-circuit measurement collapses the State buffer and conditions later gates. Weave represents the same event by splitting the contraction into the two branches and weighting them. Trace does not support mid-circuit measurement in 1.0; the router says so before it spends the call.

  • Unmeasured wires stay coherent for later queries in the same session.
  • A session that mixes exact expectations and shots records both in the transcript.
  • Reset after measurement is explicit. Implicit reset is not part of 1.0.

Global phase and relative phase

Probabilities ignore global phase. Interference inside a superposition does not. Two circuits that differ by a trailing Z on an unmeasured wire can share every Z-basis probability and differ on an X-basis probability. Data-T tests treat that pair as different objects. Documentation that collapses them is wrong for this product.