An interactive browser-based simulation and visualization tool for the J₁-J₂ Ising model. Metropolis Monte Carlo runs in real time via WebAssembly — no server required.
Lattice: 3D simple-cubic with periodic boundary conditions. Sites are indexed by
| Symbol | Domain | Meaning |
|---|---|---|
| Ising spin on site |
||
| NN pairs (each counted once) | Coordination |
|
| NNN pairs (face-diagonal, each counted once) | Coordination |
|
| NN coupling. |
||
| NNN coupling. Frustration arises when |
||
| Uniform external field, in the same energy units as |
Configurations are sampled from the Boltzmann distribution
Temperature enters here — not in
The Metropolis acceptance ratio depends only on the combination
In these variables the Boltzmann weight reads
which is what the WASM kernel actually evaluates.
The simulation core operates in (K₁, K₂, h̃) space — Metropolis acceptance probabilities are computed in these coordinates.
| Symbol | Definition | Meaning |
|---|---|---|
| K₁ | βJ₁ (= J₁ / k_BT) | Nearest-neighbour coupling (positive: FM, negative: AFM) |
| K₂ | βJ₂ | Next-nearest-neighbour coupling |
| h̃ | βh | Dimensionless external field |
The high-temperature limit collapses to the single point K₁ = K₂ = h̃ = 0 regardless of the sign of J₁ — this is what makes (K₁, K₂, h̃) the natural simulation coordinates.
| UI variable | Definition | Control |
|---|---|---|
| T* = k_BT / |J₁| | Reduced temperature (always positive) | Log-scale slider |
| J₁_sign ∈ {+1, −1} | FM / AFM toggle | Radio buttons |
| h ∈ [−2, +2] | External field (units of |J₁|) | Slider |
| J₂ | Next-nearest coupling (units of |J₁|) | Slider |
Conversion from UI to simulation core:
| Quantity | Value |
|---|---|
|
|
4.5115 (MC estimate)1 |
| 0.2217 | |
| Universality class | 3D Ising |
The classical FM↔stripe and Néel↔stripe transitions occur at different
| Regime | Boundary |
|---|---|
| FM |
|
| AFM |
The asymmetry between the two regimes is a feature of the 3D simple-cubic lattice.2 Near these boundaries the ground-state manifold is highly degenerate; Metropolis dynamics equilibrates very slowly and the simulation may freeze into mismatched domains.
Near
Browser
──────────────────
First load (and on J₁ sign flip with h≠0): random spin configuration sᵢ ∈ {±1}
J₁ sign flip with h=0: Néel sublattice transform σ'ᵢ = (−1)^(iₓ+i_y+i_z) σᵢ
↓
WASM Metropolis (Rust) ◄── spin state persists across (T*, J₂, h) changes;
↓ only the couplings (K₁, K₂, h̃) are updated
React UI visualization
| Layer | Technology |
|---|---|
| In-browser compute | Rust → WebAssembly (wasm-pack) |
| UI | React |
| Hosting | Vercel (static export) |
WASM is essential, not optional. Near the critical point, autocorrelation times diverge and the 10–100× speed advantage over pure JS is directly perceptible — without it, equilibrating
The spin array is initialized randomly only on first load. On any subsequent change of
This split policy has three consequences:
-
Visual continuity within each
$J_1$ branch. Domain structures evolve smoothly as the user moves through$(T^*, J_2, h)$ space, instead of jumping back to a featureless random state on every slider tick. - Quasi-static sweep physics. The trajectory through parameter space mimics a slow physical sweep, so phenomena like hysteresis loops near phase boundaries are naturally reproduced rather than averaged out.
-
No hidden cost amortization. The user sees the actual relaxation toward equilibrium under the new parameters; there is no off-screen "re-equilibration" step that would obscure how slow the dynamics really are near
$T^*_c$ or in frustrated regions. After a$J_1$ sign flip with$h \neq 0$ , the user observes the full coarsening process from a random start, while at$h = 0$ the transformed state already starts close to the correct ordered manifold.
pnpm install
pnpm run devOpen http://localhost:3000.
cd ising-core
wasm-pack build --target web --out-dir ../public/wasmFootnotes
-
For the 2D square lattice, Onsager (1944) gave the exact closed-form solution $T^*_c = 2/\ln(1+\sqrt{2}) \approx 2.2692$. No analogous closed-form solution is known in 3D; the value above is a high-precision Monte Carlo estimate. ↩
-
In the 2D square lattice both boundaries coincide at $|J_2/J_1| = 1/2$ by sublattice symmetry: the transformation $s_i \to (-1)^{i_x + i_y} s_i$ maps FM↔Néel while preserving the stripe state. The 3D analog $s_i \to (-1)^{i_x + i_y + i_z} s_i$ does not preserve the cubic stripe state, hence the splitting. ↩
-
The order parameter depends on the ground state of the regime: uniform magnetization $M = N^{-1}\sum_i s_i$ in the FM regime ($J_1 > 0$, $|J_2| \lesssim J_1/4$); staggered magnetization $M_\text{Néel} = N^{-1}\sum_i (-1)^{i_x + i_y + i_z} s_i$ in the Néel AFM regime ($J_1 < 0$, $|J_2| \lesssim |J_1|/2$); and stripe-pattern order parameters at modulation wavevectors $(\pi, \pi, 0)$ etc. in the frustrated regions beyond those boundaries. ↩