Consider a system, commonly known as an Einstein or harmonic solid. The energy of each particle in this system is restricted to the positive integers. That is, each particle may have energy 0, 1, 2, … The particles do not interact. These particles are equivalent to the quanta of the harmonic oscillator, which have energy εn = (n + 1/2)hν. If we measure the energies from the lowest energy state, hν/2, and choose units such that hν = 1, then εn = n.
In the following we will explore the properties of a Einstein solid in equilibrium with a heat bath at temperature T. We will also compare our results with analytical calculations of the thermodynamic properties of the Einstein solid.
A common algorithm for simulating a system in equilibrium with a heat bath is the Metropolis algorithm. The program implements the Metropolis algorithm by choosing a particle at random and randomly increasing or decreasing its energy by one unit. If its energy is decreased, the change is accepted. If its energy is increased, the program generates a number r at random in the unit interval and accepts the change if r ≤ e-β, where β = 1/T. (As usual, we choose units such that Boltzmann's constant k = 1.) If a trial change is not accepted, the existing microstate is counted in all averages.
Updated 26 December 2009.