CE 530 Molecular Simulation

Slides:



Advertisements
Similar presentations
PRAGMA – 9 V.S.S.Sastry School of Physics University of Hyderabad 22 nd October, 2005.
Advertisements

Review Of Statistical Mechanics
Slice Sampling Radford M. Neal The Annals of Statistics (Vol. 31, No. 3, 2003)
Molecular Dynamics at Constant Temperature and Pressure Section 6.7 in M.M.
Lecture 13: Conformational Sampling: MC and MD Dr. Ronald M. Levy Contributions from Mike Andrec and Daniel Weinstock Statistical Thermodynamics.
Monte Carlo Methods and Statistical Physics
Ch 11. Sampling Models Pattern Recognition and Machine Learning, C. M. Bishop, Summarized by I.-H. Lee Biointelligence Laboratory, Seoul National.
11 - Markov Chains Jim Vallandingham.
CS774. Markov Random Field : Theory and Application Lecture 16 Kyomin Jung KAIST Nov
1 CE 530 Molecular Simulation Lecture 8 Markov Processes David A. Kofke Department of Chemical Engineering SUNY Buffalo
The Calculation of Enthalpy and Entropy Differences??? (Housekeeping Details for the Calculation of Free Energy Differences) first edition: p
Computational statistics 2009 Random walk. Computational statistics 2009 Random walk with absorbing barrier.
MAE 552 – Heuristic Optimization Lecture 6 February 6, 2002.
CE 400 Honors Seminar Molecular Simulation Prof. Kofke Department of Chemical Engineering University at Buffalo, State University of New York Class 4.
1 CE 530 Molecular Simulation Lecture 16 Dielectrics and Reaction Field Method David A. Kofke Department of Chemical Engineering SUNY Buffalo
CE 530 Molecular Simulation
1 CE 530 Molecular Simulation Lecture 3 David A. Kofke Department of Chemical Engineering SUNY Buffalo
1 CE 530 Molecular Simulation Lecture 7 David A. Kofke Department of Chemical Engineering SUNY Buffalo
Advanced methods of molecular dynamics Monte Carlo methods
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 11 Some materials adapted from Prof. Keith E. Gubbins:
Monte-Carlo simulations of the structure of complex liquids with various interaction potentials Alja ž Godec Advisers: prof. dr. Janko Jamnik and doc.
Free energies and phase transitions. Condition for phase coexistence in a one-component system:
1 Lesson 3: Choosing from distributions Theory: LLN and Central Limit Theorem Theory: LLN and Central Limit Theorem Choosing from distributions Choosing.
1 CE 530 Molecular Simulation Lecture 17 Beyond Atoms: Simulating Molecules David A. Kofke Department of Chemical Engineering SUNY Buffalo
CE 400 Honors Seminar Molecular Simulation Prof. Kofke Department of Chemical Engineering University at Buffalo, State University of New York Class 2.
1 CE 530 Molecular Simulation Lecture 18 Free-energy calculations David A. Kofke Department of Chemical Engineering SUNY Buffalo
Basic Monte Carlo (chapter 3) Algorithm Detailed Balance Other points.
Microscopic states (microstates) or microscopic configurations under external constraints (N or , V or P, T or E, etc.)  Ensemble (micro-canonical, canonical,
1 CE 530 Molecular Simulation Lecture 6 David A. Kofke Department of Chemical Engineering SUNY Buffalo
Monte Carlo Methods Versatile methods for analyzing the behavior of some activity, plan or process that involves uncertainty.
Simulated Annealing.
For a new configuration of the same volume V and number of molecules N, displace a randomly selected atom to a point chosen with uniform probability inside.
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 14 Some materials adapted from Prof. Keith E. Gubbins:
8. Selected Applications. Applications of Monte Carlo Method Structural and thermodynamic properties of matter [gas, liquid, solid, polymers, (bio)-macro-
Markov Chain Monte Carlo and Gibbs Sampling Vasileios Hatzivassiloglou University of Texas at Dallas.
1 CE 530 Molecular Simulation Lecture 22 Chain-Molecule Sampling Techniques David A. Kofke Department of Chemical Engineering SUNY Buffalo
Statistical Mechanics and Multi-Scale Simulation Methods ChBE
Suppressing Random Walks in Markov Chain Monte Carlo Using Ordered Overrelaxation Radford M. Neal 발표자 : 장 정 호.
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 25 Some materials adapted from Prof. Keith E. Gubbins:
1 CE 530 Molecular Simulation Lecture 10 Simple Biasing Methods David A. Kofke Department of Chemical Engineering SUNY Buffalo
ChE 452 Lecture 17 Review Of Statistical Mechanics 1.
1 CE 530 Molecular Simulation Lecture 12 David A. Kofke Department of Chemical Engineering SUNY Buffalo
7. Metropolis Algorithm. Markov Chain and Monte Carlo Markov chain theory describes a particularly simple type of stochastic processes. Given a transition.
Monte Carlo method: Basic ideas. deterministic vs. stochastic In deterministic models, the output of the model is fully determined by the parameter values.
1 CE 530 Molecular Simulation Lecture 4 Object-Oriented Programming and Etomica David A. Kofke Department of Chemical Engineering SUNY Buffalo
Interacting Molecules in a Dense Fluid
An Introduction to Monte Carlo Methods in Statistical Physics Kristen A. Fichthorn The Pennsylvania State University University Park, PA
Monte Carlo in different ensembles Chapter 5
Monte Carlo methods (II) Simulating different ensembles
Javier Junquera Importance sampling Monte Carlo. Cambridge University Press, Cambridge, 2002 ISBN Bibliography.
MSc in High Performance Computing Computational Chemistry Module Parallel Molecular Dynamics (i) Bill Smith CCLRC Daresbury Laboratory
1 Statistical Mechanics and Multi- Scale Simulation Methods ChBE Prof. C. Heath Turner Lecture 19 Some materials adapted from Prof. Keith E. Gubbins:
Tao Peng and Robert J. Le Roy
MC Simulation Lab 7: 2-Dimensional Lennard-Jones Simple Liquid (Off-Lattice) and Its Phase Transition.
1 CE 530 Molecular Simulation Lecture 21 Histogram Reweighting Methods David A. Kofke Department of Chemical Engineering SUNY Buffalo
Statistical Mechanics and Multi-Scale Simulation Methods ChBE
Basic Monte Carlo (chapter 3) Algorithm Detailed Balance Other points non-Boltzmann sampling.
Computational Physics (Lecture 10) PHY4370. Simulation Details To simulate Ising models First step is to choose a lattice. For example, we can us SC,
Systematic errors of MC simulations Equilibrium error averages taken before the system has reached equilibrium  Monitor the variables you are interested.
The Monte Carlo Method/ Markov Chains/ Metropolitan Algorithm from sec in “Adaptive Cooperative Systems” -summarized by Jinsan Yang.
Optimization of Monte Carlo Integration
Computational Physics (Lecture 10)
Maria Okuniewski Nuclear Engineering Dept.
Markov chain monte carlo
Remember that our objective is for some density f(y|) for observations where y and  are vectors of data and parameters,  being sampled from a prior.
Haim Kaplan and Uri Zwick
Monte Carlo I Previous lecture Analytical illumination formula
Opinionated Lessons #39 MCMC and Gibbs Sampling in Statistics
Common Types of Simulations
Presentation transcript:

CE 530 Molecular Simulation Lecture 9 Monte Carlo Simulation David A. Kofke Department of Chemical Engineering SUNY Buffalo kofke@eng.buffalo.edu

Review We want to apply Monte Carlo simulation to evaluate the configuration integrals arising in statistical mechanics Importance-sampling Monte Carlo is the only viable approach unweighted sum of U with configurations generated according to distribution Markov processes can be used to generate configurations according to the desired distribution p(rN). Given a desired limiting distribution, we construct single-step transition probabilities that yield this distribution for large samples Construction of transition probabilities is aided by the use of detailed balance: The Metropolis recipe is the most commonly used method in molecular simulation for constructing the transition probabilities p(rN)

Monte Carlo Simulation State k MC techniques applied to molecular simulation Almost always involves a Markov process move to a new configuration from an existing one according to a well-defined transition probability Simulation procedure generate a new “trial” configuration by making a perturbation to the present configuration accept the new configuration based on the ratio of the probabilities for the new and old configurations, according to the Metropolis algorithm if the trial is rejected, the present configuration is taken as the next one in the Markov chain repeat this many times, accumulating sums for averages State k+1

Trial Moves A great variety of trial moves can be made Basic selection of trial moves is dictated by choice of ensemble almost all MC is performed at constant T no need to ensure trial holds energy fixed must ensure relevant elements of ensemble are sampled all ensembles have molecule displacement, rotation; atom displacement isobaric ensembles have trials that change the volume grand-canonical ensembles have trials that insert/delete a molecule Significant increase in efficiency of algorithm can be achieved by the introduction of clever trial moves reptation, crankshaft moves for polymers multi-molecule movements of associating molecules many more

General Form of Algorithm Monte Carlo Move Entire Simulation New configuration Initialization Reset block sums Select type of trial move each type of move has fixed probability of being selected “cycle” or “sweep” New configuration moves per cycle “block” Move each atom once (on average) Add to block sum 100’s or 1000’s of cycles Independent “measurement” Perform selected trial move cycles per block Compute block average blocks per simulation Compute final results Decide to accept trial configuration, or keep original

Monte Carlo in the Molecular Simulation API IntegratorMC (examine code) performs selection of type of move to conduct at each trial MCMove (examine code) methods to implement the Monte Carlo trial and make acceptance decision different subclasses perform different types of moves usually several of these associated with IntegratorMC

Displacement Trial Move 1. Specification Gives new configuration of same volume and number of molecules Basic trial:

Displacement Trial Move 1. Specification Gives new configuration of same volume and number of molecules Basic trial: displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom Select an atom at random

Displacement Trial Move 1. Specification Gives new configuration of same volume and number of molecules Basic trial: displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom 2d Consider a region about it

Displacement Trial Move 1. Specification Gives new configuration of same volume and number of molecules Basic trial: displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom Consider a region about it

Displacement Trial Move 1. Specification Gives new configuration of same volume and number of molecules Basic trial: displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom Move atom to point chosen uniformly in region

Displacement Trial Move 1. Specification Gives new configuration of same volume and number of molecules Basic trial: displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom Consider acceptance of new configuration ?

Displacement Trial Move 1. Specification Gives new configuration of same volume and number of molecules Basic trial: displace a randomly selected atom to a point chosen with uniform probability inside a cubic volume of edge 2d centered on the current position of the atom Limiting probability distribution canonical ensemble for this trial move, probability ratios are the same in other common ensembles, so the algorithm described here pertains to them as well Examine underlying transition probabilities to formulate acceptance criterion ?

Displacement Trial Move 2. Analysis of Transition Probabilities Detailed specification of trial move and transition probabilities Forward-step transition probability Reverse-step transition probability v = (2d)d c is formulated to satisfy detailed balance

Displacement Trial Move 3. Analysis of Detailed Balance Forward-step transition probability Reverse-step transition probability Detailed balance pi pij pj pji = Limiting distribution

Displacement Trial Move 3. Analysis of Detailed Balance Forward-step transition probability Reverse-step transition probability Detailed balance pi pij pj pji = Limiting distribution

Displacement Trial Move 3. Analysis of Detailed Balance Forward-step transition probability Reverse-step transition probability Detailed balance pi pij pj pji = Acceptance probability

Displacement Trial Move 4a. Examination of Java Code public void thisTrial(Phase phase) { double uOld, uNew; if(phase.atomCount==0) {return;} //no atoms to move int i = (int)(rand.nextDouble()*phase.atomCount); //pick a random number from 1 to N Atom a = phase.firstAtom(); for(int j=i; --j>=0; ) {a = a.nextAtom();} //get ith atom in list uOld = phase.potentialEnergy.currentValue(a); //calculate its contribution to the energy a.displaceWithin(stepSize); //move it within a local volume phase.boundary().centralImage(a.coordinate.position()); //apply PBC uNew = phase.potentialEnergy.currentValue(a); //calculate its new contribution to energy if(uNew < uOld) { //accept if energy decreased nAccept++; return; } if(uNew >= Double.MAX_VALUE || //reject if energy is huge or doesn’t pass test Math.exp(-(uNew-uOld)/parentIntegrator.temperature) < rand.nextDouble()) { a.replace(); //...put it back in its original position nAccept++; //if reached here, move is accepted Have a look at a simple MC simulation applet

Displacement Trial Move 4b. Examination of Java Code Atom methods Space.Vector methods public final void displaceWithin(double d) { workVector.setRandomCube(); displaceBy(d,workVector);} public final void displaceBy(double d, Space.Vector u) { rLast.E(r); translateBy(d,u);} public final void translateBy(double d, Space.Vector u) {r.PEa1Tv1(d,u);} public final void replace() {r.E(rLast);} public void setRandomCube() { x = random.nextDouble() - 0.5; y = random.nextDouble() - 0.5; } public void PEa1Tv1(double a1, Vector u) { x += a1*u.x; y += a1*u.y;} public void E(Vector u) {x = u.x; y = u.y;}

Displacement Trial Move 5. Tuning Size of step is adjusted to reach a target rate of acceptance of displacement trials typical target is 50% for hard potentials target may be lower (rejection is efficient) Large step leads to less acceptance but bigger moves Small step leads to less movement but more acceptance

Volume-change Trial Move 1. Specification Gives new configuration of different volume and same N and sN Basic trial:

Volume-change Trial Move 1. Specification Gives new configuration of different volume and same N and sN Basic trial: increase or decrease the total system volume by some amount within ±dV, scaling all molecule centers-of-mass in proportion to the linear scaling of the volume +dV -dV Select a random value for volume change

Volume-change Trial Move 1. Specification Gives new configuration of different volume and same N and sN Basic trial: increase or decrease the total system volume by some amount within ±dV, scaling all molecule centers-of-mass in proportion to the linear scaling of the volume Perturb the total system volume

Volume-change Trial Move 1. Specification Gives new configuration of different volume and same N and sN Basic trial: increase or decrease the total system volume by some amount within ±dV, scaling all molecule centers-of-mass in proportion to the linear scaling of the volume Scale all positions in proportion

Volume-change Trial Move 1. Specification Gives new configuration of different volume and same N and sN Basic trial: increase or decrease the total system volume by some amount within ±dV, scaling all molecule centers-of-mass in proportion to the linear scaling of the volume Consider acceptance of new configuration ?

Volume-change Trial Move 1. Specification Gives new configuration of different volume and same N and sN Basic trial: increase or decrease the total system volume by some amount within ±dV, scaling all molecule centers-of-mass in proportion to the linear scaling of the volume Limiting probability distribution isothermal-isobaric ensemble Examine underlying transition probabilities to formulate acceptance criterion Remember how volume-scaling was used in derivation of virial formula

Volume-change Trial Move 2. Analysis of Transition Probabilities Detailed specification of trial move and transition probabilities Forward-step transition probability Reverse-step transition probability c is formulated to satisfy detailed balance

Volume-change Trial Move 3. Analysis of Detailed Balance Forward-step transition probability Reverse-step transition probability Detailed balance pi pij pj pji = Limiting distribution

Volume-change Trial Move 3. Analysis of Detailed Balance Forward-step transition probability Reverse-step transition probability Detailed balance pi pij pj pji = Limiting distribution

Volume-change Trial Move 3. Analysis of Detailed Balance Forward-step transition probability Reverse-step transition probability Detailed balance pi pij pj pji = Acceptance probability

Volume-change Trial Move 4. Alternative Formulation Step in ln(V) instead of V larger steps at larger volumes, smaller steps at smaller volumes Limiting distribution Trial move Acceptance probability min(1,c)

Volume-change Trial Move 5. Examination of Java Code public void thisTrial(Phase phase) { double hOld, hNew, vOld, vNew; vOld = phase.volume(); hOld = phase.potentialEnergy.currentValue() //current value of the enthalpy + pressure*vOld*Constants.PV2T; //PV2T is a conversion factor double vScale = (2.*rand.nextDouble()-1.)*stepSize; //choose step size vNew = vOld * Math.exp(vScale); //Step in ln(V) double rScale = Math.exp(vScale/(double)Simulation.D); //evaluate linear scaling phase.inflate(rScale); //scale all center-of-mass coordinates hNew = phase.potentialEnergy.currentValue() //new value of the enthalpy + pressure*vNew*Constants.PV2T; if(hNew >= Double.MAX_VALUE || //decide acceptance Math.exp(-(hNew-hOld)/parentIntegrator.temperature+(phase.moleculeCount+1)*vScale) < rand.nextDouble()) { //reject; put coordinates back to original positions phase.inflate(1.0/rScale); } nAccept++; //accept Have a look at a simple NPT MC simulation applet

Summary Monte Carlo simulation is the application of MC integration to molecular simulation Trial moves made in MC simulation depend on governing ensemble many trial moves are possible to sample the same ensemble Careful examination of underlying transition matrix and limiting distribution give acceptance probabilities particle displacement volume change Next up: molecular dynamics