This is the 2D companion of our 3D generative-diffusion materials sampler — same sampler math, projected onto a plane so the whole lattice, its bonds, and its energy history are visible at once. Real materials-discovery pipelines (GNoME and similar) pair a screening model with a generative model that proposes new candidate structures; this sim visualizes the generative half as a score-based diffusion process:
Forward (training): x_t = √(ᾱ_t)·x_0 + √(1-ᾱ_t)·ε
Reverse (sampling): x_{t-1} = x_t − η·∇E(x_t) + noise(t)
Every atom starts as pure positional noise around a lattice site, then is pulled back toward its ideal site as the schedule t → 0. Its species (host A vs. dopant B) simultaneously "denoises" from an undecided blend toward the target composition set by a cluster-expansion Hamiltonian, the same model class used in real alloy-ordering prediction (CASM, ATAT):
E = (1/N_bonds) Σ J·s_i·s_j + k·⟨|Δr|²⟩
where s_i = ±1 is the species spin on site i, J is the nearest-neighbor pair interaction, and the second term is elastic strain energy from residual positional noise.
- J < 0 favors unlike neighbors → an ordered, checkerboard-like compound.
- J > 0 favors like neighbors → phase separation into A-rich and B-rich clusters.
- Dopant fraction sets the target composition the sampler converges to.
- Generate New Sample draws a fresh noise seed — a different specific arrangement each time, same statistics.
- Drag the view to pan, scroll/pinch to zoom — the lattice is rendered live, not a static image.
Formation energy and crystalline order are recomputed every frame from the live (still-noisy) configuration, and the sparkline beneath the canvas plots both over the last few seconds so you can watch the sample condense toward the energy minimum the guidance signal defines.