Numerical methods in molecular dynamics and multiscale problems

Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Numerical methods in molecular
dynamics and multiscale problems
Two examples
T. Lelièvre
CERMICS - Ecole des Ponts ParisTech & MicMac project-team - INRIA
Horizon Maths
December 2012
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
Introduction
The aim of molecular dynamics simulations is to understand the
relationships between the macroscopic properties of a molecular
system and its atomistic features. In particular, one would like to to
evaluate numerically macroscopic quantities from models at the
microscopic scale.
Some examples of macroscopic quantities:
(i) Thermodynamics quantities (averages of some observables
over configurations): stress, heat capacity, free energy,...
Eµ (ϕ(X )).
(ii) Dynamical quantities (averages of some observables over
trajectories): transition rates, transition path...
E(F((X t )t≥0 )).
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Introduction
A “real” example: Diffusion of adatoms on a surface. (A. Voter).
Los Alamos
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Introduction
Many applications in various fields: biology, physics, chemistry,
materials science. Molecular dynamics computations consume
today a lot of CPU time.
A molecular dynamics model amounts essentially in choosing a
potential V which associates to a configuration
(x 1 , ..., x N ) = x ∈ R3N an energy V (x 1 , ..., x N ). (N is large !).
In the canonical (NVT) ensemble, configurations are distributed
according to the Boltzmann-Gibbs probability measure:
d µ(x) = Z −1 exp(−βV (x)) d x,
R
where Z = exp(−βV (x)) d x is the partition function and
β = (kB T )−1 is proportional to the inverse of the temperature.
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
Introduction
To sample µ, ergodic dynamics wrt to µ are used. A typical
example is the over-damped Langevin (or gradient) dynamics:
p
d X t = −∇V (X t ) dt + 2β −1 d W t .
This is a simple gradient descent dynamics, perturbed by noise.
To compute dynamical quantities, these are also typically the
dynamics of interest. Thus,
1
Eµ (ϕ(X )) ≃
T
Z
T
0
N
1 X
ϕ(X t ) dt and E(F((X t )t≥0 )) ≃
F((X m
t )t≥0 ).
N
m=1
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
Introduction
Difficulty: In practice, X t is a metastable process, so that the
convergence to equilibrium is very slow.
Timescale of the microscopic process: 10−15 s.
TImescale of the macroscopic process: from 10−6 s to 102 s.
A 2d schematic picture: Xt1 is a slow variable (a metastable dof) of
the system.
x2
V (x1 , x2 )
Xt1
x1
t
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
Introduction
We will present some algorithms using parallel architectures to
circumvent the central numerical difficulty: metastability
For computing thermodynamics quantities, there is a clear
classification of available methods, and the difficulties are now well
understood (in particular for free energy computations, see for
example the review [TL, Rousset, Stoltz, 2010]). On the opposite,
computing efficiently dynamical quantities remains a challenge.
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
Introduction
Outline of the talk:
1. The Parallel Replica dynamics: This is one instance of an
algorithm to generate efficiently metastable dynamics.
2. A multiscale parareal algorithm: How to use a reduced
description to accelerate dynamical microscopic simulations ?
Remark: There are many other techniques: splitting techniques
(FFS, TIS), hyperdynamics and temperature accelerated dynamics
[Voter, Fichthorn], the string method [E, Ren, Vanden-Eijnden], transition path
sampling methods [Chandler, Bolhuis, Dellago], milestoning techniques [Elber,
Schuette, Vanden-Eijnden], etc...
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
The Parallel Replica Algorithm
The Parallel Replica Algorithm, proposed by A.F. Voter in 1998, is
a method to get efficiently a "coarse-grained projection" of a
dynamics.
Let us consider again the overdamped Langevin dyanmics:
p
d X t = −∇V (X t ) dt + 2β −1 d W t
and let assume that we are given a smooth mapping
S : Rd → N
which to a configuration in Rd associates a state number. Think of
a numbering of the wells of the potential V .
The aim of the parallel replica dynamics is to generate very
efficiently a trajectory (St )t≥0 which has (almost) the same law as
(S(X t ))t≥0 .
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Decorrelation step: run the dynamics on a reference walker...
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
The Parallel Replica Algorithm
Decorrelation step: ... until it remains trapped for a time τcorr .
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Dephasing step: generate new initial conditions in the state.
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Dephasing step: generate new initial conditions in the state.
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Dephasing step: generate new initial conditions in the state.
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Dephasing step: generate new initial conditions in the state.
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Dephasing step: generate new initial conditions in the state.
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Dephasing step: generate new initial conditions in the state.
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Dephasing step: generate new initial conditions in the state.
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Parallel step: run independent trajectories in parallel...
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Parallel step: ... and detect the first transition event.
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
Parallel step: update the time clock: Tsimu = Tsimu + NT .
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
A new decorrelation step starts...
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The Parallel Replica Algorithm
New decorrelation step
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
The Parallel Replica Algorithm
In summary, three steps:
• Decorrelation step: does the reference walker remain trapped
in a set ?
• Dephasing step: prepare many initial conditions in this
trapping set.
• Parallel step: detect the first escaping event.
Some numerical simulations...
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
The Parallel Replica Algorithm
Question: Why does this work ? Why is there no error introduced
by the parallel step ?
This is related to the very general question: why does the state to
state dynamics is (almost) Markovian ?
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The quasi-stationary distribution
Answer: there exists a probability distribution ν (the QSD)
attached to each state, such that:
• If the process X t remains in the well for a sufficiently long
time, then X t is distributed according to ν.
• If the process starts from ν, then, (i) the exit time is
exponentially distributed and (ii) independent from the exit
point.
This justifies the algorithm.
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
The quasi-stationary distribution
Error estimate: Let TW denote the exit time from W for the
C
,
stochastic process X t . Then, for τcorr ≥ λ2 −λ
1
sup
f ,kf kL∞ ≤1
E(f (TW − t, X TW )|TW ≥ τcorr ) − Eν (f (TW , X TW ))
≤ C exp(−(λ2 − λ1 )τcorr ),
where −λ2 < −λ1 < 0 are the two first eigenvalues of
L∗ = div (∇V + β −1 ∇) with absorbing boundary conditions on
∂W .
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
The Parallel Replica Algorithm: conclusions
In summary,
• We know what τcorr should be, and thus: (i) we can try to
estimate it and (ii) we can apply this algorithm to other fields.
• The algorithm is efficient if the typical time it takes to leave
the well is much smaller than the typical time it takes to reach
the local equilibrium (QSD). (This is a spectral gap requirement.)
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
A multiscale parareal algorithm: the main idea
We would like to describe an algorithm which consists in coupling a
macroscopic model with a microscopic model in order to efficiently
generate the microscopic dynamics. The macroscopic model is the
predictor, and the microscopic model is the corrector.
Question 1: obtaining a reduced description.
Question 2: using it in a multiscale parareal algorithm.
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Effective dynamics
Recall the original dynamics
d X t = −∇V (X t ) dt +
p
2β −1 d W t .
We are given a smooth one dimensional function ξ : Rd → R.
Problem: propose a Markovian dynamics (say on zt ∈ R) that
approximates the dynamics (ξ(X t ))t≥0 .
Conclusion
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
Construction of the effective dynamics
By Itô, one has
d ξ(X t ) = (−∇V ·∇ξ+β −1 ∆ξ)(X t ) dt+
First attempt:
d z̃t = b̃(t, z̃t ) dt +
with
p
∇ξ(X t )
2β −1 |∇ξ(X t )|
·dWt
|∇ξ(X t )|
p
2β −1 σ̃(t, z̃t ) dBt
b̃(t, z̃) = E (−∇V · ∇ξ + β −1 ∆ξ)(X t )ξ(X t ) = z̃
σ̃ 2 (t, z̃) = E |∇ξ|2 (X t )ξ(X t ) = z̃ .
Then, for all time t ≥ 0, L(ξ(X t )) = L(z̃t ) ! But b̃ and σ̃ are
untractable numerically...
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
Construction of the effective dynamics
By Itô, one has
d ξ(X t ) = (−∇V ·∇ξ+β −1 ∆ξ)(X t ) dt+
The effective dynamics:
dzt = b(zt ) dt +
with
p
∇ξ(X t )
·dWt
2β −1 |∇ξ(X t )|
|∇ξ(X t )|
p
2β −1 σ(zt ) dBt
b(z) = Eµ (−∇V · ∇ξ + β −1 ∆ξ)(X )ξ(X ) = z
σ 2 (z) = Eµ |∇ξ|2 (X )ξ(X ) = z .
Related approaches: Mori-Zwanzig and projection operator
formalism [E/Vanden-Eijnden, ...], asymptotic approaches [Papanicolaou, Freidlin,
Pavliotis/Stuart, ...].
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
Error analysis: time marginals
The effective dynamics is ergodic (detailed balanced) wrt ξ ∗ µ.
Moreover Under the assumptions (|∇ξ| = Cte for simplicity):
(H1) The conditional probability measures µ(·|ξ(x) = z) satisfy a
Logarithmic Sobolev Inequality with constant ρ,
(H2) Bounded coupling assumption: k∇∇V ⊥ ∇∇V V kL∞ ≤ κ,
(H3) The probability measure µ satisfies a Logarithmic Sobolev
Inequality with constant R,
Then, ∃C > 0, ∀t ≥ 0,
kL(ξ(X t )) − L(zt )kTV
!
κ
H(L(X 0 )|µ) − H(L(X t )|µ) , exp(−β −1 Rt) .
≤ C min
ρ
Typically ρ ≫ R.
The proof [Legoll, TL] is PDE-based. It is inspired by a decomposition
of the entropy proposed in [Grunewald/Otto/Villani/Westdickenberg], and entropy
estimates.
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
A multiscale parareal algorithm
The basic algorithm is very much inspired by the parareal algorithm
[Lions, Maday Turinici].
Let us present it in a very simple setting: Consider the fine
dynamics:

 ẋ = αx + p T y ,
 ẏ = 1 (qx − Ay ) .
