AnyLearn
All lessons
Scienceintermediate

Qubits: superposition, measurement, and entanglement

What a qubit actually is, why measurement destroys superposition, how entanglement links qubits, and how the quantum circuit model turns these ingredients into computation.

Updated · AI-authored, review-gated · how lessons are made

Not signed in: your progress and quiz score won't be saved.
Progress1 / 9

A bit that lives on a sphere

A classical bit is 0 or 1. A qubit is a two-level quantum system whose state is a combination of both:

ψ=α0+β1|\psi\rangle = \alpha|0\rangle + \beta|1\rangle

Here α\alpha and β\beta are complex numbers called amplitudes, with α2+β2=1|\alpha|^2 + |\beta|^2 = 1. The squared magnitudes are probabilities: measure the qubit and you get 0 with probability α2|\alpha|^2, or 1 with probability β2|\beta|^2.

Two things make this more than a fancy coin flip. First, amplitudes can be negative or complex, so they can cancel each other, something probabilities can never do. Second, before measurement, the qubit genuinely occupies this combined state, and a computation can act on both components at once. A useful mental picture: every pure qubit state is a point on a sphere (the Bloch sphere), with 0|0\rangle at the north pole and 1|1\rangle at the south.

Full lesson text

All 9 steps on one page, for reading, reference, and search.

Show

1. A bit that lives on a sphere

A classical bit is 0 or 1. A qubit is a two-level quantum system whose state is a combination of both:

ψ=α0+β1|\psi\rangle = \alpha|0\rangle + \beta|1\rangle

Here α\alpha and β\beta are complex numbers called amplitudes, with α2+β2=1|\alpha|^2 + |\beta|^2 = 1. The squared magnitudes are probabilities: measure the qubit and you get 0 with probability α2|\alpha|^2, or 1 with probability β2|\beta|^2.

Two things make this more than a fancy coin flip. First, amplitudes can be negative or complex, so they can cancel each other, something probabilities can never do. Second, before measurement, the qubit genuinely occupies this combined state, and a computation can act on both components at once. A useful mental picture: every pure qubit state is a point on a sphere (the Bloch sphere), with 0|0\rangle at the north pole and 1|1\rangle at the south.

2. Superposition is not "both at once" in the cartoon sense

The popular phrase "a qubit is 0 and 1 at the same time" hides the real mechanism. A superposition is a precise vector, not a fog of indecision. The state 12(0+1)\tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle) and the state 12(01)\tfrac{1}{\sqrt{2}}(|0\rangle - |1\rangle) both give 50/50 measurement outcomes, yet they are as different as two states can be: a single gate maps one to 0|0\rangle and the other to 1|1\rangle, deterministically.

That minus sign is a relative phase, and it is the raw material of quantum algorithms. Computations are choreographed so that amplitudes leading to wrong answers interfere destructively (cancel) while amplitudes leading to right answers interfere constructively (add up). Quantum speedups, when they exist, come from this interference structure, not from "trying every answer in parallel and picking the best one." That reading would be too good to be true, and it is.

3. Measurement: the destructive readout

Measurement is where the quantum world hands you a classical answer, and it charges a toll. When you measure a qubit in the standard basis:

  • You get a single classical bit, 0 or 1, at random with probabilities α2|\alpha|^2 and β2|\beta|^2.
  • The state collapses to whatever you observed. The amplitudes, including all phase information, are gone.
  • Repeating the measurement gives the same answer again; the superposition does not come back.

This is why a quantum computer with nn qubits is not a magic 2n2^n-answer machine. The state before measurement does involve up to 2n2^n amplitudes, but a measurement extracts only nn classical bits from it. The art of algorithm design is arranging the computation so that the few bits you can read out are the ones worth reading.

Measurement also explains why you cannot peek at a qubit mid-computation to debug it: looking is an operation, and it destroys the state you wanted to inspect.

4. Gates: rotations, not switches

Classical logic gates flip bits. Quantum gates rotate state vectors. Every single-qubit gate is a unitary matrix, a rotation of the Bloch sphere that preserves total probability. The workhorses:

  • X (the quantum NOT): swaps 01|0\rangle \leftrightarrow |1\rangle.
  • Z: flips the sign of 1|1\rangle's amplitude, a pure phase change, invisible to a standard-basis measurement but crucial for interference.
  • H (Hadamard): turns 0|0\rangle into an equal superposition 12(0+1)\tfrac{1}{\sqrt{2}}(|0\rangle + |1\rangle), and back. It is the standard way in and out of superposition.

Because unitaries are reversible, quantum computation is reversible until measurement: no gate ever erases information. A common gotcha: applying H twice returns the original state exactly (H2=IH^2 = I). Superposition is not something you "add more of" by repeating the gate; it is a specific rotation you can also undo.

5. Entanglement: correlations with no classical explanation

Bring in a second qubit and something new appears. Apply H to the first qubit, then a CNOT (flip the second qubit if the first is 1), starting from 00|00\rangle:

00H12(00+10)CNOT12(00+11)|00\rangle \xrightarrow{H} \tfrac{1}{\sqrt{2}}(|00\rangle + |10\rangle) \xrightarrow{CNOT} \tfrac{1}{\sqrt{2}}(|00\rangle + |11\rangle)

