Importance Sampling in Monte Carlo Simulation of Rare Transition Events

Similar documents
Importance Sampling in Monte Carlo Simulation of Rare Transition Events

Monte Carlo. Lecture 15 4/9/18. Harvard SEAS AP 275 Atomistic Modeling of Materials Boris Kozinsky

Adaptive importance sampling Monte Carlo simulation of rare transition events

MatSci 331 Homework 4 Molecular Dynamics and Monte Carlo: Stress, heat capacity, quantum nuclear effects, and simulated annealing

Diffusion Monte Carlo

Multiple time step Monte Carlo

A Feynman-Kac Path-Integral Implementation for Poisson s Equation

Wang-Landau Monte Carlo simulation. Aleš Vítek IT4I, VP3

Random Walks A&T and F&S 3.1.2

0.1 Naive formulation of PageRank

Advanced sampling. fluids of strongly orientation-dependent interactions (e.g., dipoles, hydrogen bonds)

16. Working with the Langevin and Fokker-Planck equations

André Schleife Department of Materials Science and Engineering

Kinetic Monte Carlo. Heiko Rieger. Theoretical Physics Saarland University Saarbrücken, Germany

MD Thermodynamics. Lecture 12 3/26/18. Harvard SEAS AP 275 Atomistic Modeling of Materials Boris Kozinsky

Density Functional Theory: from theory to Applications

Simulations with MM Force Fields. Monte Carlo (MC) and Molecular Dynamics (MD) Video II.vi

A Feynman Kac path-integral implementation for Poisson s equation using an h-conditioned Green s function

Time-Dependent Statistical Mechanics 1. Introduction

3.320: Lecture 19 (4/14/05) Free Energies and physical Coarse-graining. ,T) + < σ > dµ

Introduction to molecular dynamics

PHYSICAL REVIEW LETTERS

Kinetic Monte Carlo (KMC)

Monte Carlo Simulations in Statistical Physics

Monte Carlo (MC) Simulation Methods. Elisa Fadda

CS242: Probabilistic Graphical Models Lecture 7B: Markov Chain Monte Carlo & Gibbs Sampling

Modeling the Free Energy Landscape for Janus Particle Self-Assembly in the Gas Phase. Andy Long Kridsanaphong Limtragool

Molecular Interactions F14NMI. Lecture 4: worked answers to practice questions

Random walks. Marc R. Roussel Department of Chemistry and Biochemistry University of Lethbridge. March 18, 2009

Statistical Thermodynamics and Monte-Carlo Evgenii B. Rudnyi and Jan G. Korvink IMTEK Albert Ludwig University Freiburg, Germany

The Kawasaki Identity and the Fluctuation Theorem

The Kramers problem and first passage times.

Lecture 8 - Carrier Drift and Diffusion (cont.) September 21, 2001

Monte Carlo Methods in Statistical Physics: I. Error analysis for uncorrelated data

MONTE CARLO METHOD. Reference1: Smit Frenkel, Understanding molecular simulation, second edition, Academic press, 2002.

Rare Event Simulations

Chapter 5 - Systems under pressure 62

Estimating exit rate for rare event dynamical systems by extrapolation

Multiscale Materials Modeling

Brief Review of Statistical Mechanics

Dynamics of Nucleation in the Ising Model

6 Markov Chain Monte Carlo (MCMC)

Kinetic Monte Carlo: from transition probabilities to transition rates

Introduction. Chapter The Purpose of Statistical Mechanics

Malvin H. Kalos, Paula A. Whitlock. Monte Carlo Methods. Second Revised and Enlarged Edition WILEY- BLACKWELL. WILEY-VCH Verlag GmbH & Co.

Physics 127c: Statistical Mechanics. Application of Path Integrals to Superfluidity in He 4

UNDERSTANDING BOLTZMANN S ANALYSIS VIA. Contents SOLVABLE MODELS

Introduction to Computer Simulations of Soft Matter Methodologies and Applications Boulder July, 19-20, 2012

