# Measuring correlation lengths of 2D Ising model by Monte Carlo simulation?

I want to measure cluster size and cluster number at different temperatures below and above critical temperature in 2d Ising model by Monte Carlo method. In other words, I must measure correlation length (typical cluster size) at different temperatures, but I do not know how to start to measure correlation length. Would you please help me ?

• This older Physics.SE post says the correlation length is the difference in measured temperature to the critical temperature (raised to some power), so it seems you should start with your grid of temperatures Commented Jan 17, 2017 at 11:13

First off, the critical temperature is lattice size dependent. The Onsager solution only applies in the thermodynamic limit of infinite grid size.

For a finite grid then, you'll want to sample temperatures in the range $[1,3]$ to pinpoint where the phase transition occurs. After picking a random temperature, run an Ising grid from random initial conditions for enough time steps that the system thermalizes. You'll have to figure out exactly how to do that, but the basic idea is that the system needs to reach the minimum of its free energy to be in equilibrium before you can measure the correlation length.

Once the system is in equilibrium, measure the two point correlation function. You can do this either via convolution, which is numerically expensive, or via Fourier transforms and the relationship between the correlation function and the power spectrum, which is less numerically expensive.

Once you have the two point correlation function, we know that the functional form of it is described by (in 2 dimensions): $$C_2(r) \propto \frac{e^{-r/\xi}}{\left(\frac{r}{\xi}\right)^{\eta}}$$ where $\eta$ is a critical exponent of the Ising universality class, and $\xi$ is the correlation length. Note that this form reduces to exponential behavior when the correlation length is small, and power law behavior when the correlation length is big. You can fit your data to the above functional form and extract both the critical exponent and the correlation length.

Hope that helps.

• How exactly do you propose to do the fit ?
– a06e
Commented Nov 16, 2021 at 11:46
• @becko, there are many ways - here I describe my favorite in 2d. First collect an ensemble of snapshots; if these are taken from a single run, make sure that the snapshots are at least a couple of correlation times apart temporally. Then for each member of the ensemble: 1. Take the FT and square it ( abs()²). This gives you a power spectrum. 2. Take the IFT of the power spectrum. This is the full 2-pt correlation function, without any symmetry assumptions. 3. Find the radial profile of these ( matlab rscan, for example). You now have an ensemble of radial correlation functions. Commented Dec 10, 2021 at 18:14
• @becko now just run statistics on this ensemble to get error bars to use as weights in a weighted fit. I find that running a linear fit on log-linear data close to criticality, and log-log data far from criticality is enough to identify the correlation length and critical exponent. Cheers! Commented Dec 10, 2021 at 18:15
• The issue with the log fits is that I sometimes have negative values of which I cannot take the log. Does this happen to you? Or maybe I am missing something from your explanation?
– a06e
Commented Dec 10, 2021 at 19:50
• @DamianSowinski do you have the source code available? Commented Apr 23 at 15:32