  We show that we can harness two recent experimental developments to build a
compact hardware emulator for the classical Heisenberg model in statistical
physics. The first is the demonstration of spin-diffusion lengths in excess of
microns in graphene even at room temperature. The second is the demonstration
of low barrier magnets (LBMs) whose magnetization can fluctuate rapidly even at
sub-nanosecond rates. Using experimentally benchmarked circuit models, we show
that an array of LBMs driven by an external current source has a steady-state
distribution corresponding to a classical system with an energy function of the
form $E = -1/2\sum_{i,j} J_{ij} (\hat{m}_i \cdot \hat{m}_j$). This may seem
surprising for a non-equilibrium system but we show that it can be justified by
a Lyapunov function corresponding to a system of coupled
Landau-Lifshitz-Gilbert (LLG) equations. The Lyapunov function we construct
describes LBMs interacting through the spin currents they inject into the spin
neutral substrate. We suggest ways to tune the coupling coefficients $J_{ij}$
so that it can be used as a hardware solver for optimization problems involving
continuous variables represented by vector magnetizations, similar to the role
of the Ising model in solving optimization problems with binary variables.
Finally, we train a Heisenberg XOR gate based on a network of four coupled
stochastic LLG equations, illustrating the concept of probabilistic computing
with a programmable Heisenberg model.
