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
