Purity and Linear Entropy
Purity and linear entropy are simple quadratic measures of how far a state is from pure, useful when logarithms are inconvenient.
Purity
The purity of a density matrix is P = Tr(rho^2). It equals the sum of squared eigenvalues. Because eigenvalues are nonnegative and sum to one, purity ranges from 1/d (maximally mixed in dimension d) up to 1 (pure). Purity is basis-independent, cheap to estimate, and monotone under a broad class of mixing operations, making it a workhorse diagnostic.
Linear entropy
The linear entropy is S_L = (d/(d-1)) (1 - Tr(rho^2)) for a normalized version, or simply 1 - Tr(rho^2) in the unnormalized convention. It is the first-order Taylor approximation of the von Neumann entropy, obtained by replacing log rho with rho - I. It vanishes for pure states and grows with mixedness, tracking the same information as purity without a logarithm.
import numpy as np
def purity(rho): return np.real(np.trace(rho@rho))
def linear_entropy(rho): return 1 - purity(rho)
rho = np.diag([0.7, 0.3])
print(purity(rho), linear_entropy(rho)) # 0.58, 0.42
Why quadratic measures are convenient
Tr(rho^2) is a polynomial in the state, so it can be measured without full tomography. The swap test estimates Tr(rho sigma) directly, and setting sigma = rho gives purity from the overlap of two copies. Randomized-measurement protocols estimate Tr(rho^2) from classical shadows. By contrast, von Neumann entropy requires the full eigenvalue spectrum and is harder to access experimentally.
Relation to entanglement
For a bipartite pure state, the purity of a reduced density matrix is a direct entanglement witness: reduced purity equals one exactly when the state is a product, and drops toward 1/d as entanglement grows. The linear entropy of the reduced state is then a valid entanglement measure for pure states, closely tied to concurrence for two qubits. This makes purity a practical entry point for quantifying correlations.