Stochasm

User Guide Open the app ↗

Getting started: what Stochasm is, and how to run a first simulation

What is Stochasm?

Stochasm is an interactive statistical-physics laboratory that runs in a web browser. It simulates a multi-component lattice of transforming sites, a ferromagnet, a particle in a one-dimensional potential, and patchy discs and bead-spring polymers. Each system evolves under kinetic Monte Carlo or molecular dynamics and is rendered live, so a design and the trajectory it produces are visible at the same time.

Every model’s kernel is compiled from C to WebAssembly and executes locally in the browser. The simulated physics is the published model rather than a visual approximation of it, and ensembles are distributed across several CPU cores.

  • Single system. One realisation at full resolution. Sites can be painted by hand and rules adjusted while the system runs.
  • Ensemble. Thousands of independent replicas of one design, up to 100,000 for the lattice models, drawn as a cloud of points in a plane of two measured observables.
  • Machine learning. The ensemble is clustered by its observables and the community structure is drawn as a live graph.

The Gallery collects images produced with the lattice model.

Quick start

A first simulation takes six steps. A welcome panel covers the stage until a system is defined, at which point the live preview replaces it.

  1. Select a model in the Launcher. Multi-Component Lattice is a good starting point.
  2. Select a mode. Single system shows one lattice in detail.
  3. Under Setup, leave Preset selected and choose an entry from the list. Fredrickson–Andersen (FA) is a standard kinetically constrained model. The stage previews it immediately and the Next bar rises into the card.
  4. Press Next. The preview slides left and the Builder opens at Step 1 of 2, holding the lattice size and the site types. The defaults are suitable.
  5. Press Next again for Step 2, which holds the rules and the Compute card (compiled C core, worker count). Then press the green Initialize button.
  6. Press Play, at the top right.
A Fredrickson–Andersen lattice shortly after Play, with orange excited sites propagating under the kinetic constraint.
A Fredrickson–Andersen lattice shortly after Play. Orange excited sites propagate under the kinetic constraint.

Sites can then be painted directly. Click and drag on the lattice, choosing the type in the Interaction & Paint window (the brush icon beside the view selector). The control panel’s Simulation tab adjusts rates, temperature and fields while the system runs. To change the system’s structure, press Back to Builder in the header, revise the design, and either Resume Simulation to return to the held run or Re-Initialize to re-seed it from the revised design. Start Fresh returns to the Launcher.

Ensemble mode follows the same sequence. Start Fresh, select mode Ensemble, choose the FA preset, then Next, Next, Initialize and Play. Ten thousand independent lattices then run at once, each drawn as one point. Clicking a point opens that system in the Sampler.
© Nicholas B. Tito · Stochasm: explore statistical thermodynamics, machine learning, and create digital art.