beginner · Programming · Measurement & Probability in Code
Born Rule in Practice
Every time you measure a qubit, the quantum state you built — with all its amplitudes — collapses to
a single classical outcome. The Born rule is the bridge from those amplitudes to the probabilities
you can observe.
From amplitudes to probabilities
A one-qubit state is a superposition
∣ψ⟩=α∣0⟩+β∣1⟩,
where the complex numbers α and β satisfy ∣α∣2+∣β∣2=1.
Measuring in the computational basis gives outcome 0 with probability ∣α∣2 and outcome 1
with probability ∣β∣2. That is the Born rule.
For example, if α=21 and β=21 (the ∣+⟩
state), then
P(0)=212=21,P(1)=212=21.
As a less symmetric example, consider α=cos(π/6)=23 and
β=sin(π/6)=21. Then
P(0)=(23)2=43,P(1)=(21)2=41.
The probabilities sum to one, as required.
Preparing a state with Ry
The rotation gate Ry(θ) acts on ∣0⟩ as
Ry(θ)∣0⟩=cos(2θ)∣0⟩+sin(2θ)∣1⟩.
To reach α=cos(π/6) and β=sin(π/6), set θ/2=π/6, giving θ=π/3.
Applying c.ry(Math.PI / 3, 0) places the qubit in exactly this state.
Try it
Prepare the state cos(π/6)∣0⟩+sin(π/6)∣1⟩ and measure it. The grader checks
that P(0)≈3/4 and P(1)≈1/4.
Run your code to see the quantum state.
Open the Probabilities tab after running to confirm the 3:1 ratio of bar heights.
Sign in on the full site to ask questions and join the discussion.