liveBook · Manning

State collapse

As explained in Building Quantum Software with Python

State collapse is the post-measurement transition in which the measured outcome has probability one and all other outcomes have probability zero.

State collapse is the post-measurement transition of a quantum state: one measured outcome remains with probability one, while every other outcome has probability zero. Before measurement, outcomes are represented by a probability distribution; measurement selects one outcome according to that distribution. section 1.4.3 section 3.4

A single-qubit measurement

A single-qubit state with outcome probabilities 0.71651 for 0 and 0.28349 for 1 behaves like a biased coin. If measurement returns 1, the state collapses so that outcome 1 has amplitude 1. Repeating the circuit produces different outcomes, while larger sample sets approach the original probabilities. section 3.4

from random import choices
from collections import Counter

samples = choices(range(len(s)), [abs(s[k])**2 for k in range(len(s))], k=10) #1
print(samples)

A Python simulator samples measurement outcomes from squared amplitude magnitudes, making collapse observable as a list of discrete results. section 3.4

How Building Quantum Software with Python covers it

How deep it goes
Defines collapse through amplitudes and sampling, but stops short of deriving the measurement postulate formally.
Examples
Uses biased-coin intuition, single-qubit probabilities, Python samples, and outcome counts from repeated measurements.
What it assumes
Assumes familiarity with single-qubit states and probability distributions while introducing measurement behavior through computation.
What you can do after
Apply it via Python's random.choices to simulate measurement samples from state amplitudes.
How it connects
Connects quantum state, measurement, amplitudes, probability distributions, and repeated circuit executions.

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.