I have performed a Monte Carlo simulation of the classical Heisenberg model for a simple 2D square lattice. But I obtain some strange results. In fact, there is clearly a phase transition and a magnetized phase for low temperatures.
I attach some plots of the results.
I know that the symmetry can be broken only for $T=0$. I've checked multiple times the code I wrote and all seems ok. I have run some simulation of the 3D Heisenberg model and all went fine. I have also estimated some critical exponents for the 3D model with good accuracy so I don't think my code is bugged. What could be the reason of this behavior?
I have already read Phase transition in 2D Heisenberg model and I use the correct way to sample point on the sphere.
EDIT:
For each sample, I compute and save the average magnetization per spin $\vec m_i$ and the system energy $E_i$
In the analysis, I simply compute the mean of the magnitude $\langle | \vec m | \rangle$ for the first plot.
In the second one, the heat capacity per spin is estimated by
$$ c_v = \frac{1}{L^2} \frac{\langle E^2 \rangle - \langle E \rangle^2}{T^2} $$