Quantum in 7 Sessions › Session 1
Session 1 — Qubits and amplitudes
Session 1 of 7Self-studySimulator only
On this page: Read · Key ideas · Worked example · Try it · Second experiment · Common mistakes · Check yourself · Project
1. Read
Read the chapter first. The summary below is a reminder, not a replacement.
2. Key ideas
- A qubit state is written |ψ⟩ = α|0⟩ + β|1⟩. The numbers α and β are complex amplitudes.
- The Born rule turns amplitudes into probabilities: P(0) = |α|² and P(1) = |β|². A valid state has |α|² + |β|² = 1.
- Multiplying the whole state by a global phase changes nothing you can observe. A relative phase between α and β is different: it can change what later gates do.
- Two states can give identical probabilities when measured right away and still be different states.
3. Worked example
Work through this with pen and paper before touching the code.
Normalize 3|0⟩ + 4i|1⟩ and find the probabilities.
- Squared length: |3|² + |4i|² = 9 + 16 = 25, so the length is 5.
- Divide by the length: |ψ⟩ = (3/5)|0⟩ + (4i/5)|1⟩.
- Born rule: P(0) = (3/5)² = 0.36 and P(1) = |4i/5|² = 0.64.
- Check: 0.36 + 0.64 = 1.
The factor i did not affect either probability. It is a relative phase, and it will matter as soon as another gate is applied.
4. Try it
Build two states that have the same measurement probabilities but a different relative phase, and check how similar they really are. Write down what you expect before you run the code.
import numpy as np
from qiskit.quantum_info import Statevector
# A qubit state is two complex amplitudes: alpha for |0> and beta for |1>
psi = Statevector([1, 1j]) / np.sqrt(2)
print("valid state:", psi.is_valid()) # is it normalized?
print("probabilities:", psi.probabilities()) # [P(0), P(1)]
# The same probabilities, a different relative phase
phi = Statevector([1, -1j]) / np.sqrt(2)
print("probabilities:", phi.probabilities())
print("overlap |<phi|psi>|^2:", abs(phi.inner(psi)) ** 2)
Output (counts will vary slightly from run to run):
valid state: True probabilities: [0.5 0.5] probabilities: [0.5 0.5] overlap |<phi|psi>|^2: 0.0
What to notice
Both states give 50/50, so a single measurement in the computational basis cannot tell them apart. Yet their overlap is 0: they are orthogonal, as different as two quantum states can be. The difference lives entirely in the relative phase.
5. Second experiment
Check the worked example by computer, and confirm that a global phase changes nothing. Predict first.
import numpy as np
from qiskit.quantum_info import Statevector
v = np.array([3, 4j]) # not normalized: 3|0> + 4i|1>
psi = Statevector(v / np.linalg.norm(v))
print("norm of v:", np.linalg.norm(v))
print("probabilities:", psi.probabilities())
# A global phase changes nothing observable
same = Statevector(-1 * psi.data)
print("overlap with -psi:", round(abs(same.inner(psi)) ** 2, 6))
Output:
norm of v: 5.0 probabilities: [0.36 0.64] overlap with -psi: 1.0
What it shows
The computer agrees with the hand calculation: 0.36 and 0.64. Multiplying the whole state by −1 gives overlap 1, meaning it is physically the same state.
6. Common mistakes and tips
Common mistakes
- Adding amplitudes and expecting 1. It is the squared magnitudes that add to 1.
- Squaring a complex amplitude instead of taking its magnitude first: |i|² = 1, but i² = −1.
- Deciding that phase is irrelevant because it does not show up in one measurement.
Tips
- Always check normalization first. It catches most arithmetic slips.
- Keep amplitudes as long as possible and convert to probabilities only at the very end.
- Draw the two amplitudes as arrows in the complex plane. A relative phase is the angle between them.
7. Check yourself
Answer each question on paper, then open the answer to compare.
- Why can α = 1 and β = 1 not describe a qubit without rescaling?
Show answer
|1|² + |1|² = 2, not 1. Divide both amplitudes by √2.
- What information do you lose if you replace amplitudes by probabilities too early?
Show answer
The relative phase. Without it you cannot predict what happens after another gate, because interference depends on it.
- Change the second state to [1, 1j] multiplied by −1. Predict the overlap with the first state before you run it.
Show answer
The overlap is 1. Multiplying the whole state by −1 is a global phase, so it is the same physical state. The second experiment confirms it.
8. Do a project
Pick one. Each follows the routine from Guide 1: predict, run the baseline, change one variable, analyze.
← All sessionsSession 2: Measurement, gates, and interference →
For instructors: Teacher notes for Session 1