Opinions on quantum mechanics. CHAPTER 6 Quantum Mechanics II. 6.1: The Schrödinger Wave Equation. Normalization and Probability

Statistical Mechanics in a Nutshell

The cost/reward formula has two specific widely used applications:

8 STOCHASTIC SIMULATION

Lecture 2+3: Simulations of Soft Matter. 1. Why Lecture 1 was irrelevant 2. Coarse graining 3. Phase equilibria 4. Applications

Advanced Monte Carlo Methods Problems

CHAPTER 6 Quantum Mechanics II

Lecture 8 - Carrier Drift and Diffusion (cont.), Carrier Flow. February 21, 2007

Lecture 7 - Carrier Drift and Diffusion (cont.) February 20, Non-uniformly doped semiconductor in thermal equilibrium

Markov Chain Monte Carlo Lecture 4

Improved diffusion Monte Carlo

MORTAL CREEPERS SEARCHING FOR A TARGET

MTH301 Calculus II Glossary For Final Term Exam Preparation

+ 1 3 x2 2x x3 + 3x 2 + 0x x x2 2x + 3 4

Entropy online activity: accompanying handout I. Introduction

Quantum Corrections for Monte Carlo Simulation

4/18/2011. Titus Beu University Babes-Bolyai Department of Theoretical and Computational Physics Cluj-Napoca, Romania

Monte Carlo and cold gases. Lode Pollet.

Contents. 1 Introduction and guide for this text 1. 2 Equilibrium and entropy 6. 3 Energy and how the microscopic world works 21

PHYSICAL REVIEW LETTERS

Summary of Last Time Barrier Potential/Tunneling Case I: E<V 0 Describes alpha-decay (Details are in the lecture note; go over it yourself!!) Case II:

Lecture 20: Spinodals and Binodals; Continuous Phase Transitions; Introduction to Statistical Mechanics

We consider the problem of finding a polynomial that interpolates a given set of values:

Lecture Notes Set 3a: Probabilities, Microstates and Entropy

CHAPTER 6 Quantum Mechanics II

Rotation of Axes. By: OpenStaxCollege

Markov Chain Monte Carlo (MCMC)

Lecture 9 - Carrier Drift and Diffusion (cont.), Carrier Flow. September 24, 2001

Quantum mechanics (QM) deals with systems on atomic scale level, whose behaviours cannot be described by classical mechanics.

G : Statistical Mechanics

First-Passage Kinetic Monte Carlo Algorithm for Complex Reaction-Diffusion Systems

Markov Chain Monte Carlo The Metropolis-Hastings Algorithm

Jim Lambers MAT 460 Fall Semester Lecture 2 Notes

Exploring the energy landscape

