We pick a spin randomly, we try a spin inversion, and we accept the move if the change in energy is lower or equal than .
Note that for , the change in energy due to a spin flip is either 0 or . Hence the initial energy of the system plus the demon must be an integer multiple of . Since the spins are interacting, it is difficult to choose an initial configuration of spins with precisely the desired energy. We can start the simulation from a configuration with all the spins pointing ``up''. The advantage of picking this configuration is that the total energy can be easily computed. The demon energy is then chosen so that the total energy of the system plus the demon is equal to the desired multiple of .