fun.sys / free time / magnet

THE MAGNET THAT FORGETS

Each cell is a tiny magnet, up or down, and wants to match its four neighbors. Heat fights that wish. Slide the temperature across 2.269 and watch a whole magnet lose its memory.
spins: green up, dark down (click or drag to paint, shift = down)
dots: what this grid measured. line: Onsager's exact answer for an infinite one
magnetization 0energy per spin 0sweeps 0
What you are seeing. Every step proposes flipping a spin and accepts it with probability min(1, e−ΔE/T) (Metropolis). Below Tc = 2/ln(1+√2) ≈ 2.269 one color wins and the plot sits on Onsager's curve; above it the grid is salt and pepper and the magnetization is just noise, about 1/N. Right at Tc you get blobs of every size at once, and plain Metropolis crawls: this is critical slowing down. Turn on cluster flips (Wolff): it grows a whole same-colored cluster and flips it in one move, and the critical grid suddenly moves (it needs the field at 0). Try cooling a scrambled grid fast: it freezes into stripes and domains that take forever to die, the same thing a metal does when you quench it. Hit sweep temperature and the dots draw the whole curve for you.