This is a Bell state. Neither qubit alone has a definite state, yet their measurement outcomes are perfectly correlated: both 0 or both 1, each with probability one half, no matter how far apart they are.

Two boundaries keep this honest. First, entanglement does not transmit information; the outcomes are random on each side, so no signal travels. Second, the no-cloning theorem: an unknown quantum state cannot be copied. That single fact shapes everything downstream, from why error correction must be clever (you cannot back up a qubit) to why quantum key distribution can detect eavesdroppers.

6. The circuit model at a glance

A quantum program is a circuit: qubits start in 0|0\rangle, flow through gates, and end in measurements that produce classical bits. Everything before the measurement layer is reversible.

flowchart LR
  A["Initialize qubits in state 0"] --> B["Single-qubit gates: X, Z, H, rotations"]
  B --> C["Two-qubit gates: CNOT creates entanglement"]
  C --> D["Interference: amplitudes cancel or reinforce"]
  D --> E["Measurement: classical bits out"]
  E --> F["Classical post-processing"]

7. Simulate a Bell state in twelve lines

The state of nn qubits is a vector of 2n2^n amplitudes, so small circuits are easy to simulate. This is the Bell-state circuit from earlier, in plain NumPy:

import numpy as np

ket00 = np.array([1, 0, 0, 0], dtype=complex)  # |00>

H = (1 / np.sqrt(2)) * np.array([[1, 1], [1, -1]])
I = np.eye(2)
H_on_first = np.kron(H, I)          # H acts on qubit 1 only

CNOT = np.array([[1, 0, 0, 0], [0, 1, 0, 0],
                 [0, 0, 0, 1], [0, 0, 1, 0]])

state = CNOT @ (H_on_first @ ket00)
print(np.round(state, 3))           # [0.707 0. 0. 0.707]
print(np.abs(state) ** 2)           # [0.5 0. 0. 0.5]

The output amplitudes sit on 00|00\rangle and 11|11\rangle only: measure and you get 00 or 11, never 01 or 10. The exponential catch is visible too: at 40 qubits the state vector would hold 2402^{40} complex numbers, roughly 17 terabytes. That blow-up is precisely why classical simulation runs out of road.

8. Where the power comes from, and where it does not

It is worth separating the true sources of quantum advantage from the myths:

ClaimVerdict
"Tries all answers in parallel"Misleading. You can only read out nn bits.
"Interference filters wrong answers"Correct. This is the actual mechanism.
"Entanglement enables faster-than-light signals"False. Outcomes are random locally.
"Exponentially large state space"Necessary but not sufficient; classical probability distributions are exponentially large too.
"Speedups on every problem"False. Advantage is problem-specific.

The honest summary: qubits carry amplitudes that can cancel; gates choreograph that cancellation; entanglement makes the state space impossible to factor into independent pieces; and measurement forces you to design algorithms whose answers survive the collapse. Problems with the right structure (period finding, unstructured search, simulating quantum systems) admit real speedups. Problems without it gain nothing.

9. The fragility problem, and what comes next

Everything above assumed perfect qubits. Real ones are noisy: stray electromagnetic fields, temperature fluctuations, and imperfect control pulses continuously nudge the amplitudes. This decay of quantum information is called decoherence, and it happens fast, microseconds to seconds depending on the hardware.

Worse, errors in a quantum computer are continuous. A classical bit either flips or it does not; a qubit can rotate by any tiny angle, and tiny errors accumulate. And because of no-cloning, you cannot fix this by keeping backup copies.

These constraints define the next two lessons in this path. First: how physicists actually build qubits (superconducting circuits, trapped ions, neutral atoms, photons) and the trade-offs each platform makes between speed, fidelity, and scale. Then: quantum error correction, the remarkable trick that encodes one logical qubit across many physical ones, detects errors without measuring the data, and is now the central engineering race of the field.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. A qubit is in state (1/√2)(|0⟩ + |1⟩). What happens when you measure it in the standard basis?
    • You learn both amplitudes exactly
    • You get 0 or 1 with equal probability, and the state collapses to the observed value
    • You get a value between 0 and 1
    • The qubit stays in superposition but reports 0
  2. What distinguishes the states (1/√2)(|0⟩ + |1⟩) and (1/√2)(|0⟩ − |1⟩)?
    • Nothing; they are physically identical
    • The second has lower total probability
    • A relative phase, which measurement in the standard basis cannot see but gates can exploit for interference
    • The second one is entangled
  3. Why is the claim "a quantum computer tries all answers in parallel and outputs the best one" wrong?
    • Superposition only holds two values at most
    • Quantum computers cannot represent multiple values
    • Parallelism only works for entangled qubits
    • Measurement returns only n classical bits; algorithms must use interference so the readable bits encode the answer
  4. Which statement about the Bell state (1/√2)(|00⟩ + |11⟩) is TRUE?
    • Measurement outcomes on the two qubits are perfectly correlated, but no information is transmitted between them
    • Measuring one qubit sends a signal to the other
    • Each qubit individually is in the definite state |0⟩
    • The state can be cloned to preserve it against noise
  5. What does the no-cloning theorem state?
    • Two qubits can never be in the same state
    • An unknown quantum state cannot be copied
    • Measurement can be undone by a second measurement
    • Entangled qubits cannot be separated

Related lessons