|q⟩ Bad Qubits

beginner · Programming · The Qubit State Vector & Dirac Notation

Checkpoint: Describe Any Single Qubit

Throughout this module you have built three separate tools: writing states as kets, converting between kets and column vectors, computing inner products, and reading off measurement probabilities via the Born rule. A checkpoint lesson asks you to use all of them in a single coherent task — fully specifying a one-qubit state and then building it.

What "fully specifying" a single qubit means

A general single-qubit state is any normalized complex superposition:

ψ=α0+β1,α,βC,α2+β2=1.|\psi\rangle = \alpha|0\rangle + \beta|1\rangle, \qquad \alpha,\beta \in \mathbb{C}, \quad |\alpha|^2 + |\beta|^2 = 1.

"Fully specifying" means giving both amplitudes in a form from which you can:

  1. Read off measurement probabilitiesP(0)=α2P(0) = |\alpha|^2 and P(1)=β2P(1) = |\beta|^2 by the Born rule.
  2. Write the column vector — stack α\alpha on top of β\beta.
  3. Identify the state on the Bloch sphere — every pure state sits on the unit sphere parameterized by two real angles θ[0,π]\theta \in [0, \pi] and ϕ[0,2π)\phi \in [0, 2\pi):
ψ=cos ⁣θ20+eiϕsin ⁣θ21.|\psi\rangle = \cos\!\tfrac{\theta}{2}\,|0\rangle + e^{i\phi}\sin\!\tfrac{\theta}{2}\,|1\rangle.
  1. Prepare it in a circuit — the rotation gates Ry(θ)R_y(\theta) and Rz(ϕ)R_z(\phi) realize exactly this parameterization.

Working a concrete example

Consider the state

ψ=320+121.|\psi\rangle = \frac{\sqrt{3}}{2}|0\rangle + \frac{1}{2}|1\rangle.

Step 1 — check normalization.

322+122=34+14=1.\left|\frac{\sqrt{3}}{2}\right|^2 + \left|\frac{1}{2}\right|^2 = \frac{3}{4} + \frac{1}{4} = 1. \checkmark

Step 2 — read probabilities.

P(0)=34,P(1)=14.P(0) = \frac{3}{4}, \qquad P(1) = \frac{1}{4}.

Step 3 — locate on the Bloch sphere. Matching to the standard form cos(θ/2)0+eiϕsin(θ/2)1\cos(\theta/2)|0\rangle + e^{i\phi}\sin(\theta/2)|1\rangle with a real, positive amplitude on 1|1\rangle (so ϕ=0\phi = 0):

cos ⁣θ2=32    θ2=π6    θ=π3.\cos\!\tfrac{\theta}{2} = \frac{\sqrt{3}}{2} \implies \frac{\theta}{2} = \frac{\pi}{6} \implies \theta = \frac{\pi}{3}.

The state is at polar angle θ=π/3\theta = \pi/3 on the Bloch sphere, between the north pole 0|0\rangle (θ=0\theta = 0) and the equator +|+\rangle (θ=π/2\theta = \pi/2).

Step 4 — build it with a gate. The YY-rotation gate acts on 0|0\rangle as

Ry(θ)0=cos ⁣θ20+sin ⁣θ21,R_y(\theta)|0\rangle = \cos\!\tfrac{\theta}{2}\,|0\rangle + \sin\!\tfrac{\theta}{2}\,|1\rangle,

so Ry(π/3)R_y(\pi/3) applied to the default state 0|0\rangle produces exactly ψ|\psi\rangle.

Try it

Use the four steps above to prepare the state ψ=320+121|\psi\rangle = \tfrac{\sqrt{3}}{2}|0\rangle + \tfrac{1}{2}|1\rangle in a one-qubit circuit. The grader checks the full state vector, so returning an unmodified circuit will not pass.

Run your code to see the quantum state.

After running, the State Vector panel should show amplitudes of approximately 0.8660.866 for 0|0\rangle and 0.5000.500 for 1|1\rangle, matching 320.866\frac{\sqrt{3}}{2} \approx 0.866 and 12=0.500\frac{1}{2} = 0.500.

Sign in on the full site to ask questions and join the discussion.