Computational Statistical Mechanics — Lectures and labs

Material of the course (academic year 2026-27): lecture notes and slides, and the slides of the lab sessions, where we write, from scratch, simple C++ codes for Monte Carlo and Molecular Dynamics simulations.
Lectures
Lecture notes
- Monte Carlo — part 1 (PDF, 13.1 MB)
- Monte Carlo — part 2 (PDF, 12.7 MB)
- Monte Carlo — part 3 (PDF, 7.5 MB)
- Molecular Dynamics — part 1 (PDF, 10.5 MB)
Lecture notes (LaTeX)
- Lecture notes (typeset) — work in progress: updated as the course goes on (PDF, 2.8 MB)
Slides
- Introduction to the course (PDF, 5.1 MB)
- Interaction potentials: from first principles to machine learning (PDF, 1.8 MB)
Lab notes
- Detailed proof of Marsaglia's algorithm — random unit vectors on the sphere (Lab #4) (PDF, 0.1 MB)
Downloads
- C++ examples: the examples shown in the labs so far (folder
examples/). - Project classes: the classes of the project you are writing (
project/: vectors, matrices and random numbers so far, with the test programs).
Both archives grow as the labs go on.
Labs
| Lab | Topic |
|---|---|
| Lab 1 | Development environment (WSL 2), introduction to C++ (part I), a first vector class |
| Lab 2 | Introduction to C++ (part II): protected members, function overloading; new constructor and operators for pvector |
| Lab 3 | Introduction to C++ (part III): dynamic memory (new, delete), namespaces; operator() and friend functions for pvector |
| Lab 4 | Introduction to C++ (part IV): class templates, metaprogramming; random numbers (Mersenne Twister), random unit vectors (Marsaglia); a class for matrices |
| Lab 5 | Introduction to C++ (part V): templates and inheritance (using), std::vector of objects, composition vs multiple inheritance; the complete class for matrices |