# Ensemble average

In statistical mechanics, the ensemble average is defined as the mean of a quantity that is a function of the microstate of a system, according to the distribution of the system on its micro-states in this ensemble.

Since the ensemble average is dependent on the ensemble chosen, its mathematical expression varies from ensemble to ensemble. However, the mean obtained for a given physical quantity doesn't depend on the ensemble chosen at the thermodynamic limit. The grand canonical ensemble is an example of an open system.

## Canonical ensemble average

### Classical statistical mechanics

For a classical system in thermal equilibrium with its environment, the ensemble average takes the form of an integral over the phase space of the system:

${\bar {A}}={\frac {\int {Ae^{-\beta H(q_{1},q_{2},...q_{M},p_{1},p_{2},...p_{N})}d\tau }}{\int {e^{-\beta H(q_{1},q_{2},...q_{M},p_{1},p_{2},...p_{N})}d\tau }}}$

where:

${\bar {A}}$  is the ensemble average of the system property A,
$\beta$  is ${\frac {1}{kT}}$ , known as thermodynamic beta,
H is the Hamiltonian of the classical system in terms of the set of coordinates $q_{i}$  and their conjugate generalized momenta $p_{i}$ , and
$d\tau$  is the volume element of the classical phase space of interest.

The denominator in this expression is known as the partition function, and is denoted by the letter Z.

### Quantum statistical mechanics

In quantum statistical mechanics, for a quantum system in thermal equilibrium with its environment, the weighted average takes the form of a sum over quantum energy states, rather than a continuous integral:

${\bar {A}}={\frac {\sum _{i}{A_{i}e^{-\beta E_{i}}}}{\sum _{i}{e^{-\beta E_{i}}}}}$

## Ensemble average in other ensembles

The generalized version of the partition function provides the complete framework for working with ensemble averages in thermodynamics, information theory, statistical mechanics and quantum mechanics.

### Microcanonical ensemble

The microcanonical ensemble represents an isolated system in which energy (E), volume (V) and the number of particles (N) are all constant.

### Canonical ensemble

The canonical ensemble represents a closed system which can exchange energy (E) with its surroundings (usually a heat bath), but the volume (V) and the number of particles (N) are all constant.

### Grand canonical ensemble

The grand canonical ensemble represents an open system which can exchange energy (E) as well as particles with its surroundings but the volume (V) is kept constant.