Repository for the implementation of Multilevel MCMC path integral methods in quantum physics. The code was used to produce the results in Jansen, Mueller and Scheichl (2020). The central idea is to apply the Multilevel Markov Chain Monte Carlo algorithm described in Dodwell et al. (2015) to path integrals that arise in the statistcal formulation of quantum mechanics. An accessible introduction to the latter can be found in Creutz and Freedman (1981).
Fig. 1: Path integral formulation of quantum mechanics in the continuum (left) and on a lattice (right).
While Multilevel MCMC is a variance reduction technique that can further accelerate existing sampling algorithms, one of the key findings of Jansen, Mueller and Scheichl (2020) is that hierarchical sampling substantially reduces autocorrelations in the Markov chain. The central idea is to use a two-level Metropolis Hastings step to screen samples from the coarser levels. This can be viewed as an extension of the delayed acceptance method in Christen and Fox (2005).
For further details on the methods see Jansen, Mueller and Scheichl (2020).
The following plot shows the reduction in integrated autocorrelations for the topological oscillator (left) and the improvement in runtime for a double well potential (right). Results are shown in blue for a single-level Hybrid Monte Carlo method (HMC), in green for the hierarchical sampler and in red for the multilevel Monte Carlo method.
Fig 3: integrated autocorrelation time (left) and runtime (right) as a function of the lattice spacing.
The code currently supports the following quantum mechanical systems.
- Harmonic oscillator
- Quartic potential
- Quantum mechanical rotor or topological oscillator. A more detailed description of the system can be found in Ammon at al. (2016).
It has also been extended to two-dimensional problems in quantum field theory. So far, only the Gaussian Free Field (GFF) and the quenched Schwinger model have been implemented.
The code requires the following two packages:
- The Eigen library for dense linear algebra
- The GNU Scientific Library (GSL)
The code is configured and build with CMake. For an out-or-source build, create a new subdirectory build
and change to this directory. Then run the following command to configure:
cmake ..
Note that by default all optimisations are switched off, set CMAKE_BUILD_TYPE
to Release
to enable optimisations. MPI support is controlled via the USE_MPI
option, which is set the On
be default. For example to build the code in release mode without MPI support, use
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_MPI=Off
After configuration, the code is build by running
make
in the build
directory (use make -j
to build in parallel). This will compile the code in build/src
.
The two main executables are driver_qm
(for one-dimensional quantum mechanical problems) and driver_qft
(for quantum field theory problems). In both cases, runtime options are read from a file which is passed as a command line option, for example
./build/src/driver_qm parameters.in
will read parameters from the file parameters.in
. Template files with default values of the parameters are given as parameters_qm_template.in
and parameters_qft_template.in
in the main directory.
- action: Contains the implementation of various lattice actions, together with conditioned fine actions and renormalisation. The actions of the subdirectories are derived from the abstract bases classes
Action
andClusterAction
. - common: Several auxilliary functions and classes that are used elsewhere in the code. Most importantly, the
SampleState
class is used throughout the code to represent states (i.e. paths in quantum mechanics and lattice fields in QFT). - distribution: Implementations of several probability distributions that are mainly used for filling in the fine states in the conditioned distributions. The implemented distributions support both sampling and evaluation at a particular point.
- lattice: Implementation of hierarchical lattices. Currently, one- and two-dimensional lattices are implemented.
- montecarlo: Contains classes for performing a Markov Chain Monte Carlo step as well as the single-level-, two-level- and multilevel Monte Carlo algorithms.
- mpi: Wrappers for the Message Passing Interface (MPI). This includes a parallel random number generator.
- qoi: Classes that represent observables (Quantities of Interest = QoIs). The classes in the subdirectories are derived from the base class
QoI
. - sampler: Implementation of several sampling algorithms. This includes the classical cluster sampler (a version adapted to the quenched Schwinger model has also been implemented) and an overrelaxed heat-bath sampler. In addition, hierarchical- and multilevel samplers are implemented.
- tools: Several tools for plotting data generated by the main C++ code.
- python: Contains mainly simplified Python code for experimenting with samplers for the GFF, before implementing these in the main C++ code.
- driver_qm.cc The main executable for running different Monte Carlo algorithms (singlelevel, twolevel and multilevel) for quantum mechanical problems.
- driver_qft.cc The main executable for running different Monte Carlo algorithms (singlelevel, twolevel and multilevel) for quantum field theory problems.
- test_distribution.cc Generate samples from a given distribution and save them in the file
distribution.txt
for testing. The time per sample is also recorded and printed to the screen. The distribution and its parameters can be chosen via command line parameters, see thecommandlineparser.getopt_
calls in the source code for details. - test_fastbessel.cc Code for checking that the implementation of the fast Bessel distribution in fastbessel.hh gives the same results as the GSL implementation.
- test_schwinger_fillin_distribution.cc Code for testing the fill-in distribution used in the quenched Schwinger model. Generates samples from the four-dimensional fillin distribution and saves them to disk.
[1] Jansen, K., Müller, E.H. and Scheichl, R., 2020. Multilevel Monte Carlo algorithm for quantum mechanics on a lattice. Physical Review D, 102(11), p.114512.journal url arXiv:2008.03090
[2] Creutz, M. and Freedman, B., 1981. A statistical approach to quantum mechanics. Annals of Physics, 132(2), pp.427-462. url
[3]: Ammon, A., Genz, A., Hartung, T., Jansen, K., Leövey, H. and Volmer, J., 2016. On the efficient numerical solution of lattice systems with low-order couplings. Computer Physics Communications, 198, pp.71-81. journal url arXiv:1503.05088
[4]: Dodwell, T.J., Ketelsen, C., Scheichl, R. and Teckentrup, A.L., 2015. A hierarchical multilevel Markov chain Monte Carlo algorithm with applications to uncertainty quantification in subsurface flow. SIAM/ASA Journal on Uncertainty Quantification, 3(1), pp.1075-1108. journal url arXiv:1303.7343
[5]: Christen, J.A. and Fox, C., 2005. Markov chain Monte Carlo using an approximation. Journal of Computational and Graphical statistics, 14(4), pp.795-810. journal url