Here are the python programs related to Week 2:

And here are some sections of the SMAC book (Krauth W., "Statistical mechanics: algorithms and computations". OUP Oxford, 2006) related to the topics treated in Week 2:

2.1.1 (molecular dynamics), 2.2 (equiprobability), 2.2.1 (direct sampling for hard disks), 2.2.2 (partition function, acceptance rate, virial expansion), 2.2.3 (Markov-chain sampling for hard disks)