In statistical mechanics, the ensemble average is defined as the mean of a quantity that is a function of the microstate of a system (the ensemble of possible states), 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. Grand canonical ensemble is an example of open system.
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:
The denominator in this expression is known as the partition function, and is denoted by the letter Z.
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:
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.
It represents an isolated system in which energy (E), volume (V) and the number of particles (N) are all constant.
It 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.