Final energy difference

Since the spin to be flipped takes only two values, \( s_l^1=\pm 1 \) and \( s_l^2=\pm 1 \), it means that if \( s_l^1= 1 \), then \( s_l^2=-1 \) and if \( s_l^1= -1 \), then \( s_l^2=1 \). The other spins keep their values, meaning that \( s_k^1=s_k^2 \). If \( s_l^1= 1 \) we must have \( s_l^1-s_{l}^2=2 \), and if \( s_l^1= -1 \) we must have \( s_l^1-s_{l}^2=-2 \). From these results we see that the energy difference can be coded efficiently as $$ \begin{equation} \Delta E = 2Js_l^1\sum_{< k>}^{N}s_k, \tag{3} \end{equation} $$ where the sum runs only over the nearest neighbors \( k \) of spin \( l \). We can compute the change in magnetisation by flipping one spin as well. Since only spin \( l \) is flipped, all the surrounding spins remain unchanged.