(# = %(& )(* +,(- Closed system, well-defined energy (or e.g. E± E/2): Microcanonical ensemble

Lecture 20 Reactor Theory-V

1. Introductory Examples

Lecture 14: Advanced Conformational Sampling

Lecture 2. Contents. 1 Fermi s Method 2. 2 Lattice Oscillators 3. 3 The Sine-Gordon Equation 8. Wednesday, August 28

If electrons moved in simple orbits, p and x could be determined, but this violates the Heisenberg Uncertainty Principle.

Simulated Annealing for Constrained Global Optimization

Monte Carlo Methods in Statistical Mechanics

Basics of Statistical Mechanics

MATH 425, HOMEWORK 3 SOLUTIONS

Computational Game Theory Spring Semester, 2005/6. Lecturer: Yishay Mansour Scribe: Ilan Cohen, Natan Rubin, Ophir Bleiberg*

Smart walking: A new method for Boltzmann sampling of protein conformations

L3 Monte-Carlo integration

POTENTIAL THEORY AND HEAT CONDUCTION DIRICHLET S PROBLEM

Computational Physics (6810): Session 13

Molecular Dynamics and Accelerated Molecular Dynamics

Monte Carlo simulations of harmonic and anharmonic oscillators in discrete Euclidean time

Lecture Notes on Support Vector Machine

Transcription:

Importance Sampling in Monte Carlo Simulation of Rare Transition Events Wei Cai Lecture 1. August 1, 25 1 Motivation: time scale limit and rare events Atomistic simulations such as Molecular Dynamics (MD) and Monte Carlo (MC) are playing an important role in our understanding of macroscopic behavior of materials in terms of the atomistic mechanisms. But the range of applicability of atomistic simulations is determined by their limits of time and length scales, see Fig. 1. While the length scale limit of atomistic simulations has been extended significantly through the use of massively parallel computing, the time scale limit is still a critical bottleneck to date. Figure 1: Time and length scale limits of atomistic simulations. Lecture notes and Matlab codes available at [1]. 1

To appreciate the time scale problem, consider the Molecular Dynamics simulation, which is essentially the numerical integration of the Newton s equation of motion for a collection of interacting atoms. For the numerical integration to be stable, the time step should be much smaller than the inverse of the maximum vibration frequency of the atoms, which is the Debye frequency in a solid. Therefore, a time step on the order of 1fs (1 15 second) is quite common. Thus even if the simulation is carried out for a million steps, we only cover a period of 1ns (1 9 second). This is approximately the upper time scale limit of today s atomistic simulations. On the other hand, there are many important processes for which the atomistic detail is important but which occurs at much longer time scales, ranging from 1ms (1 3 second) to many years ( 1 8 second). The enormous gap between the limit of Molecular Dynamics simulations and these demands are too big to be closed by massively parallel computing alone. E S kt B A x Figure 2: Typical energy landscape of many-body systems contains many local energy minima separated by energy barriers much higher than thermal energy (kt ). Transitions between energy basins can be rare events at the atomistic time scale. A typical reason for the appearance of this gap in the time scale can be traced to the energy landscape of typical many-body systems, which usually contains many local energy minima separated by energy barriers that are much higher than the thermal energy kt, where k is the Boltzmann s constant. Every deep energy minima (or energy basin) like this corresponds to a meta-stable state, in which the system could spend a long time before making a transition to a neighboring meta-stable state. The long time scale evolution of the system can be characterized by the transition of the system from one meta-stable state to another. However, because such transitions can be very rare, a direct Molecular Dynamics simulation is very inefficient to capture the long time scale behavior most of the computing cycle is wasted on faithfully tracing the quasi-equilibrium fluctuation of the system within a meta-stable state, which may not be of our interest at all. Similar problems can occur in Monte Carlo simulations as well. For example, consider a Monte Carlo simulation of a particle moving on a 2-dimensional energy landscape shown in Fig. 3(a). When the thermal energy kt is much lower than the energy barrier between the two metastable states (A and B), the particle spends a long time (in terms of Monte 2

1 x 1 (a) 1 2 3 N step / 1 5 (b) Figure 3: (a) Two-dimensional potential energy function V (x, y). The two meta-stable states, A for x < and B for x >, are separated by a ridge at x =. S 1 and S 2 mark locations of two saddles on the ridge. (b) Instantaneous values of coordinate x in an MC simulation at kt =.15. The energy barrier at the saddle points are on the order of 1. Carlo steps) in one state before jumping to the other one, as shown in Fig. 3(b). Again, when this is the case, Monte Carlo simulations are very inefficient in capturing the long time scale evolution of the system. The purpose of these lectures is to introduce an approach to address this problem, based on the idea of importance sampling [2]. The hope is that the discussions here will eventually lead to a robust numerical method that can significantly extend the time scale limit of Monte Carlo (and possibly Molecular Dynamics) simulations of complex atomistic systems. In these lectures, we will describe the idea with examples on low dimensional model systems, on which the importance sampling method for rare event sampling has been successfully developed [3, 4]. The idea of importance sampling of rare events can be summarized as the following. We may regard the entire trajectory of a Monte Carlo simulation as consisting of many short trajectories, or paths. Most of the paths start from the bottom of an energy basin and returns to the bottom of the same basin, such as paths 1, 1 2 and 2 3 in Fig. 4. These paths can be called failed paths. Very rarely a path may leave from the bottom of one basin and reach the bottom of another basin; such a path is called a successful path. The origin of the time scale problem is that the successful paths, while being very important to us, are sampled with very low efficiency. When the problem is formulated in this way, the importance sampling method seems to be a natural solution it is developed to bias the sampling procedure in such a way that the more important events (here the successful paths) are sampled with higher efficiency. Compared with the many other approaches proposed to address the time scale problem, using the importance sampling method is a relatively new approach, even though the importance sampling method has a long history by itself and has been successfully applied to numerous other situations. In the following, we will start our discussions with the original idea of importance sampling. The idea is best illustrated when Monte Carlo is used to compute the value of an integral. 3

Figure 4: Schematic representation of a reactive trajectory in an energy landscape with meta-stable states A and B. Such a trajectory can be sliced into a sequence of failed paths followed by a single successful path. A failed path is defined as a sequence of microstates that initiates in region A, exits it at some instant, but returns to it before reaching B. In contrast, a successful segment is defined as a sequence of states that initiates in A and succeeds in reaching B before returning to state A. The shown reactive trajectory consists of three failed paths, namely, the sequences of states 1, 1 2, and 2 3, and the successful path 3 4. 2 Monte Carlo computation of integrals Very often, the purpose of a Monte Carlo simulation can be reformulated as for computing the value of an integral. A typical example is to use Monte Carlo to evaluate the canonical ensemble average of a certain quantity, which may be expressed as a function of the positions of all atoms, e.g. A({r i }). The ensemble average of A is, A = 1 Q N i=1 [ dr i A({r i }) exp V ({r ] i}) kt (1) where Q = N i=1 [ dr i exp V ({r ] i}) kt (2) and N is the total number of atoms, V is the potential energy function, k is the Boltzmann s constant and T is the temperature. For large N, the dimension of the integral is too large to be carried out by numerical quadrature. Monte Carlo is a convenient method to evaluate this integral. By sampling a sequence of configurations, {r i } (m), m = 1,, M, that satisfies the probability distribution, f({r i }) = 1 [ Q exp V ({r ] i}) (3) kt 4

the ensemble average can be estimated from the numerical average [5], A MC = 1 M M A({r i } (m) ) (4) m=1 Contrary to the claims in [6], Eq. (4) is not importance sampling. As discussed below, we call something importance sampling if an importance function is introduced to further reduce the variance in the sampling. 2.1 One dimensional integral To illustrate the idea of importance sampling, let us consider the integration of a simple one-dimensional function, g(x) = 1 x 2. Suppose we wish to calculate, G = 1 1 x2 dx (5) Because G = π/4, we can regard this as a way to compute the numerical value of π. This example is a favorite one in many text books and was developed in detail in [2]. Thus this section may be regarded as an illustration of chapter 4 of [2]. 1.2 1 f(x) 1 1 2.8 1 4.6.4.2 g(x) error 1 6 1 8.2.2.4.6.8 1 x (a) 1 1 1 1 2 1 4 1 6 N (b) Figure 5: (a) g(x) = 1 x 2 and f(x) = 1 in domain x [, 1]. (b) Dots: error of estimating π/4 by Monte Carlo integration of 1 g(x)dx using N random numbers with distribution f(x). Solid line: σ 1 /N 1/2, where σ 1.223. (Matlab code mcint1d.m [1]) One way to compute this integral is to use numerical quadrature. trapezoidal rule gives, For example, the G 1 N N i=1 1 2 [g(x i 1) + g(x i )] (6) where x i = i/n. However, for illustration purposes, let us try to evaluate G by a Monte Carlo method. Instead of computing g(x) at regular intervals between and 1, let us draw N random 5

numbers x i, i = 1,, N that are independently and uniformly distributed in [, 1]. Let G N be the average of these random numbers, G N = 1 N N g(x i ) (7) i=1 Notice that G N is a random number itself. The expectation value of G N is G, i.e., G = G N (8) Mathematically, this means we rewrite G as, G = g(x)f(x) dx = g f (9) where f(x) is the distribution density function of the random variables, f(x) = 1 if x 1 and f(x) = otherwise. In other words, G is the average of function g(x) under distribution f(x). The variance of G N is var{g N } = σ2 1 N where var{g} = σ1 2 = (1) g 2 (x)f(x) dx G 2 (11) The error of G N in estimating G is comparable to the standard deviation of G N, i.e. error = ɛ σ 1 N 1/2 In this example, σ 2 1 = 2/3 (π/4) 2.498, σ 1.223. According to Eq. (12), we expect the error, G N π/4, should decay as.223/n 1/2 as the number N of random variables increase. This is confirmed by numerical results, as shown in Fig. 5(b). 2.2 Importance sampling in Monte Carlo integration Using a uniform distribution function f(x) is not necessarily the optimal way of doing Monte Carlo integration, in the sense that it does not necessarily give the smallest statistical fluctuation, i.e. var{g N }. Imagine that we use random variables that satisfy another density distribution function, f(x). Then the integral can be rewritten as, [ ] f(x)g(x) G = f(x) dx g(x) f(x) f(x) dx = g f (13) This means that G is also the expectation value of g(x) f(x)g(x)/ f(x) under distribution function f(x). The variance of this estimator is, [ ] 2 var{ g} = g 2 (x) f(x) f(x)g(x) f dx G 2 = f(x) dx G f(x) 2 2 (x)g 2 (x) = dx G f(x) 2 (14) 6 (12)

To illustrate that different distribution functions give rise to different variance, consider a family of f(x), f(x) = { (1 βx 2 )/(1 β/3), x 1, otherwise Notice that when β =, f(x) corresponds to the uniform distribution considered above. Fig. 6(a) shows the numerical error of G N (compared with π/4) as a function of N (number of random variables) for β = and β =.74. The error is systematically lower in the β =.74 case, which scales as.54/n 1/2. The variance of g under distribution function f can be obtained analytically [2], ( var{ g} = 1 β ) [ 1 3 β 1 β ] ( π ) 2 β 3/2 tanh 1 β 1/2 (16) 4 It is plotted in Fig. 6(b). The variance reaches a minimum at β.74. This means that, among the family of importance functions given in Eq. (15), the one with Eq. (15) is the (local) optimal. (15) 1 1 2 β=.5.4 error 1 4 β=.74 var{g}.3.2 1 6.1 1 8 1 1 2 1 4 1 6 N.2.4.6.8 1 β Figure 6: (a) Error of Monte Carlo integration as a function of N, the number of random variables which are distributed according to f(x) = (1 βx 2 )/(1 β/3). (b) Variation of g(x) as a function of β. (Matlab code mcint1d imp.m [1]) Exercise: for f(x) = (1 βx)/(1 β/2), derive var{ g} and the optimal value of β. Plot numerical error of g f as a function of N (as in Fig. 6(a)) for β = and the (local) optimal value of β. What is the optimal importance function f among all possible functions? To answer this question, we should minimize var{ g} with respect to f under the constraint that f(x)dx = 1, f(x) (because f is a probability distribution function). Introduce Lagrangian multiplier λ, we wish to minimize a functional [2], L{ f} f 2 (x)g 2 (x) = + λ f(x) f(x) dx (17) At the minimum, δl δ f = (x)g 2 (x) f2 + λ = (18) f 2 (x) 7

Hence, f(x) = λ g(x)f(x) The normalization condition of f(x) demands that λ = 1/G, so that the (global) optimal importance function is, (19) f(x) = 1 G g(x)f(x) (2) Notice that when the (global) optimal importance function is used, g(x) = G f(x)g(x) f(x)g(x) If g(x) is non-negative, this means that g(x) is a constant, and equals G. Therefore, when the (global) optimal importance function is used, the statistical variance is zero, because every random number gives identical contribution to the integral. This finding is not surprising because whenever g(x) is not a constant, there is always a finite variance when computing its average. Zero variance is reached if and only if g(x) is a constant. Unfortunately, the (global) optimal importance function contains the information of the answer we were after (G) in the first place. This means finding the (global) optimal importance function is not easier than finding the integral G itself. Thus for practical purposes, we need to assume that we do not have the (global) optimal importance function when we compute G. Fortunately, even if f is not the (global) optimum, it can still reduce the statistical variance of the estimate of G. The closer f is to the (global) optimum, the smaller the variance becomes. Therefore, the importance sampling method is usually accompanied by the effort to improve the importance function. 3 Random walks, differential and integral equations Usually, Monte Carlo simulations use a Markov process to generate a sequence of random variables to be used in the numerical integration. In this case, the system may be regarded as doing random walks in the phase space. We have already seen the connection between the Monte Carlo method and integrals. This is closely related to the (probably even deeper) connection between random walks and integral equations [2, 8, 9] and partial differential equations (PDEs) [7]. Consider the random walk problem (or game) shown in Fig. 7. The walkers move on discrete lattice points (with lattice spacing a) in domain Ω, with boundary Γ. The walker start at point x with probability distribution s(x) (source function), with s(x)dx = 1. Ω At every step, the walker may be terminated with probability q(x). Otherwise, it moves to one of its adjacent lattice points with equal probabilities. The walker accumulates a score g(x) (gain function) whenever it visits point x. Suppose we wish to compute G, which is the average score a walker accumulates from its start until it is terminated. Let ψ(x) be the probability that a walker visits point x before its termination, then G can be expressed as an integral, G = ψ(x)g(x)dx (22) Ω 8 (21)

Figure 7: A random walk in a 2-dimensional domain Ω with boundary Γ. The walker start at point x with probability distribution s(x) (source function). At every step, the walker may be terminated with probability q(x). Otherwise, it moves to one of its adjacent lattice points with equal probabilities. The walker accumulates a score g(x) (gain function) whenever it visits point x. Question: what is the expression for G if the score is counted only when the path is terminated? Note that we may demand q(x) = 1 at x Γ. This corresponds to the absorbing boundary condition. On the other hand, domain Ω can also be infinitely large for which Γ does not exist. We may also let g(x) to be zero everywhere in Ω except in Γ and let g(x) = 1 on Γ. Then G describes the possibility of the random walkers to escape from domain Ω without being absorbed (such as the escape of radiation from a container). We can imagine that s(x) describes a drug delivery device (implant), Ω is the tissue that the drug diffuses through (which may also absorb the drug molecules), and g(x) describe the diseased tissue (target, e.g. cancer cells). G the characterizes the effectiveness of the drug delivery device. 3.1 Partial differential equation How do we compute G? One way to do so is to first compute ψ(x) at all x Ω and perform the integral in Eq. (22) by numerical quadrature. In the continuum limit (a ), ψ(x) satisfies the following partial differential equation (PDE), a 2 2 ψ(x) q(x)ψ(x) = s(x) (23) 9

This is simply a absorption-diffusion equation. The problem with this approach is that, it can be very wasteful since we only want to know the value of G, which is a weighted integral of ψ(x). Yet we obtained ψ(x) at every point x in Ω. For example, g(x) may be non-zero only in a small region of Ω. Hence, in principle, we do not need to know ψ(x) in the rest region of Ω. Ω may also be infinite, in which case it may not be possible to store values of ψ(x) everywhere in Ω. 3.2 Monte Carlo simulation Another approach is to perform Monte Carlo simulation of the random walkers according to the prescribed rules, and estimate G by averaging the gain function g(x) over the locations where the walkers have visited. Suppose we initiate N walkers, then G N = 1 N N g(x (n) i ) (24) n=1 i is an estimate of G, where x (m) i is the location of walker m at step i. The potential problem of this approach is that the efficiency may be very low, if the majority of the walkers do not visit regions where g(x) >. For example, consider the case when g(x) = 1 in a small region of Ω that is separated from the region where s(x) = 1 and that the termination rate q(x) is high compared in the entire domain Ω. Also assume that q(x) = 1 at locations where g(x) = 1, i.e. the walkers terminate immediately after it scores (but the majority of the walkers terminate at g(x) =, i.e. without score). Let p be the probability that the walker makes a non-zero contribution (g(x) = 1) to the total score G, then, G = G N = p The variance of G N is, var{g N } = p(1 p) N so that the error in estimating G is approximately, error = ɛ p1/2 (1 p) 1/2 N 1/2 In the limit of p 1, (25) (26) (27) ɛ p1/2 N 1/2 and the relative error is, ɛ G 1 (pn) 1/2 Thus we obtain meaningful results only if N 1/p. For example, if p 1 6, the N needs to be 1 8 to achieve a relative error of 1%. 1 (28) (29)

3.3 Integral equation and importance sampling To achieve a lower variance in computing G with smaller number of random variables, importance sampling is a promising method. Recall that importance sampling is useful to reduce variance when computing an integral. To apply importance sampling here, we first notice that the walker distribution function ψ(x) satisfies the following integral equation (which is a counterpart of the PDE in Eq. (23)), ψ(x) = s(x) + K(y x)ψ(y) dy (3) where K(y x) is the transition probability of the random walkers. In this example, K(y x) = (1 q(y))/4 if x is one of the four nearest neighbors of y; otherwise, K(y x) =. Let us now introduce an importance function I(x) for x Ω. Define S = I(x)s(x) dx (31) Multiply both sides of Eq. (3) by I(X)/S, we obtain, Define ψ(x) I(x)ψ(x) S = s(x)i(x) + S = s(x)i(x) + S s(x) s(x)i(x) S K(y x) K(y x) I(x) I(y) K(y x) I(x) I(y)ψ(y) dy I(y) S (32) K(y x) I(x) I(y) ψ(y) dy (33) notice that s(x) dx = 1, we have, ψ(x) = s(x) + K(y x) ψ(x) dy (36) which is a new integral equation relating ψ, s and K. And the award function can be rewritten as, g(x) G = g(x)ψ(x) = S I(x) ψ(x) dx g(x) ψ(x) dx (37) where g(x) S g(x)/i(x). This means that, we can estimate G by simulating random walkers according to the transition probability matrix K(Y X). Suppose one path is sampled following K(Y X), which visits locations {x 1, x 2,, x l }, then (34) (35) G S l i=1 g(x i ) I(x i ) (38) 11

4 35 2 3 1.5 y 25 2 15 ψ 1.5 1 5 1 2 3 4 x (a) 4 2 y 1 (b) x 2 3 4.55 3 x 1 3 2.5.5 2 G error 1.5.45 1.5.4 1 2 3 4 µ (c) 1 2 3 4 µ (d) Figure 8: (a) Random walk is within the (red) rectangle on a square lattice with spacing a = 1. The source function s(x) equals 1 at the circle and zero everywhere else. The contour line of ψ(x) in (b) is also plotted. (b) The density distribution ψ(x) from 1 random walkers. (c) Estimates of G using importance functions with different parameter µ. (d) Standard deviation of estimates in (c) as a function of µ. 12

In the new random walk, the walker distribution density is ψ(x). The variance is reduced if there is a significant overlap between regions where ψ(x) > and g(x) >. To give a specific example, consider a rectangular domain shown in Fig. 8(a). The source function s(x) equals 1 at one point x (marked by the circle) and zero everywhere else. The gain function g(x) = and the termination probability q(x) = r (r =.5) everywhere inside Ω except at boundary Γ. At boundary Γ, g(x) = 1 and q(x) = 1. Thus G is the probability of the walkers escaping (reaching Γ) before being absorbed at the interior of Ω. The distribution ψ(x) estimated from 1 random walkers are plotted in Fig. 8(b). We notice that most of the walkers terminate at the interior of Ω. The estimated value from 1 4 walkers is G 4.84 ±.28 1 2. Suppose we use the importance function of the following form, I(x) = exp [ µ exp ( α x x 2)] (39) Fig. 8(c) plots the estimate of G for different values of µ when α =.3 from 1 4 walkers. The standard deviation of these estimates are plotted in Fig. 8(d). We observed that µ 3 is the optimal value giving rise to the lowest statistical error. References [1] More materials of these lectures are available at http://micro.stanford.edu/ caiwei/llnl-ccms-25-summer/ [2] M.H. Kalos and P. A. Whitlock, Monte Carlo Methods, Volume I: Basics, (Wiley, New York, 1986). [3] W. Cai, M. H. Kalos, M. de Koning and V. V. Bulatov, Importance sampling of rare transition events in Markov processes, Phys. Rev. E 66, 4673 (22). [4] M. de Koning, W. Cai, B. Sadigh, T. Oppelstrup, M. H. Kalos, and V. V. Bulatov, Adaptive importance sampling Monte Carlo simulation of rare transition events, J. Chem. Phys. 122, 7413 (25). [5] D. Frenkel and B. Smit, Understanding Molecular Simulations: from Algorithms to Applications, (Academic Press, San Diego, 22). [6] M. P. Allen and D. J. Tildesley, Computer Simulation of Liquids, (Oxford University Press, 1987). [7] L. C. Evans, An Introduction to Stochastic Differential Equations, Department of Mathematics, UC Berkeley, http://math.berkeley.edu/ evans/sde.course.pdf. [8] R. P. Feynman, The Principle of Least Action in Quantum Mechanics, Ph.D. Thesis, Princeton University, May, 1942. [9] B. Dynkin and A. A. Yshkevich, Markov Processes: Theorems and Problems, (Plenum Press, New York, 1969). 13

Importance Sampling in Monte Carlo Simulation of Rare Transition Events Wei Cai Lecture 2. August 2, 25 4 35 2 3 1.5 y 25 2 15 ψ 1.5 1 5 1 2 3 4 x (a) 4 2 y 1 (b) x 2 3 4 1 log 1 J 2 3 4 2 y (c) 1 x 2 3 4 Figure 1: (a) Contour line of the exact solution of the walker density distribution function ψ(x), which satisfies the integral equation, ψ(x) = s(x) + ψ(y)k(y x) dy. G = ψ(x)g(x) dx = 4.6844 1 2. (diffuse2d exact sol.m) (b) 3D plot of ψ(x). (c) Exact solution of the optimal importance function J(x), which satisfies the integral equation, J(x) = g(x) + K(x y)j(y) dy. G = J(x)s(x) dx = 4.6844 1 2. (diffuse2d opt imp.m) Notes and Matlab codes available at http://micro.stanford.edu/ caiwei/llnl-ccms-25-summer/ 1

1-b b

Importance Sampling in Monte Carlo Simulation of Rare Transition Events Wei Cai Lecture 3. August 3, 25 1.5 E 3 2 1 y 1.5.5 1 2 y 2 (a) 2 1 x 1 2 1 1.5 1.5 1.5.5 1 1.5 x (b) 5 ψ 1 15 2 1 log 1 J 5 1 y 1 2 2 1 1 2 x (c) 15 2 y 2 2 (d) x 2 Figure 1: (a)2d potential landscape. (b) Contour plot of (a). Circle: q(x) = 1, g(x) =. Cross: q(x) = 1, g(x) = 1. (c) Exact solution of walker density ψ(x). Average gain G = ψ(x)g(x)dx = 2.7598 1 12. (d) Exact solution of optimal importance function J(x, y). G = s(x)j(x)dx = 2.7598 1 12. (pot2d exact sol.m) Notes and Matlab codes available at http://micro.stanford.edu/ caiwei/llnl-ccms-25-summer/ 1