In this approach, the ground state of the system is found by modeling a diffusion process.

Similar documents
2 2 mω2 x 2 ψ(x) = Eψ(x),

Molecular Dynamics Simulation of Argon

The Monte Carlo Algorithm

Cluster Algorithms to Reduce Critical Slowing Down

Numerical solution of the time-independent 1-D Schrödinger equation. Matthias E. Möbius. September 24, 2010

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

The dynamics of small particles whose size is roughly 1 µmt or. smaller, in a fluid at room temperature, is extremely erratic, and is

A path integral approach to the Langevin equation

Computational Physics Lectures: Variational Monte Carlo methods

Methods of Fermion Monte Carlo

From Random Numbers to Monte Carlo. Random Numbers, Random Walks, Diffusion, Monte Carlo integration, and all that

C++ For Science and Engineering Lecture 14

BROWNIAN DYNAMICS SIMULATIONS WITH HYDRODYNAMICS. Abstract

QCD on the lattice - an introduction

This is a Gaussian probability centered around m = 0 (the most probable and mean position is the origin) and the mean square displacement m 2 = n,or

5.1 Classical Harmonic Oscillator

Computational Physics (6810): Session 13

University of Michigan Physics Department Graduate Qualifying Examination

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:

Improved diffusion Monte Carlo

Stochastic Particle Methods for Rarefied Gases

Markov Processes. Stochastic process. Markov process

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

Exercises Lecture IV : Random Walks

MATH325 - QUANTUM MECHANICS - SOLUTION SHEET 11

Random Walks A&T and F&S 3.1.2

Created: 2/3/96 Modified: September 29, Author: Theresa Julia Zielinski Page 1

Noise, AFMs, and Nanomechanical Biosensors

C++ For Science and Engineering Lecture 17

C C C C 2 C 2 C 2 C + u + v + (w + w P ) = D t x y z X. (1a) y 2 + D Z. z 2

Monte Carlo integration (naive Monte Carlo)

STRUCTURE OF MATTER, VIBRATIONS AND WAVES, AND QUANTUM PHYSICS

One-dimensional Schrödinger equation

1 Introduction. 2 Diffusion equation and central limit theorem. The content of these notes is also covered by chapter 3 section B of [1].

Analysis of the simulation

CHAPTER 6 Quantum Mechanics II

Langevin Methods. Burkhard Dünweg Max Planck Institute for Polymer Research Ackermannweg 10 D Mainz Germany

Chapter 5 - Systems under pressure 62

Classical Monte Carlo Simulations

Feshbach-Schur RG for the Anderson Model

2.3 Damping, phases and all that

The search for the nodes of the fermionic ground state

Quantum Mechanics II

Fluid-Particles Interaction Models Asymptotics, Theory and Numerics I

Quantum Mechanics + Open Systems = Thermodynamics? Jochen Gemmer Tübingen,

Harmonic Oscillator (9) use pib to think through 2012

Physics 562: Statistical Mechanics Spring 2003, James P. Sethna Homework 5, due Wednesday, April 2 Latest revision: April 4, 2003, 8:53 am

kg meter ii) Note the dimensions of ρ τ are kg 2 velocity 2 meter = 1 sec 2 We will interpret this velocity in upcoming slides.

