Download presentation
Presentation is loading. Please wait.
Published byEthan Walters Modified over 9 years ago
1
microscopic states (microstates) or microscopic configurations under external constraints (N or , V or P, T or E, etc.) Ensemble (micro-canonical, canonical, grand canonical, etc.) Average over a collection of microstates Macroscopic quantities (properties, observables) thermodynamic – or N, E or T, P or V, C v, C p, H, S, G, etc. structural – pair correlation function g(r), etc. dynamical – diffusion, etc. These are what are measured in true experiments. they’re generated naturally from thermal fluctuation In a real-space experimentIn a virtual-space simulation How do we mimic the Mother Nature in a virtual space to realize lots of microstates, all of which correspond to a given macroscopic state? By MC or MD method! it is us who needs to generate them by MC or MD methods. t1t1 t2t2 t3t3 ~10 23 particles
2
Beyond 1D integrals: A system of N particles in a container of a volume V in contact with a thermostat T (constant NVT) ( =1/kT) or for discrete microstates for discrete microstates Particles interact with each other through a potential energy U(r N ) (~ pair potential). U(r N ) is the potential energy of a microstate {r N } = {x 1, y 1, z 1, …, x N, y N, z N }. (r N ) is the probability to find a microstate {r N } under the constant-NVT constraint. Partition function Z (required for normalization) = the weighted sum of all the microstates compatible with the constant-NVT condition Average of an observable O,, over all the microstates compatible with constant NVT or for discrete microstates ensemble average “canonical ensemble” external constraint 3N-dimension integration 3N-dimension
3
1885 – Johann Balmer – Line spectrum of hydrogen 1886 – Heinrich Hertz – Photoelectric effect experiment 1897 – J. J. Thomson – Discovery of electrons from cathode rays experiment 1900 – Max Planck – Quantum theory of blackbody radiation 1905 – Albert Einstein– Quantum theory of photoelectric effect 1910 – Ernest Rutherford – Scattering experiment with -particles 1913 – Niels Bohr – Quantum theory of hydrogen spectra 1923 – Arthur Compton – Scattering experiment of photons off electrons 1924 – Wolfgang Pauli – Exclusion principle – Ch. 10 1924 – Louis de Broglie – Matter waves 1925 – Davisson and Germer – Diffraction experiment on wave properties of electrons 1926 – Erwin Schrodinger – Wave equation – Ch. 2 1927 – Werner Heisenberg – Uncertainty principle – Ch. 6 1927 – Max Born – Interpretation of wave function – Ch. 3 Ludwig Boltzmann in the Maxwell-Boltzmann distribution Boltzmann a pioneer in atomic theory was used in the derivation of
4
Can we use Monte Carlo to compute Z? (even for a very simple, minimum-size, discrete case) Consider a model of spins on a 2D lattice (idealized magnetic model). ⇒ a discrete system Each of N spins can take 2 states: up ( ↑ ) and down ( ↓ ). ⇒ 2 N microstates Each spin interacts only with its nearest neighbors (nn). ⇒ 4 neighbors for a 2D square lattice Suppose that it takes 10 -6 (or 10 -15 ) s to compute the interaction of a spin with its neighbors. ⇒ Time to calculate the energy E i of a microstate i = N x 10 -6 (or N x 10 -15 ) s For N = 100 spins: - 2 100 ~ 10 30 microstates - 10 -3 (or 10 -12 ) s to calculate the energy of a microstate ⇒ 10 27 (or 10 18 ) s to estimate Z! (~ age of the universe ~ 13.8 billion years ~ 4 x 10 17 s) The situation gets worse with a real (continuous, larger, with beyond-nn interaction) system! a microstate ⇒ We cannot compute Z (and the absolute free energy kT ln Z) for real systems! (However, we can compute a relative free energy between two states.)
5
What contributes to the most? Instantaneous values { O i } of microstates with high probability (= with large Boltzmann weight = with low energy) We just showed that we cannot compute all the microstates. Let’s take a subset, for example, 10 6 states for the spin system in the previous example. How do we choose these states? a)Brute force Monte Carlo (hit & miss, sample mean by uniform sampling) Randomly pick a microstate i (i.e. the orientation of each spin). → Too high probability that the subset doesn’t contribute to the average → The situation is the worst for a continuous dense system! b)Importance sampling Pick a microstate i with high probability (i.e. large i ). Sample according to i. → We need to use a normalized distribution { i }. → The normalization requires Z, and we showed that we cannot compute Z! c) Metropolis importance sampling Pick a microstate i with large i without calculating the normalization. → biased random walk in the phase space Can we use Monte Carlo to compute ? Hard sphere 1/10 260
6
Importance sampling for ensemble averages - Biased random walk Frenkel and Smit, Understanding Molecular Simulations quick depth info: yes area info: no depth info: yes area info: yes slow~impossible
7
Finished ? Yes No Give the particle a random displacement. Calculate the new energy. Accept the move with Select a particle at random. Calculate the energy. Calculate the ensemble Average. Initialize the positions Biased random walk in configuration space: Metropolic Monte Carlo method Kristen A. Fichthorn, Penn. State U.
8
Stochastic process is a movement through a series of well-defined microstates (or configurations or states in short) in a way that involves some element of randomness. Markov process is a stochastic process that has no memory. Selection of next state depends only on the current state, not on prior states. A process is fully defined by a set of transition probabilities ij. Transition probability (i j) or ij is the probability to go from the state i to j. - Non-negative, not greater than unity (0 1) - Probability of staying in present state may be non-zero. Transition probability matrix collects all ij. - sum of each row = 1 - (example) system with three states Markov process & Transition probability If in state 1, it will move to state 3 with probability 0.4 If in state 1, it will stay in state 1 with probability 0.1. It never go from state 2 to state 3.
9
= Probability to be at state at time t = Transition probability per unit time from to The master equation for Markov processes
10
Detailed balance (or Microscopic reversibility) criterion at equilibrium: key of Metropolis algorithm After a long time, the system reaches equilibrium. The transition probabilities should satisfy the condition that they do not destroy the equilibrium distribution once it is reached. Thus, at equilibrium, we have a stationary Markov provess: One way to satisfy this would be a (more stringent) detailed balance condition. Stationary Markov: Average population does not change with time (i.e., MC steps).
11
Choices of Metropolis 1. The transition probability can be divided into two parts: (1)Choosing a new configuration with a probability . (2)Accepting or rejecting this new configuration with an acceptance probability acc. where = probability to choose a particular move, acc = probability to accept the move N. Metropolis et al. J. Chem. Phys. 21, 1087 (1953) Then, the detailed balance condition becomes:
12
Choices of Metropolis for canonical ensembles N. Metropolis et al. J. Chem. Phys. 21, 1087 (1953) 1. Detailed balance condition 2.Symmetric : 3.Limiting probability distribution for canonical ensemble = Boltzmann Transition probability & acceptance probability acc should satisfy: 4. Define the acceptance probability as: Accept all the downhill moves. Accept uphill moves only when not too uphill. naturally satisfies this condition.
13
Choice of Metropolis: Metropolis MC algorithm N. Metropolis et al. J. Chem. Phys. 21, 1087 (1953)
14
Finished ? Yes No Give the particle a random displacement. Calculate the new energy. Accept the move with Select a particle at random. Calculate the energy. Calculate the ensemble Average. Initialize the positions Biased random walk in configuration space: Metropolic Monte Carlo method Kristen A. Fichthorn, Penn. State U.
15
Almost always involves a Markov process Move to a new configuration from an existing one according to a well-defined transition probability Simulation procedure 1.Generate a new “trial” configuration by making a perturbation to the present configuration 2.Accept the new configuration based on the ratio of the probabilities for the new and old configurations, according to the Metropolis algorithm 3.If the trial is rejected, the present configuration is taken as the next one in the Markov chain 4.Repeat this many times, accumulating sums for averages state k state k+1 Metropolis Monte Carlo Molecular Simulation David A. Kofke, SUNY Buffalo
16
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 a cubic volume of edge 2 centered on the current position of the atom. Examine underlying transition probability to formulate the acceptance criterion Displacement trial move. 1. Specification ? Select an atom at random. Consider a region centered at it. Move atom to a point chosen uniformly in region. Consider acceptance of new configuration. 22 Step 1Step 2Step 3Step 4 general hitherto David A. Kofke, SUNY Buffalo
17
Detailed specification of trial move and transition probability Forward-step transition probability (2 ) d Reverse-step transition probability is formulated to satisfy the detailed balance condition. Displacement trial move. 2. Analysis of transition probabilities David A. Kofke, SUNY Buffalo
18
Detailed balance Forward-step transition probability Reverse-step transition probability ii ij jj ji = Limiting distribution of canonical ensemble Displacement trial move. 3. Analysis of detailed balance David A. Kofke, SUNY Buffalo
19
Detailed balance Forward-step transition probability Reverse-step transition probability ii ij jj ji = Acceptance probability for canonical ensemble Displacement trial move. 3. Analysis of detailed balance David A. Kofke, SUNY Buffalo
20
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 return; } nAccept++; //if reached here, move is accepted } Displacement trial move. 4. Code example (Java) David A. Kofke, SUNY Buffalo
21
Displacement trial move. 4. Pseudo Code (Louis)
22
Initialization Reset block sums Compute block average Compute final results “cycle” or “sweep” “block” Move each atom once (on average) 100’s or 1000’s of cycles Independent “measurement” moves per cycle cycles per block Add to block sum blocks per simulation New configuration Entire Simulation Monte Carlo Move Select type of trial move each type of move has fixed probability of being selected Perform selected trial move Decide to accept trial configuration, or keep original David A. Kofke, SUNY Buffalo Displacement trial move. 5. Implementation
23
Rule of thumb: Size of the step is adjusted to reach a target acceptance rate of displacement trials, which is typically 50%. Large step leads to less acceptance but bigger moves. Small step leads to less movement but more acceptance. Displacement trial move. 6. Step size tuning
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.