The Density Matrix and the Liouville Equation
The density matrix is a generalization of the state vector that allows graceful handling of ensemble averages and relaxation effects. For a single atom with state vector , we define the density operator by .
Evidently, the diagonal matrix elements of the density operator are the probabilities of the corresponding states (here the states 1 and 2). The off-diagonal matrix elements are known as coherences.
We can retrace the example given in "The State Vector and the Schrödinger Equation" in terms of the density-matrix elements rather than the state-vector amplitudes. The equation governing the evolution of the density matrix, , known as the Liouville equation, can be derived directly from the Schrödinger equation.
The function DensityMatrix forms the density matrix for an atomic system.
If instead of a single atom, we are interested in averages over an ensemble of atoms, each with state vector |ψi〉, we simply work with the averaged density matrix: .