Density Matrices
The density operator generalizes the state vector to describe statistical mixtures, subsystems, and open-system dynamics.
Beyond the state vector
A pure state |psi> captures maximal knowledge, but we often face a probabilistic ensemble of states or a subsystem of a larger entangled whole. The density matrix rho handles both. For an ensemble that yields |psi_i> with probability p_i, rho = sum_i p_i |psi_i> The Born rule takes the uniform form p(a) = Tr(P_a rho) and expectation values are = Tr(A rho). Time evolution of a closed system is rho -> U rho U-dagger. Because these are all trace expressions, the density matrix is the natural language whenever classical uncertainty and quantum superposition coexist. The purity Tr(rho^2) cleanly separates the two: the equal superposition |+> is pure, while the maximally mixed state I/2 has purity 1/d = 1/2. There are two routes to a mixed rho: classical ignorance about which pure state was prepared, and tracing out an entangled partner. Remarkably, these are operationally indistinguishable from the local point of view. A subsystem of an entangled pure state is described by a proper mixed state even though the global state is pure, a fact formalized by purification and the partial trace.Defining properties
Everything observable is a trace
import numpy as np
plus = np.array([1,1])/np.sqrt(2)
rho_pure = np.outer(plus, plus.conj())
rho_mix = 0.5*np.eye(2) # maximally mixed
print(np.trace(rho_pure@rho_pure)) # 1.0 pure
print(np.trace(rho_mix@rho_mix)) # 0.5 mixedWhere mixed states come from