This is a grand canonical ensemble (μVT): a lattice of L³ sites, each either empty (n=0) or occupied by one particle (n=1), exchanges both energy and particles with an implicit reservoir at fixed temperature T and chemical potential μ — unlike a canonical (NVT) simulation where particle number is fixed.
Energy: E = -ε Σ<i,j> nᵢnⱼ (nearest-neighbor attraction)
Grand pot.: ΔΩ = ΔE - μΔN
Accept if: rand() < exp(-ΔΩ / kT)
Each Monte Carlo step picks a random site and proposes flipping its occupation (insert a particle if empty, remove if occupied — a Metropolis grand-canonical move). ΔN = +1 for insertion, -1 for removal; ΔE comes from the site's occupied neighbours. This is mathematically the lattice-gas mapping of the Ising model, with μ playing the role of an external field that sets the equilibrium density.
- Temperature — higher kT/ε accepts more energetically unfavourable moves, randomising the lattice.
- Chemical potential μ — raising μ favours insertion and increases average density; very negative μ empties the lattice.
- Interaction ε — the attractive coupling between occupied neighbours; large ε/kT drives clustering and, near μ ≈ -3ε (half filling on a cubic lattice), a liquid-gas-like phase separation.
- ⟨(ΔN)²⟩ — the variance of the particle number over recent sweeps. The fluctuation-response relation κ = ⟨(ΔN)²⟩/(N·kT) links these fluctuations directly to the isothermal compressibility of the system.
Real-world relevance: grand canonical Monte Carlo is the standard tool for simulating gas adsorption in porous materials, vapour-liquid coexistence, and any system where particle number is not conserved locally but set by an external reservoir.