To calculate the free energy, we use the replica trick: ln ⁡ ⁡ Z = lim n → → 0 Z n − − 1 n which reduces the complicated task of averaging the logarithm to solving a relatively simple Gaussian integral, provided n is an integer. The replica trick postulates that if Z n can be calculated for all positive integers n then this may be sufficient to allow the limiting behavior as n → → 0 to be calculated.