Glauber dynamics simulations

Published:

See the source code here

Glauber dynamics in continuous time are a specific example of a Markov Chain Monte Carlo algorithm in which we put a Poisson point process on each vertex of a graph, and when a clock rings update the configuration on the graph following model-specific rules.

The model

In my master’s thesis and my paper with Christian Hirsch each ring checks its incident edges for their weight, and proportionally to that picks an edge and increments its edge. If the proportionality is not linear but sublinear, we find that , as time goes on, the edge weights should homogenize which is why towards the end of the video the graph looks translationally invariant. In the above video the edge weights are illustrated by their thickness.

The code

The code is written entirely in C and uses modern frameworks like doxygen for documentation and autoconf/make for compiling. Further, unit tests are included.

The code is kept deliberately general as the initial idea was to have a single code base for myself in which I could implement simulations of the various IPS I would encounter during my Ph.D. In the end this has not happened since for the IPS I dealt with in my Ph.D. it was the vertices of the graphs that had the interesting states and not the edges. Instead of implementing a switch for the output (i.e. graph as in the video above for edge-based dynamics and simple matrix without edges for vertex based models) I wrote shorter and simpler scripts in Python for these cases.