OQCL   HomeStart Here7 SessionsTextbookProjectsQUEST LabSubmitUse CasesInstructor GuideReferences

Quantum in 7 Sessions › Session 1

1234567

Session 1 — Qubits and amplitudes

Session 1 of 7Self-studySimulator only

By the end of this session you can describe a qubit with two amplitudes, turn amplitudes into measurement probabilities, and say why phase matters even when you cannot see it in one measurement.

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

3. Worked example

Work through this with pen and paper before touching the code.

Normalize 3|0⟩ + 4i|1⟩ and find the probabilities.

  1. Squared length: |3|² + |4i|² = 9 + 16 = 25, so the length is 5.
  2. Divide by the length: |ψ⟩ = (3/5)|0⟩ + (4i/5)|1⟩.
  3. Born rule: P(0) = (3/5)² = 0.36 and P(1) = |4i/5|² = 0.64.
  4. 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

Tips

7. Check yourself

Answer each question on paper, then open the answer to compare.

  1. Why can α = 1 and β = 1 not describe a qubit without rescaling?
    Show answer

    |1|² + |1|² = 2, not 1. Divide both amplitudes by √2.

  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.

  3. 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