
Stochasm performs a lattice Monte Carlo simulation right on your own computer, evolving visually in real-time.
Once turned on, the simulation consists of a programmatic loop, executed indefinitely until the simulation is paused. On each iteration of the loop, a random lattice site (pixel) is chosen in the system, and then one of the applicable Monte Carlo moves (irreversible flip, reversible flip, or swap) for that site type is selected at random for an attempt. Whether or not the move succeeds depends on the mathematics outlined below. In this way, the system evolves stochastically through simulation time.
Mathematics
The probability that a move succeeds depends on the current parameter value “k” for that move. Fields and site-site interactions bias the success probability of moves, by introducing an energy difference between sites of different types along with local interaction energies between sites. Each site on the lattice has a total energy comprising
- its field energy;
- its total interaction energy with neighboring sites.
The interaction energy is calculated by summing over the eight neighbors (nearest and next-nearest) of the site.
This field + interaction energy is calculated for all lattice sites involved in a given move before it is attempted (Ei), and then compared to what the new energy would be if the move were to succeed (Ef). The success probability of the move is then multiplied by a Boltzmann factor accounting for this energy difference.
With these ingredients combined, the success probability for any Monte Carlo move in the simulation is calculated by
- P(success) = k * min(1, exp( – (Ef – Ei)))
Adding a facilitation condition to a move mandates that the move is only successful when the site in question has a certain threshold number of lattice sites of a given type beside it.