The goal of equilibrium statistical mechanics is to calculate the diagonal elements of ˆρ eq so we can evaluate average observables < A >= Tr{Â ˆρ eq

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

UNIVERSITY OF SURREY FACULTY OF ENGINEERING AND PHYSICAL SCIENCES DEPARTMENT OF PHYSICS. BSc and MPhys Undergraduate Programmes in Physics LEVEL HE2

Monte Carlo (MC) Simulation Methods. Elisa Fadda

4. Complex Oscillations

Brownian Motion and Langevin Equations

UNIVERSITY OF OSLO FACULTY OF MATHEMATICS AND NATURAL SCIENCES

UNIVERSITY OF MISSOURI-COLUMBIA PHYSICS DEPARTMENT. PART I Qualifying Examination. January 20, 2015, 5:00 p.m. to 8:00 p.m.

Non-equilibrium phenomena and fluctuation relations

Plasma Astrophysics Chapter 1: Basic Concepts of Plasma. Yosuke Mizuno Institute of Astronomy National Tsing-Hua University

1 Brownian motion and the Langevin equation

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

Metropolis/Variational Monte Carlo. Microscopic Theories of Nuclear Structure, Dynamics and Electroweak Currents June 12-30, 2017, ECT*, Trento, Italy

New Physical Principle for Monte-Carlo simulations

MORTAL CREEPERS SEARCHING FOR A TARGET

Transport (kinetic) phenomena: diffusion, electric conductivity, viscosity, heat conduction...

Phase Equilibria and Molecular Solutions Jan G. Korvink and Evgenii Rudnyi IMTEK Albert Ludwig University Freiburg, Germany

3.320 Lecture 18 (4/12/05)

Computational Simulations of Magnets at High Temperatures Utilizing the Ising Model and the Monte Carlo Technique

Gear methods I + 1/18

Quantum Monte Carlo study of one-dimensional bosons with finite range interactions

CHAPTER 6 Quantum Mechanics II

Diffusion Monte Carlo

Chemistry 432 Problem Set 4 Spring 2018 Solutions

CHAPTER V. Brownian motion. V.1 Langevin dynamics

Coarsening process in the 2d voter model

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

8.6 Drag Forces in Fluids

8.05 Quantum Physics II, Fall 2011 FINAL EXAM Thursday December 22, 9:00 am -12:00 You have 3 hours.

You may not start to read the questions printed on the subsequent pages until instructed to do so by the Invigilator.

Metropolis Monte Carlo simulation of the Ising Model

Advanced Monte Carlo Methods Problems

GEM4 Summer School OpenCourseWare

The Gross-Pitaevskii Equation and the Hydrodynamic Expansion of BECs

CHM 532 Notes on Wavefunctions and the Schrödinger Equation

Physics 4488/6562: Statistical Mechanics Material for Week 2 Exercises due Monday Feb 5 Last

An introduction to Liouville Quantum Field theory

Lecture 3: From Random Walks to Continuum Diffusion

Recurrences and Full-revivals in Quantum Walks

Solution. For one question the mean grade is ḡ 1 = 10p = 8 and the standard deviation is 1 = g

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

Brownian motion and the Central Limit Theorem

CONVERGENCE OF A NUMERICAL METHOD FOR SOLVING DISCONTINUOUS FOKKER PLANCK EQUATIONS

C. Show your answer in part B agrees with your answer in part A in the limit that the constant c 0.

Pedestrian traffic models

In-class exercises Day 1

Quantum Mechanical Simulations

Lecture #8: Quantum Mechanical Harmonic Oscillator

Typicality paradigm in Quantum Statistical Thermodynamics Barbara Fresch, Giorgio Moro Dipartimento Scienze Chimiche Università di Padova

Exercises : Questions

The Kramers problem and first passage times.

Jackson, Classical Electrodynamics, Section 14.8 Thomson Scattering of Radiation

Transcription:

The Diffusion Monte Carlo (DMC) Method In this approach, the ground state of the system is found by modeling a diffusion process. Diffusion and random walks Consider a random walk on a lattice with spacing a in one dimension. The rule for the walk is that if the walker is at position x at time t, then at time t + h, the walker moves to the neighbor sites x ± a with equal probabilities α and remains at x with probability 1 2α: the sum of the three probabilities add up to 1. Let s consider an ensemble of a large number of such walkers. The number density of walkers is ρ(x, t), which means that, at time t, the number of walkers between x and x + dx is ρ(x, t)dx. Note: each walker moves on a lattice, but the lattices of different walkers are in general different. The master equation ρ(x, t + h) ρ(x, t) = αρ(x + a, t) + αρ(x a, t) 2αρ(x, t), says that the density of walkers at x increases in one time step h due to walkers from x ± a moving to x with probability α, and decreases due to walkers moving from x to x ± a with probability α. If h and a are both small we can use Taylor expansions ρ(x, t + h) = ρ(x, t) + h ρ t +... ρ(x ± a, t) = ρ(x, t) ± a ρ x + 1 ρ 2 a2 2 x +... 2 PHY 411-506 Computational Physics 2 1 Wednesday, April 9

In the continuum limit h 0, a 0 with a 2 /h held constant, we obtain the diffusion equation ρ t = γ 2 ρ x, 2 where αa 2 γ lim h,a 0 h, is called the diffusion constant for the system of walkers. Green s function for the diffusion equation The density of walkers at time t can be computed from the initial density using the formula 1 ρ(y, t) = dx G(x, y; t)ρ(x, 0), G(x, y; t) = e (x y)2 /(4γt), 4πγt where G(x, y; t) is a Green s function with the properties G(x, y; 0) = δ(x y), and dx G(x, y; t) = 1. PHY 411-506 Computational Physics 2 2 Wednesday, April 9

Green s function for diffusion 4 3.5 t = 0.01 t = 0.10 t = 1.00 t = 10.0 3 2.5 G(x,0;t) 2 1.5 1 0.5 0-5 -4-3 -2-1 0 1 2 3 4 5 x In fact, G(x, y; t) is the probability that a walker at x (or y) at time t = 0 moves to y (or x) at time t. This provides a way of implementing the random walk: Choose a step size t in time PHY 411-506 Computational Physics 2 3 Wednesday, April 9

A walker at x(t) at time t moves to x(t + t) = x(t) + η t, where η is chosen randomly from a Gaussian distribution with variance σ 2 = 2γ. Let s consider this step as a trial step in the Metropolis algorithm. Do we need to make a Metropolis type test before accepting the step? The answer is no, because the step is chosen according to a probability function which drives the distribution exactly to equilibrium as a function of time t. Another way of seeing that every step can be accepted is from the physical meaning of diffusion. Typically, we have a dilute collection of non-interacting particles in a medium which can be considered to be a heat bath at constant temperature T. The particles undergo random thermal motion due to collisions with the molecules of the medium. The temperature of the medium determines the diffusion constant via Einstein s relation γ = k BT β, where β is the drag coefficient, e.g., β = 6πηR for Brownian spheres of radius R moving in fluid with kinematic viscosity η (not to be confused with the Gaussian deviate in the step). Since the diffusing particles are non-interacting, there is no energy cost when they move. PHY 411-506 Computational Physics 2 4 Wednesday, April 9

Connection with quantum mechanics Consider the time-dependent Schrödinger equation for a free particle moving in one dimensions: ψ(x, t) i t = 2 2 ψ(x, t), 2m x 2 where m is the mass of the particle. This equation can be written ψ(x, t) t = i 2 ψ(x, t) 2 ψ(x, t) = γ 2m x 2 im, x 2 which is exactly of the form of a diffusion equation, but with and imaginary diffusion constant γ im = i 2m. Another way to write this equation with a real diffusion constant is to analytically continue the time t iτ to imaginary values: ψ(x, τ) = 2 ψ(x, τ). τ 2m x 2 Thus the motion of a quantum particle is equivalent to diffusion of a cloud of particles in imaginary time! PHY 411-506 Computational Physics 2 5 Wednesday, April 9

Diffusion leads the system into its ground state Any initial wave function of the system can be expanded in a complete set of energy eigenfunctions: Ψ(x, 0) = c n ψ n (x). The solution of the real time Schrödinger equation is then Ψ(x, t) = c n e ient/ ψ n (x). n=0 n=0 The solution of the imaginary time equation is got by analytically continuing this solution to imaginary time t iτ: Ψ(x, τ) = c n e Enτ/ ψ n (x). n=0 As τ, each mode in this equation is exponentially damped, with higher energies damped faster than lower energies. The ground state wave function can be extracted using the following limit: lim τ ee 0τ/ Ψ(x, τ) = lim c n e (E n E 0 )τ/ ψ n (x) = c 0 ψ 0 (x). τ This result is the basis of the diffusion Monte Carlo approach. n PHY 411-506 Computational Physics 2 6 Wednesday, April 9

Diffusion with a potential energy term The equations considered above were for a free particle. A free particle is not very interesting, so let s generalize this approach to a particle moving in a potential V (x) for which the imaginary time equation to be solved is ψ(x, τ) = 1 2 ψ(x, τ) V (x)ψ(x, τ), τ 2 x 2 where we have set = 1 and m = 1. We have seen that if V = 0, then this equation can be solved using a Green s function ρ(y, τ) = dx G(x, y; τ)ρ(x, 0), G(x, y; τ) = 1 e (x y)2 /(2τ), 2πτ for the probability density ρ(x, τ) = ψ(x, τ) 2. This solution preserves probability (or total number of particles in the diffusion problem). The problem with adding the potential energy term is that it spoils this conservation of probability. This can be seen by neglecting the kinetic energy term: ψ(x, τ) τ = V (x)ψ(x, τ), ψ(x, τ) = e V (x)τ ψ(x, 0), PHY 411-506 Computational Physics 2 7 Wednesday, April 9

which implies that lim ψ(x, τ) = τ 0 where V (x) > 0 ψ(x, 0) where V (x) = 0 where V (x) < 0 Depending on the potential, the net probability dx ψ(x, τ) 2 could go to zero or to infinity! In the diffusion Monte Carlo method, this problem with the potential energy term is solved by modifying the equation as follows: ψ(x, τ) = 1 2 ψ(x, τ) (V (x) E τ 2 x 2 T )ψ(x, τ), where the quantity E T is adjusted as a function of τ so that the probability (number of walkers in the diffusion approach) remains constant. If in the limit τ the solution ψ(x, τ) ψ(x) becomes independent of τ, i.e., ψ/ τ = 0, then 1 d 2 ψ(x) + V (x)ψ(x) = E 2 dx 2 T ψ(x), that is, ψ(x, τ) tends to an eigenfunction of the quantum mechanical problem, and E T eigenvalue! is the energy PHY 411-506 Computational Physics 2 8 Wednesday, April 9

Diffusion Monte Carlo algorithm The DMC algorithm is based on the ideas that the kinetic energy term can be represented by diffusion of random walkers, and the potential energy causes the number of walkers at a given point x to grow or decay. A simple form of the algorithm is as follows: Initialization: Choose a time step τ and a target number N T of random walkers which are randomly located in a region where the wave function is expected to be large. Also choose a value for the parameter E T. Time Step: The following two operations are carried out on each of the current number N of walkers: Diffusion Step: The kinetic energy shifts the walker to a new position with a step chosen at random from a Gaussian distribution with variance t, exactly as in the case of a free particle. Branching Step: The potential energy, modified by the E T parameter, causes a growth or decay in the number of walkers. This effect is implemented by computing q = e τ[v (x) E T]. The value of q determines whether this walker dies, survives, or is cloned. Note that q > 0. Let q be its integer part. Then q q lies between 0 and 1. The walker is replaced with q identical copies with probability 1 (q q ) and q + 1 copies with probability q q. Adjusting the value of E T : At the end of the time step, the number of walkers N will have changed due to branching. If N > N T, then we need to increase E T which will tend to reduce q and hence tend PHY 411-506 Computational Physics 2 9 Wednesday, April 9

to kill walkers. Conversely, if N < N T, then reducing E T will increase q and hence tend to generate more clones. This can be done for example by letting ( ) NT E T E T + α ln, N where α is a small positive parameter. Diffusion Monte Carlo program for the 3-D harmonic oscillator The following program implements the DMC algorithm outlined above for the 3-D harmonic oscillator which has ground state energy and wave function using units with m = ω = = 1. E 0 = 3 2, ψ 0 = e r2 /2 (2π) 3/2, // Diffusion Monte Carlo program for the 3-D harmonic oscillator dmc.cpp #include <cmath> #include <cstdlib> #include <fstream> PHY 411-506 Computational Physics 2 10 Wednesday, April 9

#include <iostream> using namespace std; #include "../tools/random.hpp" const int DIM = 3; // dimensionality of space Potential energy function This function evaluates the potential energy of the harmonic oscillator in D dimensions given the position r of the oscillator. double V(double *r) { // harmonic oscillator in DIM dimensions double rsqd = 0; for (int d = 0; d < DIM; d++) rsqd += r[d] * r[d]; return 0.5 * rsqd; dmc.cpp double dt; // Delta_t set by user PHY 411-506 Computational Physics 2 11 Wednesday, April 9

double E_T; // random walkers int N; int N_T; double **r; bool *alive; // target energy // current number of walkers // desired target number of walkers // x,y,z positions of walkers // is this walker alive? Dynamical adjustment of array storage Since the number of walkers N will change with time, we can either allocate large-enough arrays to accomodate this growth, or we can grow the arrays dynamically if necessary while the program is running. The following function is called when the N might have changed and we wish to check whether an index is legal. If the array is too small to accomodate that index, it is replaced with a larger array with the values of the original elements preserved. This can also be achieved automatically by using C++ std::vector objects instead of dynamically allocated arrays. The resize member function changes the number of components of the vector without changing the values of components in the smaller of the old and new vectors. dmc.cpp PHY 411-506 Computational Physics 2 12 Wednesday, April 9

void ensurecapacity(int index) { static int maxn = 0; if (index < maxn) return; int oldmaxn = maxn; if (maxn > 0) maxn *= 2; else maxn = 1; if (index > maxn - 1) maxn = index + 1; // remember the size of the array // no need to expand array // do nothing // remember the old capacity // double capacity // if this is not sufficient // increase it so it is sufficient // allocate new storage double **rnew = new double* [maxn]; bool *newalive = new bool [maxn]; for (int n = 0; n < maxn; n++) { rnew[n] = new double [DIM]; if (n < oldmaxn) { // copy old values into new arrays for (int d = 0; d < DIM; d++) PHY 411-506 Computational Physics 2 13 Wednesday, April 9

rnew[n][d] = r[n][d]; newalive[n] = alive[n]; delete [] r[n]; // release old memory delete [] r; // release old memory r = rnew; // point r to the new memory delete [] alive; alive = newalive; We need to measure the energy, its variance, and the wave function of the ground state. // observables double ESum; double ESqdSum; double rmax = 4; const int NPSI = 100; double psi[npsi]; void zeroaccumulators() { // accumulator for energy // accumulator for variance // max value of r to measure psi // number of bins for wave function // wave function histogram dmc.cpp PHY 411-506 Computational Physics 2 14 Wednesday, April 9

ESum = ESqdSum = 0; for (int i = 0; i < NPSI; i++) psi[i] = 0; void initialize() { N = N_T; for (int n = 0; n < N; n++) { ensurecapacity(n); for (int d = 0; d < DIM; d++) r[n][d] = uniform_dist() - 0.5; alive[n] = true; zeroaccumulators(); E_T = 0; // set N to target number specified by user // initial guess for the ground state energy PHY 411-506 Computational Physics 2 15 Wednesday, April 9

One Diffusion Monte Carlo step The following function implements the Diffusion Monte Carlo step algorithm on a particular walker. Recall that A Gaussian diffusive step is taken with step size t. A branching step is implemented with the walker dying, surviving or being cloned, depending on its potential energy. void onemontecarlostep(int n) { dmc.cpp // Diffusive step for (int d = 0; d < DIM; d++) r[n][d] += normal_dist() * sqrt(dt); // Branching step double q = exp(- dt * (V(r[n]) - E_T)); int survivors = int(q); if (q - survivors > uniform_dist()) ++survivors; PHY 411-506 Computational Physics 2 16 Wednesday, April 9

// append survivors-1 copies of the walker to the end of the array for (int i = 0; i < survivors - 1; i++) { ensurecapacity(n); for (int d = 0; d < DIM; d++) r[n][d] = r[n][d]; alive[n] = true; ++N; // if survivors is zero, then kill the walker if (survivors == 0) alive[n] = false; One time step t One time step t consists in the following: One DMC step is performed on each walker in turn. PHY 411-506 Computational Physics 2 17 Wednesday, April 9

To make the living walkers easier to access, dead walkers are removed from the arrays. E T is adjusted to drive N towards N T. Data is accumulated to measure E, its variance, and the ground state wave function. void onetimestep() { dmc.cpp // DMC step for each walker int N_0 = N; for (int n = 0; n < N_0; n++) onemontecarlostep(n); // remove all dead walkers from the arrays int newn = 0; for (int n = 0; n < N; n++) if (alive[n]) { if (n!= newn) { for (int d = 0; d < DIM; d++) r[newn][d] = r[n][d]; alive[newn] = true; PHY 411-506 Computational Physics 2 18 Wednesday, April 9

++newn; N = newn; // adjust E_T E_T += log(n_t / double(n)) / 10; // measure energy, wave function ESum += E_T; ESqdSum += E_T * E_T; for (int n = 0; n < N; n++) { double rsqd = 0; for (int d = 0; d < DIM; d++) rsqd = r[n][d] * r[n][d]; int i = int(sqrt(rsqd) / rmax * NPSI); if (i < NPSI) psi[i] += 1; PHY 411-506 Computational Physics 2 19 Wednesday, April 9

The main function to steer the calculation The user specifies the number of walkers, the time step size, and number of time steps. After initialization, 20% of the specified number of time steps are run to equilibrate the walkers. Then the production steps are taken. The Monte Carlo wave function and the exact wave function, both normalized unity in the plotting interval, are output to a file. int main() { dmc.cpp cout << " Diffusion Monte Carlo for the 3-D Harmonic Oscillator\n" << " -----------------------------------------------------\n"; cout << " Enter desired target number of walkers: "; cin >> N_T; cout << " Enter time step dt: "; cin >> dt; cout << " Enter total number of time steps: "; int timesteps; cin >> timesteps; initialize(); PHY 411-506 Computational Physics 2 20 Wednesday, April 9

// do 20% of timesteps as thermalization steps int thermsteps = int(0.2 * timesteps); for (int i = 0; i < thermsteps; i++) onetimestep(); // production steps zeroaccumulators(); for (int i = 0; i < timesteps; i++) { onetimestep(); // compute averages double EAve = ESum / timesteps; double EVar = ESqdSum / timesteps - EAve * EAve; cout << " <E> = " << EAve << " +/- " << sqrt(evar / timesteps) << endl; cout << " <E^2> - <E>^2 = " << EVar << endl; double psinorm = 0, psiexactnorm = 0; double dr = rmax / NPSI; for (int i = 0; i < NPSI; i++) { double r = i * dr; psinorm += pow(r, DIM-1) * psi[i] * psi[i]; psiexactnorm += pow(r, DIM-1) * exp(- r * r); PHY 411-506 Computational Physics 2 21 Wednesday, April 9

psinorm = sqrt(psinorm); psiexactnorm = sqrt(psiexactnorm); ofstream file("psi.data"); for (int i = 0; i < NPSI; i++) { double r = i * dr; file << r << \t << pow(r, DIM-1) * psi[i] / psinorm << \t << pow(r, DIM-1) * exp(- r * r / 2) / psiexactnorm << \n ; file.close(); PHY 411-506 Computational Physics 2 22 Wednesday, April 9

Output of the program 0.25 DMC wave function for 3-D Harmonic Oscillator Monte Carlo Exact 0.2 0.15 r^2 psi(r) 0.1 0.05 0 0 0.5 1 1.5 2 2.5 3 3.5 4 r Diffusion Monte Carlo for the 3-D Harmonic Oscillator ----------------------------------------------------- junk PHY 411-506 Computational Physics 2 23 Wednesday, April 9

Enter desired target number of walkers: 300 Enter time step dt: 0.05 Enter total number of time steps: 4000 <E> = 1.49113 +/- 0.0127478 <E^2> - <E>^2 = 0.650031 PHY 411-506 Computational Physics 2 24 Wednesday, April 9