Harmonic Oscillator

An easy to understand C++11 code that illustrates the Hybrid Monte Carlo algorithm in a simulation of the harmonic oscillator on the lattice.

Lattice simulations suffer from their computational requirements. Without the algorithmic improvements and the availability of cheap computing power, no real-world simulations could be performed these days. One of the cornerstones of modern lattice simulations is the Hybrid Monte Carlo (HMC) algorithm. The basic idea is a mixture of Molecular Dynamics (deterministic) and a Monte Carlo procedure (pseudo-random).

In order to work we require a symplectic integrator, which is found in form of the leapfrog algorithm. Additionally we need to work out specifics in our equations, especially the discretization. An interesting learning experience is offered by the (an)harmonic oscillator. The discretization is straight forward and the required calculations can be done within a few hours.

I've pushed some code to GitHub, which can be found at github.com/FlorianRappl/HarmOsc. The code requires a capable C++11 compiler. For building I use the node.js tool Jake. More details on the requirements and the dependencies can be found in the README file of the repository.

Created . Last updated .


Sharing is caring!