Deep Learning for Multiscale Molecular Modeling
Linfeng Zhang
Princeton University
June 19 2019, MoD-PMI2019, NIFS
Joint work with Han Wang, Roberto Car, Weinan E
Linfeng Zhang (PU) DL for MMM June 2019 1 / 42
Outline
1 Introduction
2 Deep Potential
3 Deep Potential Generator (DP-GEN)
4 Free energy and Reinforced Dynamics
5 Conclusions
Linfeng Zhang (PU) DL for MMM June 2019 2 / 42
Outline
1 Introduction
2 Deep Potential
3 Deep Potential Generator (DP-GEN)
4 Free energy and Reinforced Dynamics
5 Conclusions
Linfeng Zhang (PU) DL for MMM June 2019 3 / 42
Where deep learning could help?
d0,0 d1,0
d2,0
x0 d0,1 d1,1
d2,1 F(x)
x1 d0,2 d1,2
d2,2
d0,3 d1,3
x d0 d1 d2 F(x)L0 L1 L2 Lout
dp = Lp(dp−1) = φ(W p · dp−1 + bp
)Composition of analytical and nonlinear functions; Approximator for High-D functions.
Linfeng Zhang (PU) DL for MMM June 2019 4 / 42
Multi-scale Molecular Modeling
A few examples:
ab initio molecular dynamics (MD):quantum mechanics (QM) to MD, potential energy surface (PES);
Coarse-grained (CG) MD:atoms to CG “particles”, free energy surface (FES)/CG potential;
enhanced sampling/phase transition:atoms to fewer collective variables (CVs), FES.
Linfeng Zhang (PU) DL for MMM June 2019 5 / 42
Accuracy v.s. efficiency dilemma
PES as an example:
E = E(r1, ..., ri, ..., rN ).
First principle: accurate but very expensive.
For example KS-DFT, ∼ 102 atoms:
E = 〈Ψ0|HKSe |Ψ0〉,
Empirical potentials: fast but limited accuracy.For example Lennard-Jones potential
E =1
2
∑i 6=j
Vij , Vij = 4ε[(σ
rij)12 − (
σ
rij)6].
Lennard-Jones, J. E. (1924), Proc. R. Soc. Lond. A, 106 (738): 463477
Linfeng Zhang (PU) DL for MMM June 2019 6 / 42
Two important aspects
Deep learning could help for a classical of problems in multi-scalemolecular modeling.
minw
1
‖D‖∑i∈D
l(fw, f)
deep learning model fw;
dataset D;
definition of l and optimization algorithm.
Linfeng Zhang (PU) DL for MMM June 2019 7 / 42
Outline
1 Introduction
2 Deep Potential
3 Deep Potential Generator (DP-GEN)
4 Free energy and Reinforced Dynamics
5 Conclusions
Linfeng Zhang (PU) DL for MMM June 2019 8 / 42
Requirement for a reliable PES model
accuracy (e.g. uniform);
efficiency (e.g. linear scaling);
physical constraint (e.g. extensivity, symmetry);
no human intervention/ end-to-end.
Linfeng Zhang (PU) DL for MMM June 2019 9 / 42
Typical construction
E =∑i
Ei, Ei = Es(i)(ri, rjj∈N (i)), N (i) = j : rij = |rij | ≤ rc
Ei(ri, rjj∈N (i)) represented by fully connected NNs with symmetrizedinputs.Behler, J., Parrinello, M. (2007). Phys. Rev. Lett., 98(14), 146401.
Linfeng Zhang (PU) DL for MMM June 2019 10 / 42
Descriptors: Local coordinates
ez
ey
ex
z
x
y
ij
ij
ij
ij
atom i
atom j
R
or
Han, et.al., CiCP, 23, 629 (2018). Zhang, et.al., PRL, 120, 143001 (2018)
Linfeng Zhang (PU) DL for MMM June 2019 11 / 42
Descriptors: a smooth descriptor by DNN
Key: complete and adaptive.
Translation and Rotation: (Ri(Ri)T ): Ωijk = rji · rki,
Permutation: ((Gi1)TRi):∑
j∈N (i) g(rji)rji,
Finally, we propose: Di = (Gi1)TRi(Ri)TGi2.
Zhang, et.al., NeurIPS 2018Linfeng Zhang (PU) DL for MMM June 2019 12 / 42
Various systems with the same principle
Zhang, et.al., NeurIPS 2018
Linfeng Zhang (PU) DL for MMM June 2019 13 / 42
Different thermodynamic conditionsThe path integral water structures (ambient cond.)
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
0 1 2 3 4 5 6
RD
F g
(r)
r [Å]
DeePMD O−ODeePMD O−HDeePMD H−H
DFT O−ODFT O−HDFT H−H
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.5 1 1.5 2 2.5 3
P(ψ
)
ψ [rad]
DeePMDDFT
Ice in different thermodynamic states
0.0
1.0
2.0
3.0
4.0
5.0
6.0
0 1 2 3 4 5 6
RD
F g
(r)
r [Å]
DeePMD O−ODeePMD O−HDeePMD H−H
DFT O−ODFT O−HDFT H−H
0.0
1.0
2.0
3.0
4.0
5.0
6.0
0 1 2 3 4 5 6
RD
F g
(r)
r [Å]
DeePMD O−ODeePMD O−HDeePMD H−H
DFT O−ODFT O−HDFT H−H
0.0
1.0
2.0
3.0
4.0
5.0
6.0
0 1 2 3 4 5 6
RD
F g
(r)
r [Å]
DeePMD O−ODeePMD O−HDeePMD H−H
DFT O−ODFT O−HDFT H−H
PI-ice, P=1.0 bar, T=273 K; ice P=1.0 bar,T=330 K; ice P=2.13 bar,T=238 K;
Zhang et.al. Phys.Rev.Lett 120 143001 (2018)
Linfeng Zhang (PU) DL for MMM June 2019 14 / 42
Extension to coarse-graining
z
y
x
k
j
ii(a)
i(b)
Zhang et.al. J. Chem. Phys., 149, 034101 (2018)
0.0
1.0
2.0
3.0
g(r
)
AIMDDeePMDDeePCG
DeePCG (large sys.)
-0.10
-0.05
0.00
0.05
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
g(r
) -
gA
IMD(r
)
r [nm]
0.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
1.6
0 0.2 0.4 0.6 0.8 1
P(θ
)
rc = 0.27 nm
AIMDDeePMDDeePCG
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0 0.2 0.4 0.6 0.8 1
P(θ
)
θ / π
rc = 0.456 nm
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0 0.2 0.4 0.6 0.8 1
rc = 0.37 nm
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0 0.2 0.4 0.6 0.8 1
θ / π
rc = 0.60 nm
Linfeng Zhang (PU) DL for MMM June 2019 15 / 42
Extension to electronic information
Linfeng Zhang (PU) DL for MMM June 2019 16 / 42
Extension to electronic information
Linfeng Zhang (PU) DL for MMM June 2019 17 / 42
Extension to nonadiabatic excited state dynamics
Chen, Wen-Kai, et al. J. P. C. Lett. 9.23 (2018): 6702-6708.
Linfeng Zhang (PU) DL for MMM June 2019 18 / 42
Combined with metadynamics
L. Bonati and M. Parrinello, Phys. Rev. Lett. 121, 265701
Linfeng Zhang (PU) DL for MMM June 2019 19 / 42
Extension to T-dependent free energy
(in preparation)Linfeng Zhang (PU) DL for MMM June 2019 20 / 42
Extension to T-dependent free energy
Left: Radial distribution functions (RDFs); Right: Rankine-Hugoniotcurve.
0 1 2 3 40
1
( c )
( b )
g (r)
A I M D N = 3 2 D P M D N = 3 2 D P M D N = 2 5 6
( a ) 4 . 5 g / c m 3 , 2 e V
0 1 2 3 40
1
6 . 0 g / c m 3 , 1 1 e V
0 1 2 30
1
8 . 1 g / c m 3 , 2 0 0 e V ( d )
g(r)
r ( Å )0 1 2 3 40
1
7 . 5 g / c m 3 , 1 0 0 0 e V
r ( Å )3 4 5 6 7 81 0 0
1 0 1
1 0 2
1 0 3
1 0 4
Pressu
re (M
bar)
D e n s i t y ( g / c m 3 )
F P M D D P M D C a u b l e N e l l i s R a g a n I I I
(in preparation)
Linfeng Zhang (PU) DL for MMM June 2019 21 / 42
Deep Potential: MD scalability
10-2
10-1
100
101
102
103
104
105
101
102
103
104
105
106
CP
U c
ore
tim
e p
er
ste
p [s]
Number of molecules
Linear ScalingC
ubic
Sca
ling
DeePMD
DFT: PBE0+TS
DFT
DeePMD
Linfeng Zhang (PU) DL for MMM June 2019 22 / 42
Open source software DeePMD-kit
TensorFlow: efficient network operators
LAMMPS, i-PI; MPI/GPU support.
Free download from https://github.com/deepmodeling/deepmd-kitComp.Phys.Comm., 0010-4655 (2018).
Linfeng Zhang (PU) DL for MMM June 2019 23 / 42
Outline
1 Introduction
2 Deep Potential
3 Deep Potential Generator (DP-GEN)
4 Free energy and Reinforced Dynamics
5 Conclusions
Linfeng Zhang (PU) DL for MMM June 2019 24 / 42
Two important aspects, revisited
minw
1
‖D‖∑i∈D
l(fw, f)
deep learning model fw;
dataset D;
definition of l and optimization algorithm.
Linfeng Zhang (PU) DL for MMM June 2019 25 / 42
Active learning: the DP-GEN scheme
Training/Fitting:model/representation.
Exploration:sampler and error indicator;DPMD and model deviation
ε = maxi
√〈‖fi − 〈fi〉‖2〉
Labeling:ab initio calculator.
Example: Al-Mg alloy0.0044 % explored confs. arelabeled
Zhang et.al. Phys. Rev. Mat. 3, 023804
Linfeng Zhang (PU) DL for MMM June 2019 26 / 42
DP-GEN: test of Al
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
2 3 4 5 6 7 8 9 10 11 12 13 14
r [Å]
Exp. 943K
DP 943K
MEAM 943K
4 5 6 7
0.6
0.8
1.0
1.2
0
2
4
6
8
10
12
Γ X K Γ L
ν (
TH
z)
q
EXP
DP
MEAM 0.4
0.5
0.6
0.7
0.8
0.9
1
1.1
1.2
0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2
Surf
ace form
ation e
nerg
y b
y D
P/M
EA
M [J/m
2]
Surface formation energy by DFT [J/m2]
DP: FCC Al
DP: HCP Mg
MEAM: FCC Al
MEAM: HCP Mg
Linfeng Zhang (PU) DL for MMM June 2019 27 / 42
DP-GEN: tests based on Materials Project
Linfeng Zhang (PU) DL for MMM June 2019 28 / 42
DP-GEN: tests based on Materials Project
Linfeng Zhang (PU) DL for MMM June 2019 29 / 42
Irradiation damage simulation
Linfeng Zhang (PU) DL for MMM June 2019 30 / 42
DP-GEN for waterP
ressu
re
Temperature
1 Pa
10 Pa
100 Pa
1 kPa
10 kPa
100 kPa
1 MPa
10 MPa
100 MPa
1 GPa
10 GPa
100 GPa
1 TPa
10 µbar
100 µbar
1 mbar
10 mbar
100 mbar
1 bar
10 bar
100 bar
1 kbar
10 kbar
100 kbar
1 Mbar
10 Mbar0K 50K 100K 150K 200K 250K 300K 350K 400K 450K 500K 550K 600K 650K
-250 °C -200 °C -150 °C -100 °C -50 °C 0 °C 50 °C 100 °C 150 °C 200 °C 250 °C 300 °C 350 °C
Freezing point at 1 atm273.15 K, 101.325 kPa
Boiling point at 1 atm373.15 K, 101.325 kPa
Critical point647 K, 22.064 MPa
Solid/Liquid/Vapour triple point273.16 K, 611.657 Pa
251.165 K, 209.9 MPa256.164 K, 350.1 MPa
272.99 K, 632.4 MPa
355.00 K, 2.216 GPa
238.5 K, 212.9 MPa
248.85 K, 344.3 MPa
218 K, 620 MPa
278 K, 2.1 GPa
100 K, 62 GPa
Solid
Ic Ih
XI(hexagonal)
X
VII
VI
VIII
XVIX
XI(ortho-
rhombic)
II V
III Liquid
Vapour
SI
Ionic. Liq.
2500K
0K 200K 400K 600K
1Pa
1KPa
1MPa
1GPa
T
P
Reference model: DFT at the classical SCAN level;
Starting configurations: relaxed Ice I-XV at T = 0 K and equilibratedliquid at T = 330 K;
Range of thermodynamic conditions: red dashed box;
number of MD snapshots: DPMD exploration: 1.4 billion, DFTcalculation: 32 thousand (∼0.002% of the former).Typical AIMD trajectory: 100 thousand snapshots (50-100 ps).
number of DP-GEN iterations: 100.Linfeng Zhang (PU) DL for MMM June 2019 31 / 42
Thermodynamic integration (TI) for the phasediagram
Special issues: size effect; proton disorder, etc.
Linfeng Zhang (PU) DL for MMM June 2019 32 / 42
Water phase diagram modeled by DP+SCAN
Linfeng Zhang (PU) DL for MMM June 2019 33 / 42
High-pressure phases modeled by DP+SCAN
Linfeng Zhang (PU) DL for MMM June 2019 34 / 42
Outline
1 Introduction
2 Deep Potential
3 Deep Potential Generator (DP-GEN)
4 Free energy and Reinforced Dynamics
5 Conclusions
Linfeng Zhang (PU) DL for MMM June 2019 35 / 42
Free energy and deep neural networks
Exploring configuration space, phase transition, ...
I high dimensionality of the collective variable space;
I high energy barriers and complex energy landscape.
Metadynamics PNAS 99(20):1256212566, 2002):
Temperature accelerated (Chem. Phys. Lett., 426(1):168175, 2006.)
curse of dimensionality.
Linfeng Zhang (PU) DL for MMM June 2019 36 / 42
Reinforced dynamics
Potential energy Free energy
Method DP-GEN Reinforced dynamics
Model Deep potential ResNet
Sampler Deep potential MD Biased MD
Label Electronic struct. Restrained MD
Linfeng Zhang (PU) DL for MMM June 2019 37 / 42
Reinforced dynamics
reinforcement learning: state, action, best policy, reward;
reinforced dynamics (RiD): atomic system, biased potential, FES,model deviation.
ε2(s) =⟨‖F(s)−F(s)‖2
⟩, fi(r) = −∇riU(r)+σ(ε(s(r)))∇riA(s(r)),
Zhang, et.al. J.Chem.Phys 148, 124113 (2018).
Linfeng Zhang (PU) DL for MMM June 2019 38 / 42
Reinforced dynamics
Left: Tripeptide: brute-force simulation (∼50 µs) v.s. RiD (10 nsbiased + 190 ns restrained):
Right: higher dimensional FES: ala-10 and 20 CVs.
Linfeng Zhang (PU) DL for MMM June 2019 39 / 42
Outline
1 Introduction
2 Deep Potential
3 Deep Potential Generator (DP-GEN)
4 Free energy and Reinforced Dynamics
5 Conclusions
Linfeng Zhang (PU) DL for MMM June 2019 40 / 42
Conclusions
Model construction and data exploration for PES and FES;
Useful models: Deep Potential, DP-GEN, reinforced dynamics;check https://github.com/deepmodeling/deepmd-kit
Fundamental problems: quantum many-body problem, DFT,dynamics.
Linfeng Zhang (PU) DL for MMM June 2019 41 / 42
AcknowledgementsAdvisors
Roberto Car, Weinan E
Collaborators
Han Wang, De-Ye Lin (IAPCM)
Jiequn Han, Yixiao Chen, Hsin-Yu Ko, Marcos Andrade (Princeton),
Wissam A Saidi (Univ. of Pittsburgh), Xifan Wu (Temple)
Mohan Chen, Yuzhi Zhang (Peking Univ.)
Fundings and computational resources
Tiger@Princeton, BIBDR, & NERSC;
ONR grant N00014-13-1-0338, DOE grants DE-SC0008626 andDE-SC0009248, and NSFC grants U1430237 and 91530322;
Computational Chemical Science Center: Chemistry in Solution andat Interfaces (DE-SC0019394).
Linfeng Zhang (PU) DL for MMM June 2019 42 / 42