The precise mathematical expression for a statistical ensemble has a distinct form depending on the type of mechanics under consideration (quantum or classical). In the classical case, the ensemble is a
probability distribution over the microstates. In quantum mechanics, this notion, due to
von Neumann, is a way of assigning a probability distribution over the results of each
complete set of commuting observables. In classical mechanics, the ensemble is instead written as a probability distribution in
phase space; the microstates are the result of partitioning phase space into equal-sized units, although the size of these units can be chosen somewhat arbitrarily.
Requirements for representations Putting aside for the moment the question of how statistical ensembles are generated
operationally, we should be able to perform the following two operations on ensembles
A,
B of the same system: • Test whether
A,
B are statistically equivalent. • If
p is a real number such that , then produce a new ensemble by probabilistic sampling from
A with probability
p and from
B with probability . Under certain conditions, therefore,
equivalence classes of statistical ensembles have the structure of a convex set.
Quantum mechanical A statistical ensemble in quantum mechanics (also known as a mixed state) is most often represented by a
density matrix, denoted by \hat\rho. The density matrix provides a fully general tool that can incorporate both quantum uncertainties (present even if the state of the system were completely known) and classical uncertainties (due to a lack of knowledge) in a unified manner. Any physical observable in quantum mechanics can be written as an operator, \hat X. The expectation value of this operator on the statistical ensemble \rho is given by the following
trace: \langle X \rangle = \operatorname{Tr}(\hat X \rho). This can be used to evaluate averages (operator \hat X),
variances (using operator \hat X^2),
covariances (using operator \hat X \hat Y), etc. The density matrix must always have a trace of 1: \operatorname{Tr}{\hat\rho} = 1 (this essentially is the condition that the probabilities must add up to one). In general, the ensemble evolves over time according to the
von Neumann equation. Equilibrium ensembles (those that do not evolve over time, d\hat\rho / dt = 0) can be written solely as a function of conserved variables. For example, the
microcanonical ensemble and
canonical ensemble are strictly functions of the total energy, which is measured by the total energy operator \hat H (Hamiltonian). The grand canonical ensemble is additionally a function of the particle number, measured by the total particle number operator \hat N. Such equilibrium ensembles are a
diagonal matrix in the orthogonal basis of states that simultaneously diagonalize each conserved variable. In
bra–ket notation, the density matrix is \hat\rho = \sum_i P_i |\psi_i\rangle \langle\psi_i|, where the , indexed by , are the elements of a complete and orthogonal basis. (Note that in other bases, the density matrix is not necessarily diagonal.)
Classical mechanical systems in
phase space (top). Each system consists of one massive particle in a one-dimensional
potential well (red curve, lower figure). The initially compact ensemble becomes swirled up over time. In classical mechanics, an ensemble is represented by a probability density function defined over the system's
phase space. In particular, the probability density function in phase space, , is related to the probability distribution over microstates, by a factor \rho = \frac{1}{h^n C} P, where • is an arbitrary but predetermined constant with the units of , setting the extent of the microstate and providing correct dimensions to . • is an overcounting correction factor (see below), generally dependent on the number of particles and similar concerns. Since can be chosen arbitrarily, the notional size of a microstate is also arbitrary. Still, the value of influences the offsets of quantities such as entropy and chemical potential, and so it is important to be consistent with the value of when comparing different systems.
Correcting overcounting in phase space Typically, the phase space contains duplicates of the same physical state in multiple distinct locations. This is a consequence of the way that a physical state is encoded into mathematical coordinates; the simplest choice of coordinate system often allows a state to be encoded in multiple ways. An example of this is a gas of identical particles whose state is written in terms of the particles' individual positions and momenta: when two particles are exchanged, the resulting point in phase space is different, and yet it corresponds to an identical physical state of the system. It is important in statistical mechanics (a theory about physical states) to recognize that the phase space is just a mathematical construction, and to not naively overcount actual physical states when integrating over phase space. Overcounting can cause serious problems: • Dependence of derived quantities (such as entropy and chemical potential) on the choice of coordinate system, since one coordinate system might show more or less overcounting than another. • Erroneous conclusions that are inconsistent with physical experience, as in the
mixing paradox. so overcounting can be corrected simply by integrating over the full range of canonical coordinates, then dividing the result by the overcounting factor. However, does vary strongly with discrete variables such as numbers of particles, and so it must be applied before summing over particle numbers. As mentioned above, the classic example of this overcounting is for a fluid system containing various kinds of particles, where any two particles of the same kind are indistinguishable and exchangeable. When the state is written in terms of the particles' individual positions and momenta, then the overcounting related to the exchange of identical particles is corrected by using C = N_1! N_2! \cdots N_s!. This is known as "correct Boltzmann counting". == Ensembles in statistics ==