Statistical physics / spin glasses

Heat and cool a spin lattice

Drag the temperature and watch a Sparsr device do the physics - 4,096 spins per instruction.

Sparsr VM starting a software model of the processor, running in this tab

This is a software model. The same kernels run unchanged through the Sparsr SDK on your own machine.

Every square is a magnetic spin. Drag the temperature: hot and they churn, cold and the pattern freezes in place.

4,096 lattices in one register

The lattice is 16×16×16 sites, and the device holds 4,096 independent copies of the whole thing at once - one per bit of a wide register. One instruction updates a site in every copy simultaneously.

That is the point of the picture. One sweep of the cube is 4,096 site updates and about 460,000 wide instructions, and those instructions between them touch 16.8 million spins. A processor with 32-bit registers would need 128 operations where this needs one.

You are watching one copy, one layer - a 16×16 window onto a machine that is running 4,096 of these in parallel.

Why it does not turn one colour

This is a spin glass. The couplings between neighbouring spins are random. Some pairs want to agree and others want to disagree, so parts of the lattice are always frustrated. Cool it and the spins still do not line up the way they would in a fridge magnet. It freezes - the pattern stops changing while staying scrambled.

That frustration is exactly what makes spin glasses hard, and why physicists simulate them by the millions. What to watch is whether the picture is still moving, not what colour it is. The magnetisation readout stays near zero whatever the temperature, for the same reason.

Speed, and the 340-byte kernel

Nothing about speed. The processor here is a software model running in your browser, so how fast it goes is a property of your laptop rather than of Sparsr. The instruction and spin counts are exact. Timing is left out on purpose.

The Monte Carlo update itself was not written for this page. It is the same kernel the cheminformatics and statistical-physics work uses, compiled by the ordinary RISC-V toolchain, and it comes to 340 bytes of instructions.