ǫ
The variable u = (x, y ) contains a slow variable x ∈ R and a fast
variable y ∈ Rd−1 . Associated to that dynamics, we have an
expensive fine propagator F∆t over the time range ∆t.
Under appropriate assumption, a natural coarse dynamics (ǫ → 0)
on x is:
Ẋ = (α + p T A−1 q)X .
Associated to that dynamics, we have a cheap coarse propagator
G∆t over the time range ∆t.
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
The algorithm
Let us now present the algorithm
Let u(0) = u0 be the initial condition.
1. Initialization:
a) Compute {X0n }0≤n≤N sequentially by using the coarse
propagator:
X00 = R(u0 ),
X0n+1 = G∆t (X0n ).
b) Lift the macroscopic approximation to the microscopic level:
u00 = u0
and, for all 1 ≤ n ≤ N, u0n = L(X0n ).
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
n
2. Assume that, for some k ≥ 0, the sequences uk 0≤n≤N and
n
Xk 0≤n≤N are known. To compute these sequences at the
iteration k + 1,
a) For all 0 ≤ n ≤ N − 1, compute (in parallel) using the coarse
and the fine-scale propagators
n+1
Xk
= G∆t (Xkn ),
u n+1
= F∆t (ukn ).
k
b) For all 0 ≤ n ≤ N − 1, evaluate the jumps (the difference
between the two propagated values) at the macroscopic level:
n+1
Jkn+1 = R(u n+1
k ) − Xk
.
n sequentially by
c) Compute Xk+1
0≤n≤N
n+1
0
n
Xk+1
= R(u0 ),
Xk+1
= G∆t (Xk+1
) + Jkn+1 .
n+1 d) Compute uk+1
by matching the result of the local
0≤n≤N−1
microscopic computation, u n+1
k , on the corrected macroscopic
n+1
state Xk+1
:
0
uk+1
= u0
and, for all 0 ≤ n ≤ N − 1,
n+1
n+1
uk+1
= P(Xk+1
, u n+1
k ).
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
Error analysis
In the simple setting above, the restriction, lifting and matching
operators we use are: R(x, y ) = x, L(X ) = (X , (A−1 q)X ) and
P(X , (x, y )) = (X , y ). Let us assume that F∆t and G∆t are exact.
Then the errors on the macroscopic variable and the microscopic
variable are:
for all k ≥ 0,
sup |Xkn − Ru(tn )| ≤ C ǫ1+⌈k/2⌉ ,
0≤n≤N
for all k ≥ 0,
sup kukn − u(tn )k ≤ C ǫ1+⌊k/2⌋ ,
0≤n≤N
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
100
10−4
10−4
N
e / ku(tN )k
100
10−8
k
k
k
k
k
k
k
10−8
k
k
N
E / |x(tN )|
Numerical results
10−12
10−16
10−5
10−4
10−3
ǫ
10−2
10−1
10−12
10−16
10−5
10−4
10−3
ǫ
10−2
10−1
Work in progress: extensions to nonlinear problems, stochastic
problems, ....
=0
=1
=2
=3
=4
=5
=6
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
Conclusion
Notice that the numerical methods we have presented are based on
some dimension reduction and coarse-graining techniques (through
the functions ξ or S). They are easy to parallelize.
Two useful mathematical tools to quantify metastability: LSI and
QSD.
Introduction
The Parallel Replica Algorithm
A multiscale parareal algorithm
Conclusion
Conclusion
A few references:
• C. Le Bris, T. Lelièvre, M. Luskin and D. Perez, A mathematical
formalization of the parallel replica dynamics, Monte Carlo Methods
and Applications, 18(2), 119-146, 2012.
• F. Legoll and T. Lelièvre, Effective dynamics using conditional
expectations, Nonlinearity, 23, 2131-2163, 2010.
• F. Legoll, T. Lelièvre and G. Samaey, A micro-macro parareal
algorithm: application to singularly perturbed ordinary differential
equations, http://arxiv.org/abs/1204.5926.