liveBook · Manning

Quantum measurement

As explained in Building Quantum Software with Python

Quantum measurement is the process of obtaining a classical outcome from a quantum system according to its state's probabilities, generally changing the state.

Quantum measurement converts a quantum computation into one classical outcome. The outcome is nondeterministic, but it is selected from a defined probability distribution encoded by the quantum state. A result is commonly represented as a binary string, optionally interpreted as an integer. section 1.3.2 section 1.4.3

Figure 1.14 The steps of a quantum computation using three qubits. During the computation, we can change the probabilities by applying quantum computing instructions. When a measurement is performed, we get one outcome according to the encoded probabilities.
figure

A computation first changes outcome probabilities, then measurement selects one outcome. Measurement is the only available data from the computation; afterward, the measured outcome has probability 1 and all others have probability 0. section 1.4.4

One execution produces one sample, not a complete view of the state. Repeating the same computation produces counts whose frequencies reflect the encoded outcome probabilities. This makes measurement useful when the goal is to sample a probability distribution or identify outcomes made more likely by earlier operations. section 1.5.1 section 2.2

For a qubit-based computation:

  • A single qubit measures as 0 or 1; a system of n qubits measures as an n-bit string. section 1.4.3
  • The initial all-zero state measures as 000…0 with 100% probability until operations change its state. section 1.4.3
  • The probability of desired outcomes can be increased before measurement, so repeated runs favor useful selections. section 2.2 section 2.3.2

Simulating repeated single-qubit measurements

A simulated state assigns probability 0.71651 to outcome 0 and 0.28349 to outcome 1. Python's random.choices can draw samples using squared amplitude magnitudes as weights. Ten samples yield counts such as 0 → 7 and 1 → 3; 1,000 samples yield frequencies closer to the encoded probabilities. section 3.4

Measurement supports three reusable quantum-computing patterns: sampling from probability distributions, searching for desired outcomes after amplitude amplification, and estimating probabilities of selected outcomes. Its value depends on how the state was prepared and how the resulting counts are interpreted for the problem. section 1.6 section 12.1.2

How Building Quantum Software with Python covers it

How deep it goes
Explains outcomes, repeated-run frequencies, state collapse, and Python sampling without deriving measurement mechanics.
Examples
Uses outcome wheels, multi-qubit binary strings, a knapsack search, and Python samples from a single-qubit state.
What it assumes
Assumes or refreshes binary strings, probabilities, complex numbers, and basic trigonometry rather than quantum-mechanics knowledge.
What you can do after
Apply it via Python sampling and repeated quantum runs to collect and interpret outcome counts.
How it connects
Connects quantum measurement with quantum state, amplitudes, probability distributions, quantum parallelism, and amplitude amplification.

Also explained in

Compare how 2 books explain quantum measurement →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Quantum Software with Python. The section links point to the parts of the book it draws on.