Suppose someone hands you a qubit and tells you that if you measure it, you will get 0 half the time and 1 half the time. There are two very different situations that fit that description. In one, the qubit is in a definite state that you simply do not know, like a coin that has already landed under a cup. In the other, the qubit is in a quantum superposition, and no hidden "real" answer is waiting under the cup.

Telling these two apart is a core skill in quantum mechanics, and the tool for keeping the bookkeeping straight is the density matrix.

Two preparations, one set of statistics

First, an ordinary situation. A machine prepares a qubit in the state |0⟩ or the state |1⟩, choosing each with probability 1/2 by flipping a fair coin, and does not tell you which. Each individual qubit really is in one basis state or the other. Your uncertainty is purely about missing information.

This is called a statistical mixture (or "mixed state"): an ensemble of definite quantum states, each occurring with some probability. Measuring in the computational basis {|0⟩, |1⟩} gives each outcome half the time.

Now consider a different preparation. The machine always produces the same state,

\( |+\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle) \).

This is a superposition: a single state that is a weighted sum of basis states, with complex numbers called amplitudes as the weights. By the Born rule, the probability of an outcome is the squared magnitude of its amplitude, so measuring |+⟩ in the computational basis gives 0 with probability (1/√2)² = 1/2 and 1 with probability 1/2.

In this basis, the superposition and the mixture are indistinguishable. You can try this yourself with the qubit calculator on the tools page.

Changing the question: measuring in the X basis

The difference appears when you measure along a different axis. The X basis consists of the two states

\( |+\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle), \quad |-\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle) \).

Measure the superposition |+⟩ in this basis and you get "+" every single time. The state is already an X-basis eigenstate, so the outcome is certain.

Now measure the mixture. Half the qubits are |0⟩ and half are |1⟩. Each of these can be rewritten in the X basis: |0⟩ = (|+⟩ + |−⟩)/√2 and |1⟩ = (|+⟩ − |−⟩)/√2. Either way, the probability of "+" is 1/2. So the mixture gives a 50/50 result in the X basis too.

That is the crucial asymmetry. The superposition is uncertain in one basis but perfectly certain in another. The superposition carries a definite relative phase between |0⟩ and |1⟩; the mixture carries none. In practice, the X-basis measurement is usually implemented by applying a Hadamard gate and then measuring in the computational basis.

Density matrices and coherences

A state vector cannot describe a mixture, so we need a more general object. The density matrix ρ is defined, for a mixture of states |ψᵢ⟩ with probabilities pᵢ, as

\( \rho = \sum_i p_i \, |\psi_i\rangle\langle\psi_i| \).

For a single pure state, this reduces to ρ = |ψ⟩⟨ψ|. The probability of an outcome described by a projector P is Tr(ρP), where Tr means the trace (sum of diagonal entries).

Written as 2×2 matrices in the {|0⟩, |1⟩} basis, the two preparations are:

  • Superposition |+⟩: ρ = [[1/2, 1/2], [1/2, 1/2]]
  • 50/50 mixture of |0⟩ and |1⟩: ρ = [[1/2, 0], [0, 1/2]]

The diagonal entries are the same: these are the probabilities of 0 and 1 in the computational basis, which is why that measurement cannot tell them apart. The difference sits entirely in the off-diagonal entries, called coherences. They encode the phase relationship between |0⟩ and |1⟩, and they are what make interference possible.

One subtle point: the density matrix is all that can be predicted, so different ensembles with the same ρ are physically indistinguishable. A 50/50 mixture of |0⟩ and |1⟩ gives exactly the same density matrix as a 50/50 mixture of |+⟩ and |−⟩. No experiment can tell which recipe was used.

Purity: a single number for "how quantum"

A convenient way to summarise the difference is the purity, Tr(ρ²). For any pure state it equals 1. For a mixed state it is less than 1. For a qubit the minimum is 1/2, reached by the maximally mixed state ρ = I/2.

Check the two examples. For |+⟩, ρ² = ρ (a property of any pure-state projector), so Tr(ρ²) = 1. For the mixture, ρ² = [[1/4, 0], [0, 1/4]], so Tr(ρ²) = 1/2. Purity does not depend on which basis you write the matrix in, so it captures something intrinsic about the state rather than about a particular measurement.

How superpositions become apparent mixtures

In the laboratory, superpositions rarely stay pristine. A qubit interacts with its surroundings: stray electromagnetic fields, vibrations, nearby atoms. When that happens, the qubit tends to become entangled with its environment, meaning the joint state of qubit plus environment can no longer be written as a product of separate states.

If you then look at the qubit alone, ignoring the environment (mathematically, taking the partial trace over the environment), its density matrix has smaller off-diagonal terms. In the extreme case where the environment has recorded which basis state the qubit is in, the coherences vanish and the qubit's density matrix looks exactly like the classical mixture above. This process is called decoherence.

There is an important caveat. The qubit-plus-environment system can still be in a pure, entangled state. The qubit only looks mixed because you are not tracking the environment. Such a mixture is sometimes called "improper", to distinguish it from the coin-flip kind, where the ignorance really is about which state was prepared. How much this distinction matters for interpreting quantum mechanics is debated.

The Bloch sphere: surface versus interior

Every qubit density matrix can be written as

\( \rho = \tfrac{1}{2}(I + r_x X + r_y Y + r_z Z) \),

where X, Y, Z are the Pauli matrices and r = (rₓ, r_y, r_z) is a real vector of length at most 1, called the Bloch vector. This gives a picture: the Bloch sphere.

  • Pure states have |r| = 1 and sit on the surface. |0⟩ is the north pole, |1⟩ the south pole, and |+⟩ a point on the equator.
  • Mixed states have |r| < 1 and sit in the interior. The maximally mixed state I/2 sits at the exact centre.

The purity is directly related to the length of the Bloch vector: Tr(ρ²) = (1 + |r|²)/2. The coherences correspond to the horizontal (x and y) components of r. Decoherence of the kind described above shrinks those components, pulling a point on the equator inward toward the vertical axis. A 50/50 mixture of |0⟩ and |1⟩ is the centre point, halfway between the poles.

This is why the two kinds of uncertainty look identical when measured along Z but not along X. You can drag a state around and watch its measurement probabilities change in the Bloch sphere module of the interactive lab, and look up terms such as "Bloch vector" and "partial trace" in the glossary.

Further reading

  • Michael A. Nielsen and Isaac L. Chuang, Quantum Computation and Quantum Information, Cambridge University Press, 2000 (10th anniversary edition 2010), section 2.4 on the density operator.
  • Maximilian Schlosshauer, Decoherence and the Quantum-to-Classical Transition, Springer, 2007.
  • Wojciech H. Zurek, "Decoherence, einselection, and the quantum origins of the classical", Reviews of Modern Physics 75, 715 (2003).
More from the blog Open the interactive lab