Code for the Lattice Gas
We discuss here some details of writing a Computer code for the dynamics of the lattice gas defined in Section 4.4. The code is not optimized; it is included as a guide and for inspiration only.
The configuration of the particles on the (two-dimensional) lattice is stored in the array n(1:L,1:L). The elements of this array take the value n(i,j) = 1 if the site (i,j) is occupied by a particle; otherwise, n(i,j) = 0. The update, as defined in Section 4.4.1, can be coded as sketched below. A complete code of the lattice gas will include an initiation of the array n(i,j), and special attention must be paid to the boundary. Since the lattice is updated simultaneously, we need the array nnew (1:L,1:L) to store intermediate ...