Matrix describing a quantum system in a pure or mixed state
In quantum mechanics, a density matrix (or density operator) is a matrix that describes an ensemble of physical systems as quantum states (even if the ensemble contains only one system). It allows for the calculation of the probabilities of the outcomes of any measurements performed upon the systems of the ensemble using the Born rule. It is a generalization of the more usual state vectors or wavefunctions: while those can only represent pure states, density matrices can also represent "mixed ensembles" (sometimes ambiguously called "mixed states"). Mixed ensembles arise in quantum mechanics in two different situations:
Density matrices are thus crucial tools in areas of quantum mechanics that deal with mixed ensembles, such as quantum statistical mechanics, open quantum systems and quantum information.
Definition and motivation.
The density matrix is a representation of a linear operator called the density operator. The density matrix is obtained from the density operator by a choice of an orthonormal basis in the underlying space. In practice, the terms "density matrix" and "density operator" are often used interchangeably.
Pick a basis with states formula_1, formula_2 in a two-dimensional Hilbert space, then the density operator is represented by the matrix
formula_3 
where the diagonal elements are real numbers that sum to one (also called populations of the two states formula_1, formula_2). 
The off-diagonal elements are complex conjugates of each other (also called coherences); they are restricted in magnitude by the requirement that formula_6 be a positive semi-definite operator, see below.
A density operator is a positive semi-definite, self-adjoint operator of trace one acting on the Hilbert space of the system. This definition can be motivated by considering a situation where some pure states formula_7 (which are not necessarily orthogonal) are prepared with probability formula_8 each. This is known as an "ensemble" of pure states. The probability of obtaining projective measurement result formula_9 when using projectors formula_10 is given by99
formula_11
which makes the density operator, defined as 
formula_12
a convenient representation for the state of this ensemble. It is easy to check that this operator is positive semi-definite, self-adjoint, and has trace one. Conversely, it follows from the spectral theorem that every operator with these properties can be written as formula_13 for some states formula_14 and coefficients formula_8 that are non-negative and add up to one.102 However, this representation will not be unique, as shown by the Schrödinger–HJW theorem.
Another motivation for the definition of density operators comes from considering local measurements on entangled states. Let formula_16 be a pure entangled state in the composite Hilbert space formula_17. The probability of obtaining measurement result formula_9 when measuring projectors formula_10 on the Hilbert space formula_20 alone is given by107
formula_21
where formula_22 denotes the partial trace over the Hilbert space formula_23. This makes the operator 
formula_24
a convenient tool to calculate the probabilities of these local measurements. It is known as the reduced density matrix of formula_16 on subsystem 1. It is easy to check that this operator has all the properties of a density operator. Conversely, the Schrödinger–HJW theorem implies that all density operators can be written as formula_26 for some state formula_27.
Pure and mixed states.
A pure quantum state is a state that can not be written as a probabilistic mixture, or convex combination, of other quantum states. There are several equivalent characterizations of pure states in the language of density operators. A density operator represents a pure state if and only if:
It is important to emphasize the difference between a probabilistic mixture (i.e. an ensemble) of quantum states and the superposition of two states. If an ensemble is prepared to have half of its systems in state formula_32 and the other half in formula_33, it can be described by the density matrix: 
 formula_34
where formula_32 and formula_33 are assumed orthogonal and of dimension 2, for simplicity. On the other hand, a quantum superposition of these two states with equal probability amplitudes results in the pure state formula_37 with density matrix 
 formula_38
Unlike the probabilistic mixture, this superposition can display quantum interference.
 Geometrically, the set of density operators is a convex set, and the pure states are the extremal points of that set. The simplest case is that of a two-dimensional Hilbert space, known as a qubit. An arbitrary mixed state for a qubit can be written as a linear combination of the Pauli matrices, which together with the identity matrix provide a basis for formula_39 self-adjoint matrices:
 formula_40
where the real numbers formula_41 are the coordinates of a point within the unit ball and
 formula_42
Points with formula_43 represent pure states, while mixed states are represented by points in the interior. This is known as the Bloch sphere picture of qubit state space.
Example: light polarization.
An example of pure and mixed states is light polarization. An individual photon
can be described as having right or left circular polarization, described by the orthogonal quantum states formula_44 and formula_45 or a superposition of the two: it can be in any state formula_46 (with formula_47), corresponding to linear, circular, or elliptical polarization. Consider now a vertically polarized photon, described by the state formula_48. If we pass it through a circular polarizer that allows either only formula_44 polarized light, or only formula_45 polarized light, half of the photons are absorbed in both cases. This may make it "seem" like half of the photons are in state formula_44 and the other half in state formula_45, but this is not correct: if we pass formula_53 through a linear polarizer there is no absorption whatsoever, but if we pass either state formula_44 or formula_45 half of the photons are absorbed.
Unpolarized light (such as the light from an incandescent light bulb) cannot be described as "any" state of the form formula_46 (linear, circular, or elliptical polarization). Unlike polarized light, it passes through a polarizer with 50% intensity loss whatever the orientation of the polarizer; and it cannot be made polarized by passing it through any wave plate. However, unpolarized light "can" be described as a statistical ensemble, e. g. as each photon having either formula_44 polarization or formula_45 polarization with probability 1/2. The same behavior would occur if each photon had either vertical polarization formula_59 or horizontal polarization formula_60 with probability 1/2. These two ensembles are completely indistinguishable experimentally, and therefore they are considered the same mixed state. For this example of unpolarized light, the density operator equals
 formula_61
