Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to...

28
Monte Carlo, Molecular Dynamics http://allos.up.univ-mrs.fr/simulations.html Bogdan Kuchta Laboratoire Chimie Provence (LCP) Université de Provence, Marseille 1990 2000 Evolution of Computational Methods Evolution of Computational Methods Combination with DFT Molecular Gradient corrections Car-Parinello Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular dynamics 1960 1980 1970 Solid State Physics Quantum Chemistry Statistical Mechanics Molecular dynamics and Monte Carlo Molecular Mechanics Force fields Semi-empirical parameters Total energies Analytical forces geometry optimization Analytical frequencies SCF Hartree-Fock Total energies Forces Car-Parinello Density functional Tight-binding Energy band structures

Transcript of Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to...

Page 1: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Monte Carlo, Molecular Dynamics

http://allos.up.univ-mrs.fr/simulations.html

Bogdan KuchtaLaboratoire Chimie Provence (LCP)

Université de Provence, Marseille

1990

2000

Evolution of Computational MethodsEvolution of Computational Methods

Combinationwith DFT

Molecular

Gradient corrections

Car-Parinello

Multiscale methodslink to macroscopic models

Quantum Monte Carlo

2010 Mesoscale modeling

Ab initio molecular dynamics

1960

1980

1970

Solid State Physics Quantum ChemistryStatistical Mechanics

Molecular dynamics andMonte Carlo

Molecular Mechanics

Force fieldsSemi-empirical

parameters

Total energies

Analytical forcesgeometry optimization

Analytical frequencies

SCF

Hartree-Fock

Total energies

Forces

Car-Parinello

Density functional

Tight-binding

Energy band structures

Page 2: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

example: 2003 Chemistry Nobel Prize“for discoveries concerning channels in cell membranes”

Simulating water transport throughAquaporin channel

“But the depth of science has increased dramatically, and

Alfred Nobel would be astonished by the changes. Now in

the 21st century, the boundaries separating chemistry,

physics, and medicine have become blurred, and as

happened during the Renaissance, scientists are following

From Peter From Peter Agre’sAgre’s Nobel Banquet SpeechNobel Banquet Speech

http://www.nobel.se

happened during the Renaissance, scientists are following

their curiosities even when they run beyond the formal

limits of their training. This year a former physics student

shares the Economics Prize, a philosophy student shares

the Physics Prize, chemistry and mathematics students

share the Medicine Prize, and medical students share the

Chemistry Prize.

Page 3: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Modeling Modeling –– interdisciplinary scienceinterdisciplinary science

Numerical Modeling

Numerical simulations

[atomistic]

Quantum Chemistry

(electrons)

[atomistic]

(Optimization,Monte Carlo,

Molecular Dynamics)

Finite elements

(objects > µµµµm)

10-6

10-3

100

(µµµµs)

(ms)

TIME/s

Mesoscale methods

Semi-empirical

Continuum

Lattice Monte CarloBrownian dynamicsDissipative particle dyn

Methods

Theory and Simulation Scales

Based on SDSC Blue Horizon (SP3)512-1024 processors1.728 Tflops peak performanceCPU time = 1 week / processor

Atomistic Simulation Methods

10-15

10-12

10-9

10-10 10-9 10-8 10-7 10-6 10-5 10-4

(nm) (µµµµm)

(fs)

(ps)

(ns)

LENGTH/meters

Semi-empiricalmethods

Ab initiomethods

Monte Carlomolecular dynamics

tight-bindingMNDO, INDO/S

Page 4: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

1. Discrete character of variables, ( ∆x, ∆t ) – defined by the problem

2. Constant number of independent variables

Limitations due to the speed and the memory capacity of computers

N – number of independent variables

(electrons, atoms or finite elements)

nmµµµµ m –nm≥µ≥µ≥µ≥µ m

N finite

elementsN atoms N electrons

(electrons, atoms or finite elements)

Simulations

numériquesExpérience

Real systems

(nature)

Theories(analytical solution)

Model (parameters, interaction, ...)

Numerical

experiments

experiment

Why simulations ?Why simulations ?

1. Fundamental

studies, e.g. to

determine range of

validity of Kelvin’s

equation, Fick’s law of

diffusion, Newton’s

law of viscosity, etc.

2. Test theories by

comparing theory and

Exact solution

(trajectories of all particles)

Tests of model Tests of theories

data (spectra)

experimental

Approximate

solutions

comparing theory and

simulation

3. Test model by comparing simulated and experimental properties. Then

use model in further simulations to carry out “experiments” not possible

in the laboratory, e.g. critical points for molecules that decompose below Tc,

properties of molten salts, long-chain hydrocarbon properties at very high

