Once the simulation Window opens, use the arrow keys to change the simulation parameters.
-
RIGHT_ARROW/LEFT_ARROW: Increase / Decrease Temperature,$T$ -
UP_ARROW/DOWN_ARROW: Increase / Decrease Chemical Potential$\mu$ -
C: Return to criticality$(\mu_{\text{Crit}}, T_\text{Crit})$ -
P: Write current state to terminal
If T is low (but non-zero) you should see the system stabilise as either fully vapour or liquid. If you increase/decrease
If
At
- C++17 for simulation logic, control flow, and performance-critical routines.
- CUDA kernels for massively parallel spin/particle updates.
- SDL2 for interactive graphics, window management, and user input (real-time parameter tuning).
- Real-time lattice rendering to visualize phase transitions and metastability.
- Lightweight logging of observables (energy, particle number, order parameters).
We use a grand canonical ensemble, i.e., the control parameters used are temperature
This weight function will be enforced by the Metropolis Markov-Chain Monte Carlo method.
A proposed move is accepted with probability
where the grand potential change is
and
Thus,
Under these conditions, the critical temperature and chemical potentials are:
$T_\text{Crit} = \frac{2J}{\ln(1 + \sqrt{2})}$ $\mu_\text{Crit} = -2J$
The canonical procedure for Metropolis-style Monte-Carlo is as follows:
- Select a site
$i$ at random - Propose flipping its state:
$n_i \leftarrow 1 - n_i$ - This corresponds to
$\Delta N = \pm 1$ - Compute
$\Delta E$ from the Hamiltonian - Accept the flip with probability
$p_\text{accept}$
Parellisation
In serial MCMC, only one site is updated at a time. The simulation can be sped up significantly by updating multiple sites at parallel. Updating all sites simultaneously would break detailed balance, since
- Sites are divided into two interleaved sub-lattices (like a chessboard)
- Updates are proposed simulatenously on one-sub lattice, then on the other.
