# 6.2. Statistical Physics¶

## 6.2.1. Microcanonical Ensemble¶

The entropy is equal to:

where is the micronanonical partition function, the number of microstates within the range of energy.

## 6.2.3. Grand Canonical Ensemble¶

The partition function for fermions is:

Similarly, for bosons we would get:

The grand potential for fermions is then equal to:

Similarly, the grand potential for bosons is equal to:

## 6.2.4. Examples¶

### Ideal Gas¶

Ideal gas is simply a system of classical particles, where for a given microstate specified by a set of coordinates and momenta , the total energy of the microstate is given by the following Hamiltonian:

that is, the particles are non-interacting, each has a mass and a momentum . The canonical partition function is then equal to:

where we used the following integral:

The Helmholtz free energy is then equal to:

where we used the Stirling’s approximation for . For large this is equal to the Helmholtz free energy of the ideal gas (see Ideal Gas):

with and . See that section where all other thermodynamic properties are derived from it.

We can also start from the grand canonical partition function:

And the grand potential is:

This is equal to the grand potential of an ideal gas:

with and . The thermodynamics section then shows that the corresponding Helmholtz free energy is the same as we obtained above from the canonical ensemble. Note that we also obtained the same as before.