pressures, properties of confined nano-phases, etc.

Page 5: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Construction of

modelMethod

Model of

interaction

Numerical simulations: how ?Numerical simulations: how ?

Real systems

(molecules in pore)

Pores structure and

adsorbed atoms

Force Field

Numerical Simulations in

statistical ensemble

Generation of

states

Trajectory

analysis

interaction

Interaction with

environment

Equation of

motion

T = const.

N variable

(Statistical ensemble)

Stochastic

(Monte Carlo)

Molecular Dynamics

Monte Carlo algorithm

Mean values and

fluctuations of:

Energies

Number of atoms

Classical Force FieldsClassical Force Fields

Consist of: 1. Analytical form of the interatomic potential energy

U=Ee(R) as a function of the atomic coordinates of

the molecule

2. Parameters which enter U

------------------------------

• Fundamental to everything is the Schrödinger equation

– wave function

– H = Hamiltonian operator

– time independent form

H it

∂ΨΨ =∂

h

( , , )R r tΨNuclear coordinates

Electronic coordinates

H EΨ = Ψ

22 im

H K U U= + = − ∇ +∑h

Page 6: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Solution of Schrödinger equation :

Born-Oppenheimer approx. Ψ(r,R)≈ψ (r|R)Θ(R)

– electrons relax very quickly compared to nuclear motions

– nuclei move in presence of potential energy obtained by solving electron distribution for

fixed nuclear configuration

Equation of motion for electrons: ( Ke + V ) ψ(r, R) = Ee(R) ψ(r, R)

Potential Energy Surface (PES)

PES

e e

Equation of motion for nuclei:

(motion on the PES)

quantum classical (MD, MC)

(R)Edt

Rdm e−∇=

2

2

( Kn + Ee(R) ) Θ(R) = ET(R) Θ(R)

Intermolecular forces.Intermolecular forces.Intermolecular forces.Intermolecular forces.

long range:interaction energy is proportional

to some inverse power

of molecular separation

electrostatic: from static charge

distribution (attractive or repulsive)

induction: from distortion caused by

short range:interaction energy exponentially decays

with molecular separation

at small intermolecular distance,

an overlap of the molecular wave

functions causes electronic exchange

or repulsion

Contributions to PES

induction: from distortion caused by

molecular field of neighbors (always

attractive)

dispersion: from instantaneous

fluctuations caused by electron

movement (always attractive)

or repulsion

In theory, it is possible to

calculate the intermolecular

interactions from first principles (ab initio).(in practice, only for small systems)

non pair - additive

Page 7: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

No simple theory exists.No simple theory exists.

Repulsion (overlap) Repulsion (overlap)

forces.forces.

Repulsion (overlap) Repulsion (overlap)

forces.forces.

( ) ( ) Broverlap erAru −≈

For simple molecules, can be approximated byFor simple molecules, can be approximated by

inconvenient to use.

People often approximate this by

Contributions to PES

( ) noverlap Arru −≈ with n = 8 to ∞

People often approximate this by

( )

=612

4r

σ

r

σεru

Example: Lennard-Jones potential

repulsione

r

u

s

rmin

• Total pair energy breaks into a sum of terms

Intramolecular only

• U - stretch • UvdW - van der WaalsRepulsion

polelvdWcrosstorsbendstrN