There are also other ways to generate unpolarized light: one possibility is to introduce uncertainty in the preparation of the photon, for example, passing it through a birefringent crystal with a rough surface, so that slightly different parts of the light beam acquire different polarizations. Another possibility is using entangled states: a radioactive decay can emit two photons traveling in opposite directions, in the quantum state formula_62. The joint state of the two photons "together" is pure, but the density matrix for each photon individually, found by taking the partial trace of the joint density matrix, is completely mixed.
Equivalent ensembles and purifications.
A given density operator does not uniquely determine which ensemble of pure states gives rise to it; in general there are infinitely many different ensembles generating the same density matrix. Those cannot be distinguished by any measurement. The equivalent ensembles can be completely characterized: let formula_63 be an ensemble. Then for any complex matrix formula_64 such that formula_65 (a partial isometry), the ensemble formula_66 defined by
 formula_67
will give rise to the same density operator, and all equivalent ensembles are of this form.
A closely related fact is that a given density operator has infinitely many different purifications, which are pure states that generate the density operator when a partial trace is taken. Let 
 formula_68
be the density operator generated by the ensemble formula_63, with states formula_7 not necessarily orthogonal. Then for all partial isometries formula_64 we have that
 formula_72
is a purification of formula_73, where formula_74 is an orthogonal basis, and furthermore all purifications of formula_73 are of this form.
Measurement.
Let formula_76 be an observable of the system, and suppose the ensemble is in a mixed state such that each of the pure states formula_77 occurs with probability formula_8. Then the corresponding density operator equals
 formula_79
The expectation value of the measurement can be calculated by extending from the case of pure states:
 formula_80
where formula_81 denotes trace. Thus, the familiar expression formula_82 for pure states is replaced by
 formula_83
for mixed states.
Moreover, if formula_76 has spectral resolution
 formula_85
where formula_86 is the projection operator into the eigenspace corresponding to eigenvalue formula_87, the post-measurement density operator is given by
 formula_88
when outcome "i" is obtained. In the case where the measurement result is not known the ensemble is instead described by
 formula_89
If one assumes that the probabilities of measurement outcomes are linear functions of the projectors formula_86, then they must be given by the trace of the projector with a density operator. Gleason's theorem shows that in Hilbert spaces of dimension 3 or larger the assumption of linearity can be replaced with an assumption of non-contextuality. This restriction on the dimension can be removed by assuming non-contextuality for POVMs as well, but this has been criticized as physically unmotivated.
Entropy.
The von Neumann entropy formula_91 of a mixture can be expressed in terms of the eigenvalues of formula_73 or in terms of the trace and logarithm of the density operator formula_73. Since formula_73 is a positive semi-definite operator, it has a spectral decomposition such that formula_95, where formula_96 are orthonormal vectors, formula_97, and formula_98. Then the entropy of a quantum system with density matrix formula_73 is
 formula_100
This definition implies that the von Neumann entropy of any pure state is zero. If formula_101 are states that have support on orthogonal subspaces, then the von Neumann entropy of a convex combination of these states,
 formula_102
is given by the von Neumann entropies of the states formula_101 and the Shannon entropy of the probability distribution formula_104:
 formula_105
When the states formula_101 do not have orthogonal supports, the sum on the right-hand side is strictly greater than the von Neumann entropy of the convex combination formula_73.
Given a density operator formula_73 and a projective measurement as in the previous section, the state formula_109 defined by the convex combination
 formula_110
which can be interpreted as the state produced by performing the measurement but not recording which outcome occurred, has a von Neumann entropy larger than that of formula_73, except if formula_112. It is however possible for the formula_109 produced by a "generalized" measurement, or POVM, to have a lower von Neumann entropy than formula_73.
Von Neumann equation for time evolution.
Just as the Schrödinger equation describes how pure states evolve in time, the von Neumann equation (also known as the Liouville–von Neumann equation) describes how a density operator evolves in time. The von Neumann equation dictates that
 formula_115
where the brackets denote a commutator.
This equation only holds when the density operator is taken to be in the Schrödinger picture, even though this equation seems at first look to emulate the Heisenberg equation of motion in the Heisenberg picture, with a crucial sign difference:
 formula_116
where formula_117 is some "Heisenberg picture" operator; but in this picture the density matrix is "not time-dependent", and the relative sign ensures that the time derivative of the expected value formula_118 comes out "the same as in the Schrödinger picture".
If the Hamiltonian is time-independent, the von Neumann equation can be easily solved to yield
 formula_119
For a more general Hamiltonian, if formula_120 is the wavefunction propagator over some interval, then the time evolution of the density matrix over that same interval is given by
 formula_121
Wigner functions and classical analogies.
The density matrix operator may also be realized in phase space. Under the Wigner map, the density matrix transforms into the equivalent Wigner function,
 formula_122
The equation for the time evolution of the Wigner function, known as Moyal equation, is then the Wigner-transform of the above von Neumann equation,
 formula_123
where formula_124 is the Hamiltonian, and formula_125 is the Moyal bracket, the transform of the quantum commutator.
The evolution equation for the Wigner function is then analogous to that of its classical limit, the Liouville equation of classical physics. In the limit of a vanishing Planck constant formula_126, formula_127 reduces to the classical Liouville probability density function in phase space.
Example applications.
Density matrices are a basic tool of quantum mechanics, and appear at least occasionally in almost any type of quantum-mechanical calculation. Some specific examples where density matrices are especially helpful and common are as follows:
C*-algebraic formulation of states.
It is now generally accepted that the