We discuss contemporary ideas in Monte Carlo algorithms in the simplified setting of the one-dimensional anharmonic oscillator. After reviewing the connection between molecular dynamics and Monte Carlo, we introduce the Metropolis and the factorized Metropolis algorithms and lifted non-reversible Markov chains. We, furthermore, illustrate the concept of thinning, where moves are accepted by simple bounding potentials rather than the harmonic and quartic contributions to the anharmonic oscillator. We point out the multiple connections of our example algorithms with real-world sampling problems. This paper is self-contained, and Python implementations are provided.
REFERENCES
1.
W.
Krauth
, Statistical Mechanics: Algorithms and Computations
(
Oxford U. P.
, 2006
).2.
G.
Tartero
,
S.
Vionnet
, and
W.
Krauth
, “
Fast sampling of Lennard-Jones systems without cutoffs
,” (unpublished 2023).3.
M. H. A.
Davis
, “
Piecewise-deterministic Markov processes: A general class of non-diffusion stochastic models
,” J. R. Stat. Soc. Ser. B
46
(3
), 353
–376
(1984
).4.
L. D.
Landau
and
E. M.
Lifshitz
, Mechanics: Volume 1
(
Elsevier Science
, Amsterdam
, 1982
).5.
B.
Li
,
Y.
Nishikawa
,
P.
Höllmer
,
L.
Carillo
,
A. C.
Maggs
, and
W.
Krauth
, “
Hard-disk pressure computations—a historic perspective
,” J. Chem. Phys.
157
, 234111
(2022
).6.
M.
Michel
,
S. C.
Kapfer
, and
W.
Krauth
, “
Generalized event-chain Monte Carlo: Constructing rejection-free global-balance algorithms from infinitesimal steps
,” J. Chem. Phys.
140
, 054116
(2014
).7.
P.
Diaconis
,
S.
Holmes
, and
R. M.
Neal
, “
Analysis of a nonreversible Markov chain sampler
,” Ann. Appl. Probab.
10
(3
), 726
–752
(2000
).8.
F.
Chen
,
L.
Lovász
, and
I.
Pak
, “
Lifting Markov chains to speed up mixing
,” in Proceedings of the 17th Annual ACM Symposium on Theory of Computing
(Association for Computing Machinery, New York, 1999
). p. 275
.9.
J.
Bierkens
,
P.
Fearnhead
, and
G.
Roberts
, “
The Zig-Zag process and super-efficient sampling for Bayesian analysis of big data
,” Ann. Stat.
47
, 1288
–1320
(2019
).10.
D. A.
Levin
,
Y.
Peres
, and
E. L.
Wilmer
, Markov Chains and Mixing Times
(
American Mathematical Society
, 2008
).11.
W.
Krauth
, “
Event-chain Monte Carlo: Foundations, applications, and prospects
,” Front. Phys.
9
, 229
(2021
).12.
E. A. J. F.
Peters
and
G.
de With
, “
Rejection-free Monte Carlo sampling for general potentials
,” Phys. Rev. E
85
(2
), 026703
(2012
).13.
P. A. W.
Lewis
and
G. S.
Shedler
, “
Simulation of nonhomogeneous Poisson processes by thinning
,” Nav. Res. Logist. Q.
26
(3
), 403
–413
(1979
).14.
S. C.
Kapfer
and
W.
Krauth
, “
Cell-veto Monte Carlo algorithm for long-range systems
,” Phys. Rev. E
94
(3
), 031302
(2016
).15.
A. J.
Walker
, “
An efficient method for generating discrete random variables with general distributions
,” ACM Trans. Math. Software
3
(3
), 253
–256
(1977
).16.
NIST Digital Library of Mathematical Functions
, <http://dlmf.nist.gov/>17.
On GitHub
, the MCMCNutshell package is part of the JeLLyFysh organization, and can be found at <https://github.com/jellyfysh/MCMCNutshell>.18.
See supplementary material online for Python programs and a Mathematica notebook.
© 2024 Author(s). Published under an exclusive license by American Association of Physics Teachers.
2024
Author(s)
AAPT members receive access to the American Journal of Physics and The Physics Teacher as a member benefit. To learn more about this member benefit and becoming an AAPT member, visit the Joining AAPT page.