e UUUUUUUrURE ++++++=⇒ )()(

Intermolecular only

Contributions to PES

• Ustr - stretch

• Ubend - bend

• Utors - torsion

• Ucross - cross

• UvdW - van der Waals

• Uel - electrostatic

• Upol - polarization

taken from Dr. D. A. Kofke’s lectures on Molecular Simulation, SUNY Buffalohttp://www.eng.buffalo.edu/~kofke/ce530/index.html

Mixed terms

Repulsion- +-+

-+ -+

Page 8: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

The potential energy of N interacting particles can be evaluated as:

Calculation of interaction energyCalculation of interaction energyCalculation of interaction energyCalculation of interaction energy

( ) ( ) ( ) ....,,, 321 +++= ∑∑ ∑∑∑∑> >>>

N

i

N

ijkji

N

ijk

N

iji

N

iji

N

ipot rrrurruruE

effect of an

external field

interactions

between pairs

of particles

interactions

between

particle triplets

many body

interactions

interactions between particles

particle triplets

Typically, it is assumed that only two-body term is important

( Epot is truncated after the second term)

How can we use this PES (interaction energy) in simulations ?

In some particular cases three-body term should be considered

Classical Force FieldsClassical Force Fields

J Simple, fixed algebraic form for every type of interaction.

J Variable parameters depend on types of atoms involved.

CHARMM* force field:

*Chemistry at HARvard Macromolecular Mechanics

Page 9: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Force fieldsForce fields(potential energy, interaction model, …)(potential energy, interaction model, …)

Electrons: H(r,R)ΨR(r) = ERΨR(r) - ab initio

Atoms: Ecovalent = ∑kij(rij-roij)2 + ∑kijk(Θijk-Θoijk)

2 + .......

Edisp(rij) = -Cdisp/rij6

E (r ) = (σ/r )n

k, C, σσσσ, .... Semi-empirical

AtomisticErep(rij) = (σ/rij)n

................

Finite elements: (example: diffusion)

∂∂=

∂∂

2

2 ),(),(

x

txcD

t

txc

D, .... Mesoscale

Atomistic

Continuous

Components of a Force FieldsComponents of a Force Fields

Any force field contains the necessary building blocks

for the calculation of energy and force:

- a list of atom types

- a list of atomic charges

- rules for atom-types

- functional forms of the components of the energy expression

- parameters for the function terms

- rules for generating parameters that have not been explicitly defined

(for some force fields)

- a defined way of assigning functional forms and parameters (for some

force fields)

Page 10: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Why atomistic simulations depend on

Statistical Thermodynamics (Physics) ?

The language of computer simulations and real experiments is different; The language of computer simulations and real experiments is different;

simulations are using the notions ofsimulations are using the notions of::

Phase spacePhase space

Ensemble, probability, distribution of statesEnsemble, probability, distribution of states

Instantaneous (microscopic) configurations Instantaneous (microscopic) configurations

(positions and velocities)(positions and velocities)(positions and velocities)(positions and velocities)

Experiments measures average propertiesExperiments measures average properties: :

structures, energies, density, etc… structures, energies, density, etc… -- macroscopic propertiesmacroscopic properties

In order to interpret microscopic measurements to compare with experimental In order to interpret microscopic measurements to compare with experimental

average values we need average values we need

the statistical physics (thermodynamics)the statistical physics (thermodynamics)

Ergodic hypothesis

Ensemble of atoms defined by their positions in a cell – many body

problem

Numerical SimulationsNumerical Simulations

Why atomistic simulations depend on

Statistical Thermodynamics (Physics) ?

Ergodic hypothesis

<A(r(t), p(t))>time = <A(r, p)>ensemble

Molecular Dynamics Monte Carlo

Page 11: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Le « Volume » de l’espace des phases : dΩΩΩΩ = dr1dp1 dr2dp2 .... drNdpN

L’espace des phases (N~1023):

(rN(t), pN(t)) = (r1(t),r2(t),r3(t),…,rN(t), p1(t), p2(t), p3(t), …pN(t)) – chaque

point définit un état microscopique du système

The Semi-Classical Approximation

1 1 2 2 N N

L’évolution de ΩΩΩΩ(t) au cours du temps définit

une trajectoire de phase qui est donc parfaitement

déterminée par la donnée du point initial ΩΩΩΩo.

Alors, un système qui est en équilibre au niveau

macroscopique est dynamique à l'échelle

microscopique.

Exemple: la pression d’un gaz dans un container

dans les intervalles du temps très courts Atom i: ri, pi

La mécanique quantique permet de préciser le nombre d’états

microscopiques distincts.

Cela grâce au principe d’incertitude de Heisenberg :

The Semi-Classical Approximation

Interprétation de l’extension en phase (r + p)

Cela grâce au principe d’incertitude de Heisenberg :

dpx drx ∼ h (constante de Planck)

Une analyse plus précise conduit à d’une évaluation du nombre des états :

dn = dΩΩΩΩ/h3N

Page 12: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Monte Carlo (MC)

• If we want to know some (mechanical) property ( )NN rpA ,

we can get it from an ensemble average :

( ) ( )∫ ∫= NNNNNN rpPrpArdpdA , ,

In the canonical ensemble,

∑−

− EkT

Ei

i

e

Why atomistic simulations depend on

Statistical Physics : brief account of MC, MD

In the canonical ensemble,

∑−

==i

kT

EkT

i

i

eZZ

eP

• In MC a random number generator is used to move the molecules. The

moves are accepted or rejected according to a recipe that ensures

configurations have the Boltzmann probability proportional to : kT

Ei

e−

•First MC in 1953: N. Metropolis, A.W. Rosenbluth, M.N. Rosenbluth, A.H. Teller

and E.Teller, J. Chem. Phys. 21, 1087 (1953)

Distribution Law for Canonical EnsembleDistribution Law for Canonical Ensemble

A system at fixed N,V,T can exist in A system at fixed N,V,T can exist in

many possible quantum states, many possible quantum states,

1,2,….n,… with energies 1,2,….n,… with energies

EE11,E,E22,…E,…Enn,… The probability of ,… The probability of

observing the system in a observing the system in a

particular state n is given by the particular state n is given by the

Boltzmann distribution law,Boltzmann distribution law,

(7)n n

n

E E

n E

n

e eP

Q e

β β

β

− −

−= =∑

(8)nE

nQ e β−=∑

where where β β = 1/= 1/kTkT

and k = R/Nand k = R/NA A = 1.38066x10= 1.38066x10--2323 JKJK--11 is the is the

Boltzmann constant. Boltzmann constant.

Q Q is the is the canonical partition functioncanonical partition function

T = const

N, V

E1,E2,….

dq

Page 13: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Canonical Distribution Law: ProofCanonical Distribution Law: Proof

Basic Postulate:Basic Postulate:

For a closed system (constant For a closed system (constant NN) at fixed volume ) at fixed volume VV and temperature and temperature TT, the , the

only dynamical variable that only dynamical variable that PPnn depends on is the energy of the state depends on is the energy of the state nn, , EEnn, ,

i.e. i.e. PPnn=f(E=f(Enn))

Remember !

En depend on N and V only ! (Schroedinger equation depends on N and the En depend on N and V only ! (Schroedinger equation depends on N and the

boundary conditions – En are the quantum solutions)

They do not depend on T !!! - Pn depends on T !!!

Higher temperature, probability of the

higher energy is larger

E1 E2 E3

E5E4

E6 ……..

(7)n n

n

E E

n E

n

e eP

Q e

β β

β

− −

−= =∑

Derivation of Boltzmann Distribution LawDerivation of Boltzmann Distribution Law

Consider a body (the system) at (N,V) immersed in a Consider a body (the system) at (N,V) immersed in a

large heat bath at temperature T. Quantum states large heat bath at temperature T. Quantum states

1,2,…n,… are available to the body and1,2,…n,… are available to the body and

Suppose a second body, with (N’,V’) is immersed in Suppose a second body, with (N’,V’) is immersed in

the same heat bath, and has possible quantum states the same heat bath, and has possible quantum states

1’,2’, ….k, …, so that1’,2’, ….k, …, so that

( ) (9)n nP f E=

'( ) (10)k kP f E= ( ) (10)k kP f E=

T = const

N, V

E1,E2,….

dq N’, V’

E’1,E’2,….

dq’( ) (9)n nP f E= '( ) (10)k kP f E=

Page 14: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

'( ) (11)nk n kP f E E= +

Derivation of Boltzmann Distribution LawDerivation of Boltzmann Distribution Law

If If PPnknk is the probability that body 1 is in state n and body 2 is in state k, thenis the probability that body 1 is in state n and body 2 is in state k, then

If the heat bath is large enough the 2 bodies will behave independently. If the heat bath is large enough the 2 bodies will behave independently.

The time body 1 spends in a particular quantum state will be unaffected The time body 1 spends in a particular quantum state will be unaffected

by the state of body 2, soby the state of body 2, so

(12)P P P= (12)nk n kP P P=So, we haveSo, we have

The The only only function for which this relation is obeyed is an exponential one, function for which this relation is obeyed is an exponential one,

i.e. i.e.

' '( ) ( ) ( ) (13)n k n kf E E f E f E+ =

'

1 2; (14)n kE En kP C e P C eβ β− −= =

1)(

)()(

)(

)()(

yx

yxf

y

yx

yx

yxf

y

yxf

+∂+∂=

∂+∂

+∂+∂=

∂+∂

y

yfxf

y

yxf

∂∂=

∂+∂ )(

)()(

Derivation of Boltzmann Distribution LawDerivation of Boltzmann Distribution Law

Proof: f(x+y) = f(x)f(y)

Similar derivation with respect to x:

x

xfyf

yx

yxf

∂∂=

+∂+∂ )(

)()(

)(y

yfxf

yx

yxf

∂∂=

+∂+∂ )(

)()(

)(

xyx ∂+∂ )(

x

xf

y

yf

x

xf

xfy

yf

yf ∂∂=

∂∂

⇒∂

∂=∂

∂ ))(ln())(ln()(

)(

1)(

)(

1

Left hand side is independent of y, right hand side is independent of x

It means that both sides are independent of x and y, that is, is equal to constant :

-βxCexfcxxf ββ −=⇒+−= )())(ln(

X = En, f = pn ∑pn = 1

Page 15: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

1nnP =∑

1 1/

(15)

n

n n

n

E

n

E E

n E

C e

e eP

e Q

β

β β

β

− −

=

= =

Since the probabilities are normalized, , we haveSince the probabilities are normalized, , we have from (14)from (14)

Derivation of Boltzmann Distribution LawDerivation of Boltzmann Distribution Law

Note that CNote that C11 and Cand C22 are different for the two bodies since in general their volumes and are different for the two bodies since in general their volumes and

number of molecules will be different. However, number of molecules will be different. However, ββ must be the same for the two must be the same for the two

bodies for eqn. (13) to hold. Since they are in the same heat bath this suggests that bodies for eqn. (13) to hold. Since they are in the same heat bath this suggests that ββ is is

related to temperature; related to temperature; ββ must be positive, otherwise must be positive, otherwise PPnn would become infinite when would become infinite when

EEnn approaches infinity. approaches infinity.

nE

ne Q∑

EnsemblesEnsembles

We must first choose a set of We must first choose a set of independent variables (ensemble),independent variables (ensemble), and then derive the and then derive the distribution law for the probability the system is in a certain (quantum or classical) distribution law for the probability the system is in a certain (quantum or classical) state. The most commonly used ensembles are:state. The most commonly used ensembles are:

N,V,E N,V,E MicrocanonicalMicrocanonical ensembleensemble

N,V,T Canonical ensembleN,V,T Canonical ensemble

µµµµµµµµ,V,T Grand canonical ensemble,V,T Grand canonical ensemble

N,P,T IsothermalN,P,T Isothermal--isobaric ensembleisobaric ensemble

Here :Here :

N=number of particles, N=number of particles,

V=volume, V=volume,

T=temperature, T=temperature,

E=total energy, E=total energy,

P=pressure, P=pressure,

µµµµµµµµ=chemical potential.=chemical potential.

Initially we worked in the Initially we worked in the canonical ensemblecanonical ensemble

Page 16: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

L’univers – ensemble microcanonique absolu (NVE)

Il est constitué de systèmes identiques de point de vue macroscopique et de même

énergie.

En pratique, expérimentalement il est impossible de fixer exactement l’énergie pour un

système donné.

Probabilité d’un état i: Pi = 1/W

EnsemblesEnsembles

L’ensemble canonique – fluctuation d'énergie à cause de contact du système avec

l'environnement (NVT)

Un système est plongé dans un thermostat avec lequel il peut échanger de l’énergie

sous forme de chaleur. L’état d’équilibre correspond du point de vue macroscopique à

l'égalité des températures du système et du thermostat. Cet équilibre a une caractère

dynamique, avec d’incessantes fluctuations de l’énergie moyenne.

Probabilité d’un état i: Pi = e-Ui/kT/Z

L’ensemble grand canonique – on autorise les fluctuation du nombre de particules

(µVT)

Le système est en relation avec un « réservoir de particules » avec lequel il peut

échanger non seulement de l’énergie, mais aussi des particules.

Probabilité d’un état i: Pi = e-(Ui-µµµµN

i)/kT/Z ;

EnsemblesEnsembles

Rappel : <A> = ∑PiAi ( = ∫p(x)A(x) dx )

Probabilité d’un état i: Pi = e i i /Z ;

µµµµ - potentiel chimique ;

Z = ∑ e-(Ui-µµµµN

i)/kT

Page 17: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

• With the distribution law known, it is straightforward to derive relations for the

thermo properties in terms of Z.

• Internal Energy, U

U is simply the average energy of the system

nE

nn

VN

eEZ β

β−∑−=

∂∂

,

Expressions for Thermodynamic Properties

∂∂−=== ∑∑ −

ββ Z

eEZ

EPN

U

n

Enn

nn

nln1

ββ

β

β

β

ddZ

Zeg

egU

ZegN

eZNgU

N

UN

NU

i

i

i

ii

i

i

i

ii

i

i

i

ii

iU

iU

iU

iU

1−====∑∑

∑∑∑

Proof:

Using β=1/kT, this can be rewritten as

Ideal gas: Ar, Kr,Xe

Z = qN q = (2πmkT/h2)3/2

lnQ = 3/2NlnT + C

U = 3/2NkTT

ZNkTU

∂∂= ln2

Expressions for Thermodynamic Properties

C'est-à-dire pour une mole (N=L) T

ZRTU

∂∂= ln2

Page 18: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Free energy A

A = U - TS

• Helmholtz Free Energy,A

• A=U-TS is related to U via the Helmholtz eqn.,

( )2

/ (18)

A T U

T T

∂ = − ∂

dA = -SdT – Vdp

A = U –TS

A/T = U/T – S

∂(A/T)/∂T = 1/T(∂A/∂T) – A/T2 =

= S/T –A/T2 = -U/T2

Expressions for Thermodynamic Properties

so that from we have

2

,

(18)N V

T T= − ∂

lnln (19)

A Qk dT k Q C

T T

∂= − = − +∂∫

Entropie S

Nous avons vu que S = Nk ln Z + ββββkU = Nk ln Z + U/T

Since A=U-TS we have S=(U-A)/T2

,

ln (17)

N V

QU kT

T

∂ = ∂

Z

ZkT

Aln−=

Expressions for Thermodynamic Properties

ln Q∂

• Entropy and the Probability Distribution

• From the distribution law, (15), ,we have/ /nE kTnP e Q−=

ln / lnn nP E kT Q= − −

ZkT

ln−=

,

lnln (20)

N V

QS kT k Q C

T

∂ = + − ∂

Page 19: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Comparison with eqn. (20) shows that1

Multiplying throughout by Pn and summing over all n gives

∑∑∑ −−=n nnn nnn n PQPE

kTPP ln

1ln

= = = −∑ ∑

Expressions for Thermodynamic Properties

Thus, entropy is directly related to the probability distribution

1ln lnn nn

P P U QkT

= − −∑ n n nn nU P E E e= = = −∑ ∑

ln (21)n nnS k P P C= − −∑

• Pressure, P

TNTN V

QkTP

V

AP

,,

ln

∂=⇒

∂∂−= (22)

• Chemical potential, m

lnN

QkTµ

N

∂∂−=⇒

∂∂= (23)

Expressions for Thermodynamic Properties

'' ,,,, NVTiNVTi NkTµ

−=⇒

= (23)

• Heat capacity, Cv

VNVNv

VNv

T

QkT

T

QkTC

T

UC

,2

22

,,

lnln2

∂∂+

∂=⇒

∂∂= (24)

• Enthalpy, H

TNVN V

QkTV

T

QkTHPVUH

,,

2 lnln

∂+

∂=⇒+= (25)

Page 20: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

La définition statistique de la capacité calorifique –fluctuations d'énergie

( ) ( ) EEEEE 2222δ =><−>=<><−=

( ) VVN

CkTT

EkTE

2

,

22 =

∂∂=δ

( ) ( )

( ) VN

VNVN

ii

iii

i

EZ

ZZZZ

EPEP

,

22

,22

,221

2

2

//ln

//

ββ

ββ

∂><∂−=

∂∂=

=∂∂−∂∂=

=

−=

−−

∑∑

In the semi-classical approximation, we assume that the translational and

(extended) motions can be treated classically.

• Exceptions would be light molecules (H2, He, HF, etc.) at low temperatures

• In this approximation, the Hamiltonian operator can be written as:

H = H cl + H qu

H

Semi-classical approximation

where H cl corresponds to coordinates that can be treated classically

(translation, rotation),

and H qu to those that must be treated quantally (electronic, vibration)

• We further assume that there are two independent set of quantum states,

corresponding to H cl and H qu, respectively.

→ this implies neglect of interaction between vibrations, translations and

rotations

Page 21: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

qun

clnn PPP = and • We can now write quclQQQ = , where

∑∑ −−

−−

==

==

n

Eβqu

n

Eβcl

qu

Eβqu

ncl

Eβcl

n

qun

cln

qun

cln

eQeQ

Q

eP

Q

eP

,

,

Semi-classical approximation

∑∑nn

Because the intermolecular forces are assumed to have no effect on the quantum states,

Enqu is just a sum of single-molecule quantum energies, which are themselves mutually

independent:

nNnnnqun εεεεE ++++= ...321

and Nququ qQ = , where ==∑

j

βεNqu

qujeq molecular partition function

• Therefore, Qqu is independent of density: it is the same for a liquid, solid

or ideal gas.

• In classical statistical mechanics, the probability distribution

clEβcl

n QePcln−=

is replaced by a continuous probability density

( )Nω

NNN pωprP ,,,for the classical states in phase space. Here:

Semi-classical approximation

for the classical states in phase space. Here:

== NN rrrrr ,...,,, 321 locations of centers of molecules 1, 2, … N

==N

N ppppp ,...,,,321 translational momenta conjugate to Nrr ,,1 K

== NN ωωωωω ,...,,, 321 orientations of molecules 1, 2, … N

== NωωωωNω ppppp ,...,,, 321 orientational momenta conjugate to Nωω ,...,1

Page 22: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Classical Partition Function

( )∫ ∫

−==

kT

,p,ωp,rdpωdpdrd

hNhN

ZQ

NNNNω

NNNNfNfcl

Hexp

!

1

!'

K

• f = number of classical degrees of freedom per molecule

= 6 for non-linear molecules

= 5 for linear molecules

• The factor (N !)-1 arises because molecules are indistinguishable• The factor (N !)-1 arises because molecules are indistinguishable

• The factor h-Nf corrects for the fact that the phase coordinates cannot be

precisely defined (uncertainty principle, see Appendix 3D GG)

where

( )∫ ∫

−=

kT

,p,ωp,rdpωdpdrdZ

NNNNω

NNN Hexp'

K

Is called phase integral

• The classical partition can be factorized:

NfclhN

ZQ

!= crtcl QQQQ =

with232 2

exp1 N

iN mkTπppdQ

=

−= ∫ ∑

Factoring the partition function Q

23

22

exp1

i

iNNt

h

mkTπ

mkT

ppd

hQ

=

−= ∫ ∑

orN

ttQ 3Λ

−= , where

=

=

212

mkTπ

ht

thermal de Broglie wavelength of the molecules

Page 23: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

where

rΛkTIπ

h

kTIπ

h

kTIπ

h

π zyx

21

2

221

2

221

2

2

888

1

= (nonlinear)

Factoring the partition function Q

( )N

rαi α

αiNNf

N

r kTI

JJd

hQ −

− =

−= ∫ ∑ Λ

2exp

Ω2

3

IkTπ

h

kTIπkTIπkTIπ zyx

2

2

8

888

=

(linear)

( )N

ckTωrNNNc

N

ZueωdrdN

QNN

Ω!Ω!

1 , == ∫−

and

In these equations,

∫= ωdΩ

πφdθθd

πχdφdθθd

π

o

π

o

π

o

π

o

π

o

4sin

8sin

2

222

==

==

∫∫

∫∫∫ (nonlinear)

(linear)

Factoring the partition function Q

oo

• Qc is the only part of Q that depends on ( ),N NωrU , and the only part

that depends on the volume (density).

• For an ideal gas, 0=U and!N

VQ

N

c = , so

kTρV

NkT

V

QkTP

TN

==

∂=,

ln

This equation of state is known to be true independently from kinetic theory.

Page 24: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

σ2= <f2> - <f>2 where ∑∑==

==n

ii

n

ii xf

nfxf

nf

1

2

1

2 )(1

)(1

The accuracy depends on the number of trials in the MC method. One possible measure of the error is the variance σσσσ2:

σ cannot be a direct measure of the error !!!!

One way to obtain an estimate for the error is to make additional runs of n trials each. Each run of n trials yields a mean value (or measurement) which we denote as Mα. The

Simulation error analysis

Each run of n trials yields a mean value (or measurement) which we denote as Mα. The magnitude of the differences between the measurements is a measure of the error

associated with a single measurement:

σmm2= <M2> - <M>2 where

∑∑==

==mm

Mm

MMm

M1

2

1

2 11

αα

αα

Error estimation (standard mean deviation) : σm= σ/m1/2

Simulation error analysis

G

What is the minimal length n ?

n steps

Trajectory mn

m bins

2

2

limσσσσσσσσ m

nnc

nn

∞→=

n

Page 25: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Error estimation (standard mean deviation) : σm= σ/n1/2

Proof:

One may show that this relation is exact in the limit of a very large number of measurements

∑∑∑

= ==

=

==

=

m n

ii

m

n

ii

xnm

Mm

M

xn

M

1 1,

1

1,

11

1

ααα

αα

The difference between measurement α and the mean : −= MMe

Simulation error analysis

The difference between measurement α and the mean :

∑=

=

−=m

m em

MMe

1

22 1

αα

αα

σ

We now relate σm to the variance of the individual trials : Mxd ii −= ,, αα

We write: ∑∑∑===

=−=−=−=n

ii

n

ii

n

ii d

nMx

nMx

nMMe

1,

1,

1,

1)(

11ααααα

== ∑∑ ∑∑== ==

n

jj

m n

ii

m

m dn

dnm

em 1

,1 1

,1

22 1111α

αα

αασ

We may calculate :

We expect that dα,I are independent and equally positive or negative on average. Hence in the limit of a very large number of measurements, we

Simulation error analysis

∑∑∑= ==

==m n

i

i

m

m dmn

em 1 1

,2

21

22 11

αα

αασ

nm

22 σσ =

average. Hence in the limit of a very large number of measurements, we expect that only the terms with i=j will survive:

Because the definition of the variance, we have:

= ∑∑= =

m n

iim d

mn 1 1

2,

2 1

αασ

Page 26: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Ab Initio Methods

Calculate properties from first principles, solving the

Schrödinger (or Dirac) equation numerically.

Pros:

• Can handle processes that involve bond

breaking/formation, or electronic rearrangement (e.g.

chemical reactions).

• Methods offer ways to systematically improve on the

Electron localization function for

(a) an isolated ammonium ion

and (b) an ammonium ion with

its first solvation shell, from ab

initio molecular dynamics. From

Y. Liu, M.E. Tuckerman, J. Phys.

Chem. B 105, 6598 (2001)

• Methods offer ways to systematically improve on the

results, making it easy to assess their quality.

• Can (in principle) obtain essentially exact properties

without any input but the atoms conforming the system.

Cons:

• Can handle only small systems, about O(102) atoms.

• Can only study fast processes, usually O(10) ps.

• Approximations are usually necessary to solve the eqns.

Semi-empirical Methods

Use simplified versions of equations from ab initio methods,

e.g. only treat valence electrons explicitly; include

parameters fitted to experimental data.

Pros:

• Can also handle processes that involve bond

breaking/formation, or electronic rearrangement.

• Can handle larger and more complex systems than ab

Structure of an oligomer of

polyphenylene sulfide

phenyleneamine obtained with

the semiempirical method. From

R. Giro, D.S. Galvão, Int. J. Quant.

Chem. 95, 252 (2003)

• Can handle larger and more complex systems than ab

initio methods, often of O(103) atoms.

• Can be used to study processes on longer timescales

than can be studied with ab initio methods, of about

O(10) ns.

Cons:

• Difficult to assess the quality of the results.

• Need experimental input and large parameter sets.

Page 27: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Atomistic Simulation Methods

Use empirical or ab initio derived force fields, together

with semi-classical statistical mechanics (SM), to

determine thermodynamic (MC, MD) and transport (MD)

properties of systems. SM solved ‘exactly’.

Pros:

• Can be used to determine the microscopic structure of

more complex systems, O(105-6) atoms.

Structure of solid Lennard-Jones

CCl4 molecules confined in a

model MCM-41 silica pore. From

F.R. Hung, F.R. Siperstein, K.E.

Gubbins, in progress.

more complex systems, O(10 ) atoms.

• Can study dynamical processes on longer timescales, up

to O(1) ms

Cons:

• Results depend on the quality of the force field used to

represent the system.

• Many physical processes happen on length- and

timescales inaccessible by these methods, e.g. diffusion

in solids, many chemical reactions, protein folding,

micellization.

Mesoscale Methods

Introduce simplifications to atomistic methods to remove

the faster degrees of freedom, and/or treat groups of

atoms (‘blobs of matter’) as individual entities interacting

through effective potentials.

Pros:

• Can be used to study structural features of complex

systems with O(108-9) atoms.

• Can study dynamical processes on timescales inaccessible

Phase equilibrium between a

lamellar surfactant-rich phase

and a continuous surfactant-

poor phase in supercritical CO2,

from a lattice MC simulation.

From N. Chennamsetty, K.E.

Gubbins, in progress.

• Can study dynamical processes on timescales inaccessible

to classical methods, even up to O(1) s.

Cons:

• Can often describe only qualitative tendencies, the

quality of quantitative results may be difficult to

ascertain.

• In many cases, the approximations introduced limit the

ability to physically interpret the results.

Page 28: Monte Carlo, Molecular Dynamicspfleurat.free.fr/RFCT/Cours_1_BK.pdf · Multiscale methods link to macroscopic models Quantum Monte Carlo 2010 Mesoscale modeling Ab initio molecular

Applications: Applications: Mesoporous MaterialsMesoporous Materials

Surfactant Silica 9600 surfactant chains17400 silica unitsReduced temperature 6.5

-130

-132

Synthesis of MCM-41

-132

-134

-136

-138

-140

-142

-144

-146

-148

0 100000 200000 300000 400000 500000

cycles

Ene

rgy

per

mol

ecul

e

Equilibrium

Ref: 1) F. R. Siperstein, K. E. Gubbins, Langmuir, 19, 2049(2003)

Continuum Methods

Assume that matter is continuous and treat the properties

of the system as field quantities. Numerically solve

balance equations coupled with phenomenological

equations to predict the properties of the systems.

Pros:

• Can in principle handle systems of any (macroscopic)

size and dynamic processes on longer timescales.

Temperature profile on a laser-

heated surface obtained with

the finite-element method.

From S.M. Rajadhyaksha, P.

Michaleris, Int. J. Numer. Meth.

Eng. 47, 1807 (2000)

size and dynamic processes on longer timescales.

Cons:

• Require input (viscosities, diffusion coeffs., eqn of state,

etc.) from experiment or from a lower-scale method that

can be difficult to obtain.

• Cannot explain results that depend on the electronic or

molecular level of detail.