3 color Potts model, Metropolis updating.

$$ S=K\sum_{\langle i,j\rangle} \delta(s_i,s_j) $$
where the \(s_i=1,2,3\) can take three states.

pseudo-code:

- randomly find a site, and randomly change its state
- compare with neighour, and find out the change: dS
- Metropolisily accept or reject