|q⟩ Bad Qubits

intermediate · Physics · Density Matrices & Mixed States

Purity and Tr(ρ²)

How "mixed" is a state? A single number answers this: the purity.

Definition

The purity of a density operator ρ\rho is

γ=Tr(ρ2).\gamma = \operatorname{Tr}(\rho^2).

It ranges between two bounds set by the dimension dd of the Hilbert space:

1dTr(ρ2)1.\frac{1}{d} \le \operatorname{Tr}(\rho^2) \le 1.

The two extremes have clean meanings:

For a single qubit (d=2d = 2), purity runs from 1/21/2 (maximally mixed) up to 11 (pure).

Why purity detects mixedness

Use the spectral decomposition ρ=kλkkk\rho = \sum_k \lambda_k |k\rangle\langle k|. Then ρ2=kλk2kk\rho^2 = \sum_k \lambda_k^2 |k\rangle\langle k|, so

Tr(ρ2)=kλk2.\operatorname{Tr}(\rho^2) = \sum_k \lambda_k^2.

The eigenvalues form a probability distribution (λk0\lambda_k \ge 0, kλk=1\sum_k \lambda_k = 1). A pure state has one eigenvalue equal to 11 and the rest 00, giving kλk2=1\sum_k \lambda_k^2 = 1. Spreading the distribution out lowers kλk2\sum_k \lambda_k^2 — it is minimized when all dd eigenvalues equal 1/d1/d, giving d(1/d)2=1/dd \cdot (1/d)^2 = 1/d. So purity is large when probability is concentrated (little classical uncertainty) and small when it is spread (much classical uncertainty).

A direct test for purity

The relation Tr(ρ2)=1    ρ2=ρ\operatorname{Tr}(\rho^2) = 1 \iff \rho^2 = \rho gives a quick check: a density operator is pure exactly when it is idempotent, ρ2=ρ\rho^2 = \rho (it is then a projector onto a single ket). Any deviation of Tr(ρ2)\operatorname{Tr}(\rho^2) below 11 signals genuine mixedness.

Try it

Compute the purity Tr(ρ2)\operatorname{Tr}(\rho^2) of the mixed state ρ=1200+12++=(3/41/41/41/4)\rho = \tfrac12|0\rangle\langle0| + \tfrac12|+\rangle\langle+| = \begin{pmatrix}3/4 & 1/4\\ 1/4 & 1/4\end{pmatrix}. You should get a value strictly between 1/21/2 and 11, confirming the state is mixed but not maximally so.

Run your code to see the quantum state.

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