A Quasi Time-Reversible scheme based on density matrix extrapolation on the Grassmann manifold for Born-Oppenheimer Molecular Dynamics

Federica Pes Dipartimento di Chimica e Chimica Industriale, Università di Pisa, Via G. Moruzzi 13, 56124 Pisa, Italy Étienne Polack CERMICS, École des Ponts and Inria Paris, 6 & 8 avenue Blaise Pascal, 77455 Marne-la-Vallé, France Patrizia Mazzeo Dipartimento di Chimica e Chimica Industriale, Università di Pisa, Via G. Moruzzi 13, 56124 Pisa, Italy Geneviève Dusson Laboratoire de Mathématiques de Besançon, UMR CNRS 6623, Université de Franche-Comté, 16 route de Gray, 25030 Besançon, France Benjamin Stamm Institute of Applied Analysis and Numerical Simulation, University of Stuttgart, 70569 Stuttgart, Germany Filippo Lipparini Dipartimento di Chimica e Chimica Industriale, Università di Pisa, Via G. Moruzzi 13, 56124 Pisa, Italy
Abstract

This article introduces the so-called Quasi Time-Reversible (QTR G-Ext) scheme based on Grassmann extrapolation of density matrices for an accurate calculation of initial guesses in Born-Oppenheimer Molecular Dynamics (BOMD) simulations. The method shows excellent results on four large molecular systems, that are representative of real-life production applications, ranging from 21 to 94 atoms simulated with Kohn-Sham (KS) density functional theory surrounded with a classical environment with 6k to 16k atoms. Namely, it clearly reduces the number of self-consistent field iterations, while at the same time achieving energy-conserving simulations, resulting in a considerable speed-up of BOMD simulations even when tight convergence of the KS equations is required.

Ab-initio Born-Oppenheimer Molecular Dynamics (BOMD) is a very powerful and versatile tool to simulate molecular processes where the quantum nature of the system is not negligible. Unfortunately, this comes at a high computational price, which stems from the necessity of solving the quantum mechanical (QM) equations, typically Kohn-Sham Density Functional Theory (KS-DFT) equations, to compute the energy and forces at every time step. Such equations are nonlinear and are solved using a fixed-point iterative method known as Self-Consistent Field [33] (SCF). Achieving SCF convergence typically requires, in a standard single-point run, up to 20 iterations, making the MD simulation very expensive, as in turn the SCF has to be performed tens of thousands of times. Two main families of methods have been developed to address such a limitation. In extended Lagrangian methods, such as Car-Parrinello Molecular Dynamics (CPMD)[6] or Atom-centered Density matrix propagation (ADMP)[35], the electronic degrees of freedom are propagated, avoiding thus the need of solving the SCF problem. This requires one to endow the electronic degrees of freedom with a fictitious mass, that needs to be small enough to keep the trajectory close to its Born-Oppenheimer counterpart. As a consequence, rather short time steps need to be used. A different strategy relies on developing extrapolation techniques[8, 1, 2, 31, 12, 13, 36, 37, 22, 23, 21, 39] for BOMD that allow one to converge the SCF in a limited number of iterations. In this work, we choose the second strategy, which is particularly effective for calculations using localized basis sets, e.g., Gaussian-type orbitals. The extrapolation techniques used in BOMD use converged solutions from previous MD steps to compute an accurate guess for the SCF, limiting thus the number of iterations required to achieve convergence. A significant contribution to this field was given by Niklasson and co-workers in 2006, with their work on the time-reversible extrapolation for Born-Oppenheimer Molecular Dynamics [22]. The core concept involves generating a guess density matrix by combining the density matrices from previous steps in a symmetric and time-reversible manner. However, numerical applications showed that enforcing an exact time-reversibility can lead to errors accumulating in long-time simulations, spoiling thus the convergence properties of the algorithm in the long run. This led to the development of the Extended Lagrangian Born-Oppenheimer approach (XLBO) in 2008 [23, 21, 20, 24, 39]. In this particular case, the time-reversible extrapolation is augmented by the inclusion of a dissipative term, which serves to reduce numerical fluctuations. XLBO can be seen as an intermediate strategy between Car-Parrinello like approaches and extrapolation techniques for BOMD, as it indeed propagates an auxiliary density matrix that can either be used directly in a CPMD spirit[25, 14], possibly after refining the density using an approximate SCF solver, or used as a guess for the SCF[23]. Here, we focus on the latter approach.

In Niklasson’s XLBO scheme, the guess density is propagated in time subject to a potential that forces it to be close to the converged density. The result is a guess density that is accurate enough to achieve reasonable SCF convergence (e.g., 10510^{-5} RMS norm of the density matrix change) in as little as four iterations: Niklasson’s pioneering work has therefore been crucial in extending the applicability of BOMD. However, the XLBO method suffers of a few shortcomings. First, the guess density obtained with XLBO is not exactly idempotent [23], unless it is postprocessed using, e.g., McWeeny purification[19, 29]. Second, its performance degrades if a tightly converged SCF solution is required, as it is the case when a post Hartree-Fock method is used to compute the energy and forces (e.g., in a time-dependent DFT excited state simulation).

Recently, we proposed a different strategy to compute a guess density using linear extrapolation. This is non-trivial, because in general a linear combination of density matrices does not preserve idempotency or, in other words, density matrices belong to a differentiable manifold called Grassmann manifold and not to a vector space. Our approach uses tools from differential geometry to map the Grassmann manifold onto its tangent space, which is a vector space. It then performs a linear extrapolation on the tangent space, and then maps back the extrapolated density to the manifold. We named such a method Grassmann extrapolation (G-Ext) [29, 28]. G-Ext is an accurate and efficient strategy for ab-initio MD simulations, that has been shown to outperform XLBO, especially if a tight SCF convergence is required[29]. It has been successfully adopted in the Pisa-group for both ground- and excited-state SCF-based BOMD simulations in a polarizable multiscale framework [4, 10, 18, 26]. Unfortunately, G-Ext suffers from a serious shortcoming. Numerical experiments have shown that the extrapolation introduces a bias causing a drift in the total energy for NVE simulations[29]. Such an energy drift is modest in absolute terms (few kcal/mol in 10 ps, to be compared with total energies of hundreds of thousands kcal/mol), but large if compared with the energetics of typical chemical processes. While using a tight convergence criterion for the SCF solves the problem[29], this is not an option for expensive, production simulations, limiting thus the gains introduced with the overall approach.

In this contribution, we not only address such a limitation by introducing a new strategy to perform the extrapolation, but further improve the performance of the method. We name the new strategy Quasi Time-Reversible Grassmann extrapolation method (QTR G-Ext). This approach leverages the principles of differential geometry, similarly to the previous method, but offers enhanced accuracy, improved performances, and excellent energy conservation properties. Given a 𝒩\mathcal{N}-dimensional atomic orbitals (AO) basis, the SCF solves the following nonlinear eigenvalue problem which consists to find a matrix CC and a diagonal matrix EE such that

{F(D)C=SCECTSC=IND=CCT,\begin{cases}F(D)C=SCE\\ C^{T}SC=I_{N}\\ D=CC^{T},\end{cases}

where C𝒩×NC\in\mathbb{R}^{\mathcal{N}\times N} contains the 𝒩\mathcal{N} coefficients of the NN occupied molecular orbitals, D𝒩×𝒩D\in\mathbb{R}^{\mathcal{N}\times\mathcal{N}} is the density matrix, EN×NE\in\mathbb{R}^{N\times N} is a diagonal matrix which entries are the energy levels, FF denotes the DFT operator, S𝒩×𝒩S\in\mathbb{R}^{\mathcal{N}\times\mathcal{N}} is the overlap matrix, and INI_{N} denotes the identity matrix of order NN.

We assume that the density matrix is orthogonal. In any case, it can be transformed into such matrix by considering the Löwdin factorization of the overlap matrix SS and consequently the modified coefficient matrix C~=S1/2C\widetilde{C}=S^{1/2}C. Then the normalized density matrix D~=C~C~T=S1/2DS1/2\widetilde{D}=\widetilde{C}\widetilde{C}^{T}=S^{1/2}DS^{1/2} belongs to the manifold

𝒢r(N,𝒩)={D𝒩×𝒩|D2=D=DT,Tr(D)=N},\mathcal{G}r(N,\mathcal{N})=\left\{D\in\mathbb{R}^{\mathcal{N}\times\mathcal{N% }}|D^{2}=D=D^{T},\operatorname{Tr}(D)=N\right\},

which is isomorphic to the so-called “Grassmann manifold”, therefore we identify 𝒢r\mathcal{G}r by this name. From now on, we assume that the density matrix has been orthonormalized and we denote it by DD.

Since 𝒢r\mathcal{G}r is a differential manifold, given a point D0𝒢rD_{0}\in\mathcal{G}r, there exists a tangent space 𝒯D0𝒩×N\mathcal{T}_{D_{0}}\subset\mathbb{R}^{\mathcal{N}\times N}, such that tangent vectors Γ(D)𝒯D0\Gamma(D)\in\mathcal{T}_{D_{0}} can be associated to nearby points D𝒢rD\in\mathcal{G}r.

In MD, t𝑹(t)t\to\bm{R}(t) represents the trajectory of the nuclei. The transformation of the electronic structure can be interpreted as a trajectory denoted by tD𝑹(t)t\to D_{\bm{R}(t)} on the manifold. In order not to burden the notation, we simply indicate DD in place of D𝑹(t)D_{\bm{R}(t)}. The objective is to determine a suitable approximation for the density matrix at the next step of the molecular dynamics trajectory by extrapolating the densities from previous steps. Since the tangent space 𝒯D0\mathcal{T}_{D_{0}} is a vector space, we approximate the density matrix on 𝒯D0\mathcal{T}_{D_{0}}. In order to solve the extrapolation problem, we decompose the mapping 𝑹D\bm{R}\to D as a composition of several maps

3M\displaystyle\mathbb{R}^{3M}𝒟𝒯D0𝒢r\displaystyle\longrightarrow\mathcal{D}\longrightarrow\mathcal{T}_{D_{0}}% \longrightarrow\mathcal{G}r(1)
𝑹\displaystyle\bm{R}dΓD,\displaystyle\longmapsto d\;\;\longmapsto\Gamma\quad\longmapsto D,

where the first function 𝑹d\bm{R}\mapsto d is a map from atomic positions to molecular descriptors. Here, as a descriptor, we use the Coulomb matrix [34] dNQM×NQMd\in\mathbb{R}^{N_{\rm QM}\times N_{\rm QM}},

(d)kl={0.5zk2.4k=l,zkzl𝑹k𝑹lkl,(d)_{kl}=\begin{cases}0.5z_{k}^{2.4}&k=l,\\ \dfrac{z_{k}z_{l}}{\|\bm{R}_{k}-\bm{R}_{l}\|}&k\neq l,\end{cases}(2)

where NQMN_{\rm QM} is the number of atoms treated quantum mechanically and zkz_{k} and 𝑹k\bm{R}_{k} denotes the nuclear charge and the position of the kkth atom, respectively. Note that other descriptors can also be considered. We will detail the crucial mapping dΓd\mapsto\Gamma below. The mapping ΓExp(Γ)=D\Gamma\mapsto\operatorname{Exp}(\Gamma)=D is the so-called Grassmann exponential which maps tangent vectors on 𝒯D0\mathcal{T}_{D_{0}} to 𝒢r\mathcal{G}r, and it is a locally bijective function in a neighborhood of D0D_{0}. Its inverse DLog(D)=Γ(D)D\mapsto\operatorname{Log}(D)=\Gamma(D) is the Grassmann logarithm. These mappings are computed by means of the singular value decomposition (SVD). For mathematical details, the interested reader is referred to [28, 40, 7]. In our method, during the MD, we use a fixed reference point D0D_{0} to construct the tangent space 𝒯D0\mathcal{T}_{D_{0}}.

Let nn be the current time step of the MD. Given previous qq snapshots Γni=Log(Dni)\Gamma_{n-i}=\operatorname{Log}(D_{n-i}), for i=1,,qi=1,\ldots,q, the approximation of the density matrix representative on the tangent space is written as

Γ~n=Γnq+i=1q~αi(Γni+Γnq+i),\widetilde{\Gamma}_{n}=-\Gamma_{n-q}+\sum_{i=1}^{\widetilde{q}}\alpha_{i}\left% (\Gamma_{n-i}+\Gamma_{n-q+i}\right),(3)

where q~=q/2\widetilde{q}=q/2 if qq is even, while q~=(q1)/2\widetilde{q}=(q-1)/2 if qq is odd. We remark that if in Eq. (3), the term Γnq\Gamma_{n-q} is substituted by Γ~nq\widetilde{\Gamma}_{n-q}, a “fully” time-reversible approach (instead of quasi time-reversible) is obtained. Numerical experiments with the fully time-reversible approach, that are reported in the Supporting Information (SI), showed good behavior for total energy conservation, but unfortunately a strong increase in the number of performed SCF iterations. This is consistent with what has been observed by Niklasson and coworkers[21], who remark that exact time-reversibility under noisy conditions (e.g., not fully converged SCF) can lead to error accumulations and significantly worse SCF convergence.

The descriptors are involved in the computation of the coefficients 𝜶=[α1,,αq~]T\bm{\alpha}=[\alpha_{1},\ldots,\alpha_{\widetilde{q}}]^{T} appearing in Eq. (3). Indeed, they are computed by solving the least-squares problem with Tikhonov regularization

min𝜶q~{dn+dnqi=1q~αi(dni+dnq+i)2+ε2𝜶2},\min_{\bm{\alpha}\in\mathbb{R}^{\widetilde{q}}}\left\{\left\|d_{n}+d_{n-q}-% \sum_{i=1}^{\widetilde{q}}\alpha_{i}\left(d_{n-i}+d_{n-q+i}\right)\right\|^{2}% +\varepsilon^{2}\left\|\bm{\alpha}\right\|^{2}\right\},(4)

where \|\cdot\| denotes the 2\ell^{2}-norm and ε>0\varepsilon>0 is the regularization parameter. Since the Coulomb matrix (2) is symmetric, in the above formula djd_{j} represents the vectorized Coulomb matrix considering the lower triangle. In matrix form, it corresponds to solving the following least-squares problem

min𝜶q~[𝒃𝟎][AεIq~]𝜶2,\min_{\bm{\alpha}\in\mathbb{R}^{\widetilde{q}}}\left\|\begin{bmatrix}\bm{b}\\ \bm{0}\end{bmatrix}-\begin{bmatrix}A\\ \varepsilon I_{\widetilde{q}}\end{bmatrix}\bm{\alpha}\right\|^{2},(5)

where the vector 𝒃=dn+dnq\bm{b}=d_{n}+d_{n-q} is padded with q~\widetilde{q} zeroes, ANd×q~A\in\mathbb{R}^{N_{d}\times\widetilde{q}} is the matrix which columns are defined as A,i=dni+dnq+iA_{\cdot,i}=d_{n-i}+d_{n-q+i}, and Iq~I_{\widetilde{q}} is the identity matrix of order q~\widetilde{q}. Then the initial guess for the density matrix is obtained as the composition of the three maps in (1), where the second map dΓd\mapsto\Gamma is given by (3). Note that if this second map denoted by ff was linear, then the guess would be close to exact, namely

Γn\displaystyle\Gamma_{n}=f(dn)f(dnq+i=1q~αi(dni+dnq+i))\displaystyle=f(d_{n})\approx f\left(-d_{n-q}+\sum_{i=1}^{\widetilde{q}}\alpha% _{i}\left(d_{n-i}+d_{n-q+i}\right)\right)
=f(dnq)+i=1q~αi[f(dni)+f(dnq+i)]\displaystyle=-f\left(d_{n-q}\right)+\sum_{i=1}^{\widetilde{q}}\alpha_{i}\left% [f\left(d_{n-i}\right)+f\left(d_{n-q+i}\right)\right]
=Γnq+i=1q~αi(Γni+Γnq+i)=Γ~n.\displaystyle=-\Gamma_{n-q}+\sum_{i=1}^{\widetilde{q}}\alpha_{i}\left(\Gamma_{% n-i}+\Gamma_{n-q+i}\right)=\widetilde{\Gamma}_{n}.(6)

After computing the coefficients αi\alpha_{i} by solving (4) and the tangent vector Γ~n\widetilde{\Gamma}_{n} by Eq. (3), we obtain the sought guess density matrix for the SCF iterative method as D~n=Exp(Γ~n)\widetilde{D}_{n}=\operatorname{Exp}(\widetilde{\Gamma}_{n}).

The number qq of density matrices taken at previous steps and the value of the regularization parameter ε\varepsilon are chosen in a heuristic manner: we computed the error ΓnΓ~n\|\Gamma_{n}-\widetilde{\Gamma}_{n}\| for different values of qq and ε\varepsilon, specifically q=3,4,,20q=3,4,\ldots,20 and ε=0.001,0.002,0.005,0.01,0.02,0.05\varepsilon=0.001,0.002,0.005,0.01,0.02,0.05, and we selected the combination (q,ε)(q,\varepsilon) corresponding to the minimal error. When the SCF convergence threshold is 10510^{-5}, we found that good values are q=5q=5 and ε=0.005\varepsilon=0.005, while if it is fixed to 10710^{-7}, we found q=4q=4 and ε=0.001,0.002\varepsilon=0.001,0.002. Additional details on the selection of qq and ε\varepsilon values can be found in Section S1 of the SI. The computational cost to compute the extrapolation coefficients 𝜶\bm{\alpha} is negligible compared to the time for a single MD step. Thanks to the symmetric property of the coefficients, the size of the system (5) is (Nd+q~)×q~(N_{d}+\tilde{q})\times\tilde{q}, and q~\tilde{q} is a small number (in our simulations q~=2\tilde{q}=2, as q=4q=4 or q=5q=5).

The QTR G-Ext approach is tested on four different systems. The first system is dimethylaminobenzonitrile (DMABN) in methanol. The second system is 3-hydroxyflavone (3HF) in acetonitrile. The last two systems (OCP and AppA) are chromophores embedded in a biological matrix-namely, a carotenoid in the orange carotenoid protein (OCP) and a flavin in the AppA Blue-Light Using Flavin photoreceptor [5, 4, 10]. Some information on the systems is reported in Table 1.

Table 1: Summary of systems’ size: number of QM atoms NQMN_{\text{QM}}, number of MM atoms NMMN_{\text{MM}}, number of QM basis functions 𝒩\mathcal{N}, number of occupied orbitals NN, and size of descriptors NdN_{d}.
SystemNQMN_{\text{QM}}NMMN_{\text{MM}}𝒩\mathcal{N}NNNdN_{d}
DMABN21684318539234
3HF281504629062409
AppA311644930967468
OCP9460587341544468

KS-DFT has been adopted to describe the QM subsystem, with the B3LYP hybrid functional [3] and the 6-31G(d) Pople’s basis set [11]. This is coupled with a polarizable description of the environment, using the AMOEBA forcefield [30]. For each system, we performed a QM/AMOEBA geometry optimization until a root-mean-square norm on the forces of 4 kcal/mol/Å is found and finally a 2 ps QM/AMOEBA NVT equilibration to obtain the starting point of the simulations presented in this work.

All simulations have been performed using the Gaussian-Tinker interface [27, 16, 17, 9]. We implemented the QTR G-Ext extrapolation approach in Tinker [32, 15].

To assess the quality of the guess density obtained by the QTR G-Ext extrapolation, we performed 10 ps BOMD simulations, with 0.5 fs time step, in the NVE ensemble, using the velocity Verlet integrator [38]. All systems were tested with an SCF convergence threshold fixed to 10510^{-5} and 10710^{-7} with respect to the RMS variation of density. We compare our approach in terms of energy stability and number of iterations required to reach convergence with other two extrapolation schemes, which are the G-Ext scheme [29]

Γ~n=i=1qαiΓni,q=6,\widetilde{\Gamma}_{n}=\sum_{i=1}^{q}\alpha_{i}\Gamma_{n-i},\qquad q=6,

where the αi\alpha_{i} are computed by solving

min𝜶q{dni=1qαidni2+ε2𝜶2},\min_{\bm{\alpha}\in\mathbb{R}^{q}}\left\{\left\|d_{n}-\sum_{i=1}^{q}\alpha_{i% }d_{n-i}\right\|^{2}+\varepsilon^{2}\left\|\bm{\alpha}\right\|^{2}\right\},

where ε=0.01\varepsilon=0.01, and XLBO[23, 21]

D~n\displaystyle\widetilde{D}_{n}=2D~n1D~n2+κ(Dn1D~n1)\displaystyle=2\widetilde{D}_{n-1}-\widetilde{D}_{n-2}+\kappa\left(D_{n-1}-% \widetilde{D}_{n-1}\right)
+ci=18αiD~ni,\displaystyle\phantom{=}+c\sum_{i=1}^{8}\alpha_{i}\widetilde{D}_{n-i},

with fixed parameters κ=1.86\kappa=1.86, c=0.0016c=0.0016, and 𝜶=(36,99,88,11,32,25,8,1)\bm{\alpha}=(-36,99,-88,11,32,-25,8,-1).

Refer to caption
Figure 1: Total energy as a function of simulation time for DMABN, using a 10510^{-5} convergence threshold for the SCF.
Refer to caption
Figure 2: Total energy as a function of simulation time for DMABN, using a convergence threshold for the SCF of 10710^{-7}.

Figure 1 provides the plot of the total energy along the DMABN simulation, with a 10510^{-5} SCF convergence threshold. Despite the non-fully time-reversible formulation of our newly implemented approach, we observe a great improvement with respect to the G-Ext scheme. In particular, the QTR G-Ext method resembles the fully time-reversible scheme XLBO. The same behaviour is almost imperceptible when the SCF convergence is set to 10710^{-7} (Figure 2), since the accumulation of errors that generates the energy drift when G-Ext is used is lower, so we can appreciate the same trend with all the extrapolation schemes. Analogous figures are reported in Section S2 of the SI for all tested systems. To better evaluate the energy stability, we consider the average short-time fluctuation (STF) of the energy, which is computed by getting the RMS of the energy fluctuation every 50 fs and averaging over the trajectory, and the long-time drift (LTD) for a long-time analysis, that is the slope of the linear regression line of the energy. Tables 2 and 3 disclose STF and LTD for convergence thresholds 10510^{-5} and 10710^{-7}, respectively. QTR G-Ext, G-Ext, and XLBO show comparable STF, which is specific for the system and is related to the time step for the integration. On the other hand, the absolute value of LTD is in general higher for 10510^{-5} simulations, in particular for G-Ext. We can state that the QTR G-Ext method solves the energy-drift issue of G-Ext, showing an LTD that is always similar to the XLBO one, suggesting again a good time-reversible behaviour.

Table 2: Short- and Long-Time Stability Analysis of the QTR G-Ext, G-Ext, and XLBO methods. SCF convergence threshold 10510^{-5}.
DMABN3HFAppAOCP
STFLTDSTFLTDSTFLTDSTFLTD
QTR G-Ext0.33-0.010.62-0.400.57-0.080.36-0.23
G-Ext0.35-0.430.61-0.940.56-0.930.38-1.38
XLBO0.320.010.57-0.420.590.140.39-0.28
Table 3: Short- and Long-Time Stability Analysis of the QTR G-Ext, G-Ext, and XLBO methods. SCF convergence threshold 10710^{-7}.
DMABN3HFAppAOCP
STFLTDSTFLTDSTFLTDSTFLTD
QTR G-Ext0.370.010.59-0.300.530.180.38-0.16
G-Ext0.330.040.60-0.270.540.060.38-0.20
XLBO0.320.130.64-0.370.560.060.38-0.08

The gain of our new methodology is not only in terms of accuracy (energy stability), but also in terms of the computational time of the simulation. Tables 4 and 5 report the average number of SCF iterations required to achieve convergence, as well as the standard deviation for 10510^{-5} and 10710^{-7} SCF thresholds, respectively. We remark that each strategy requires qq previous density matrices, before having them available a standard SCF is performed. Therefore, for the computation of average and standard deviation, we discard the first qq points. The two tables show that for all the tested systems, the QTR G-Ext method requires the lowest number of SCF iterations, for both convergence thresholds. Moving averages of SCF iteration numbers during the simulations for all systems and with both SCF convergence thresholds are reported in Section S2 of the SI.

Table 4: Performance of the QTR G-Ext method compared with the G-Ext method and XLBO algorithm. Average k¯\overline{k} and standard deviation σ\sigma of SCF iterations. Convergence threshold 10510^{-5}.
DMABN3HFAppAOCP
k¯\overline{k}σ\sigmak¯\overline{k}σ\sigmak¯\overline{k}σ\sigmak¯\overline{k}σ\sigma
QTR G-Ext3.040.222.980.213.000.022.960.31
G-Ext3.550.853.160.693.030.542.910.41
XLBO4.000.054.000.004.000.074.000.01
Table 5: Performance of the QTR G-Ext method compared with the G-Ext method and XLBO algorithm. Average k¯\overline{k} and standard deviation σ\sigma of SCF iterations. Convergence threshold 10710^{-7}.
DMABN3HFAppAOCP
k¯\overline{k}σ\sigmak¯\overline{k}σ\sigmak¯\overline{k}σ\sigmak¯\overline{k}σ\sigma
QTR G-Ext5.420.695.420.805.370.844.860.83
G-Ext7.330.636.960.796.560.755.830.87
XLBO7.510.657.450.657.430.807.210.75

The performances of the QTR G-Ext guess are maintained also for larger and smaller time steps. We compared QTR G-Ext and XLBO for time steps of 0.1, 0.25, 0.75, and 1 fs by running MD simulations for the DMABN system with an SCF converge threshold of 10510^{-5}. All the results can be found in Section S3 of the SI. Both methods show excellent energy conservation for the smaller time steps, and afford reasonably stable simulations even for the larger ones, which is remarkable, as such simulations employ a time step that is too large to accurately sample molecular vibrations involving protons and are in general very noisy. For all time steps, QTR G-Ext requires a smaller average number of SCF iterations than XLBO. Finally, we tested the method for a looser SCF convergence of 10410^{-4}, again, a value that should not be used for production applications, as the error on the SCF solution transfers to the forces, affecting thus the quality of the dynamics. The results are reported in Section S4 of the SI. Again, good energy conservation is shown for both methods, and QTR G-Ext outperforms XLBO in terms of average number of SCF iterations required.

In conclusion, we presented the Quasi Time-Reversible Grassmann Extrapolation scheme, a new extrapolation method for ab-initio molecular dynamics that not only allows for energy-conserving simulations, but exhibits overall excellent performances. Our numerical tests, performed on large, complex systems described with a polarizable multiscale strategy and taken from real-life production applications, show that QTR G-Etx is able to provide a guess density to BOMD simulations that allows the convergence of the SCF procedure in about 3 iterations on average for convergence thresholds that are typical of ground-state production runs, which is a 25% gain with respect to the state-of-the-art XLBO method. Tighter convergences, that are required for, e.g., time-dependent DFT excited state simulations, can also be achieved in as little as 5-6 iterations. Furthermore, our numerical tests show that the new method does not introduce any significant bias in the guess density and thus exhibits very good energy conservation properties. This can be clearly seen by comparing the long-term drift observed in simulations for the two different SCF convergence thresholds used in our tests: while the previous G-Ext method shows a sharp increase in the drift going from 10710^{-7} to 10510^{-5} SCF convergence threshold, this is not the case for the QTR G-Ext method. We stress here that, due to the cost of BOMD simulations, every gain in performances is important, as it can easily translate in hundreds or thousands of saved CPU hours. The QTR G-Ext method is easy to implement and does not introduce any significant computational overhead, and represents therefore an effective strategy to extend the applicability of BOMD simulations to larger and more complex systems.

Acknowledgements

This work was supported by the Italian Ministry of University and Research under grant 2020HTSXMA_002 (PSI-MOVIE) and by the French ‘Investissements d’Avenir’ program, project Agence Nationale de la Recherche (ISITE-BFC) (contract ANR-15-IDEX-0003). ÉP also acknowledges support from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program (grant agreement No 810367–project EMC2) as well as from the Simons Targeted Grant Award No. 896630. Funded by Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany’s Excellence Strategy – EXC 2075 – 390740016 (BS). FP is member of the GNCS group of INdAM.

Supporting Information Available

Determination of the optimal parameters, plots of the total energy and number of SCF iterations along the dynamics for all tested systems, and results for the fully time-reversible algorithm.

References

S1 Determination of optimal qq and ε\varepsilon values

The parameters qq and ε\varepsilon of the QTR G-Ext method were found by computing the error ΓnΓ~n\|\Gamma_{n}-\widetilde{\Gamma}_{n}\| and averaging it over the whole simulation for different values of qq and ε\varepsilon, specifically q=3,4,,20q=3,4,\ldots,20 and ε\varepsilon = 0.001, 0.002, 0.005, 0.01, 0.02, 0.05, and we selected the combination (q,ε)(q,\varepsilon) corresponding to the minimal error.

Table S1: Optimal qq ed ε\varepsilon for each system and SCF tolerance.
DMABN3HFAppAOCP
SCF tolerance10510^{-5}10710^{-7}10510^{-5}10710^{-7}10510^{-5}10710^{-7}10510^{-5}10710^{-7}
qq54545454
ε\varepsilon0.0050.0010.0050.0010.0050.0020.0050.002
Refer to captionRefer to caption
Refer to captionRefer to caption
Figure S1: Error for DMABN (top) and for 3HF (bottom), with SCF convergence threshold of 10510^{-5} (left panel) and 10710^{-7} (right panel).
Refer to captionRefer to caption
Refer to captionRefer to caption
Figure S2: Error for AppA (top) and for OCP (bottom), with SCF convergence threshold of 10510^{-5} (left panel) and 10710^{-7} (right panel).

S2 Supplementary figures: Energy stability and number of SCF iterations

In the following, we report the total energy profile and number of SCF iterations per step for all the simulations performed in this work using the XLBO, G-Ext, QTR G-Ext, and TR schemes. The time-reversible scheme is obtained by computing the guess density as follows:

Γ~n=Γ~nq+i=1q~αi(Γni+Γnq+i),\widetilde{\Gamma}_{n}=-\widetilde{\Gamma}_{n-q}+\sum_{i=1}^{\widetilde{q}}% \alpha_{i}\left(\Gamma_{n-i}+\Gamma_{n-q+i}\right),(S1)

Eq. S1 is manifestly symmetric, and thus fully time-reversible. As mentioned in the main text, the fully TR scheme exhibits excellent stability, but poor performance, as the number of SCF iterations tends to quickly increase along the simulation, to the point that the extrapolation is not anymore beneficial.

S2.1 DMABN

Refer to captionRefer to caption
Refer to captionRefer to caption
Figure S3: Comparison of total energies (left) and SCF iterations (right) along the simulation on DMABN with four extrapolation approaches: Quasi Time-Reversible (QTR G-Ext, blue line), Fully Time-Reversible (TR, green line), Grassmann Extrapolation (G-Ext, red line), and Extended Langrangian (XLBO, yellow line). For energy plots, soft colors are used to plot the actual energy values, whereas the marked line is the moving-average of the energy every 100 steps. The SCF iteration plots represent the moving-average of the number of iterations every 100 steps. SCF convergence threshold: 10510^{-5} (top panel), 10710^{-7} (bottom panel).

S2.2 3HF

Refer to captionRefer to caption
Refer to captionRefer to caption
Figure S4: Comparison of total energies (left) and SCF iterations (right) along the simulation on 3HF with four extrapolation approaches: Quasi Time-Reversible (QTR G-Ext, blue line), Fully Time-Reversible (TR, green line), Grassmann Extrapolation (G-Ext, red line), and Extended Langrangian (XLBO, yellow line). For energy plots, soft colors are used to plot the actual energy values, whereas the marked line is the moving-average of the energy every 100 steps. The SCF iteration plots represent the moving-average of the number of iterations every 100 steps. SCF convergence threshold: 10510^{-5} (top panel), 10710^{-7} (bottom panel).

S2.3 AppA

Refer to captionRefer to caption
Refer to captionRefer to caption
Figure S5: Comparison of total energies (left) and SCF iterations (right) along the simulation on AppA with four extrapolation approaches: Quasi Time-Reversible (QTR G-Ext, blue line), Fully Time-Reversible (TR, green line), Grassmann Extrapolation (G-Ext, red line), and Extended Langrangian (XLBO, yellow line). For energy plots, soft colors are used to plot the actual energy values, whereas the marked line is the moving-average of the energy every 100 steps. The SCF iteration plots represent the moving-average of the number of iterations every 100 steps. SCF convergence threshold: 10510^{-5} (top panel), 10710^{-7} (bottom panel).

S2.4 OCP

Refer to captionRefer to caption
Refer to captionRefer to caption
Figure S6: Comparison of total energies (left) and SCF iterations (right) along the simulation on OCP with four extrapolation approaches: Quasi Time-Reversible (QTR G-Ext, blue line), Fully Time-Reversible (TR, green line), Grassmann Extrapolation (G-Ext, red line), and Extended Langrangian (XLBO, yellow line). For energy plots, soft colors are used to plot the actual energy values, whereas the marked line is the moving-average of the energy every 100 steps. The SCF iteration plots represent the moving-average of the number of iterations every 100 steps. SCF convergence threshold: 10510^{-5} (top panel), 10710^{-7} (bottom panel).

S3 Supplementary tests: time step dependence

In the following, we report the results obtained for 20000 MD step on the system DMABN for QTR G-Ext and XLBO approaches using different time steps: 0.1, 0.25, 0.75, 1 fs. For completeness, the tables also show the results for time step equal to 0.5 fs. In these simulations, the SCF convergence threshold is 10510^{-5}. For QTR G-Ext method, we estimate the optimal value of the parameters qq and ε\varepsilon, as explained in Section S1:

Table S2: Optimal qq ed ε\varepsilon for each time step.
time step (fs)0.10.250.250.7511
qq455744
ε\varepsilon0.010.0020.0020.0010.010.01
Refer to captionRefer to caption
Refer to captionRefer to caption
Figure S7: Comparison of total energies along the simulation on DMABN with two extrapolation approaches: Quasi Time-Reversible (QTR G-Ext, blue line) and Extended Langrangian (XLBO, yellow line). MD with different time steps: 0.1 fs (top-left), 0.25 fs (top-right), 0.75 fs (bottom-left), 1 fs (bottom-right). For energy plots, soft colors are used to plot the actual energy values, whereas the marked line is the moving-average of the energy every 100 steps. SCF convergence threshold: 10510^{-5}.
Table S3: DMABN: Short- and Long-Time Stability Analysis of the QTR G-Ext and XLBO methods for molecular dynamics with different time steps. SCF convergence threshold 10510^{-5}.
time step0.10.250.50.751
STFLTDSTFLTDSTFLTDSTFLTDSTFLTD
QTR G-Ext0.02-0.040.09-0.010.33-0.010.82-0.041.39-0.14
XLBO0.02-0.140.080.000.320.010.740.101.340.01
Refer to captionRefer to caption
Refer to captionRefer to caption
Figure S8: Comparison of SCF iterations along the simulation on DMABN with two extrapolation approaches: Quasi Time-Reversible (QTR G-Ext, blue line) and Extended Langrangian (XLBO, yellow line). MD with different time steps: 0.1 fs (top-left), 0.25 fs (top-right), 0.75 fs (bottom-left), 1 fs (bottom-right). The SCF iteration plots represent the moving-average of the number of iterations every 100 steps. SCF convergence threshold: 10510^{-5}.
Table S4: DMABN: Performance of the QTR G-Ext method compared with the XLBO algorithm for molecular dynamics with different time steps. Average k¯\overline{k} and standard deviation σ\sigma of SCF iterations. SCF convergence threshold 10510^{-5}.
time step0.10.250.50.751
k¯\overline{k}σ\sigmak¯\overline{k}σ\sigmak¯\overline{k}σ\sigmak¯\overline{k}σ\sigmak¯\overline{k}σ\sigma
QTR G-Ext2.950.652.660.813.040.223.680.614.020.20
XLBO3.570.913.940.254.000.054.030.184.730.44

S4 Supplementary tests: lower SCF convergence threshold

In this section, we report the results obtained on the system DMABN for QTR G-Ext and XLBO approaches by establishing the convergence threshold to 10410^{-4}. For QTR G-Ext method, the parameters are q=5q=5 and ε=0.005\varepsilon=0.005. For completeness, the tables also show the results for convergence threshold equal to 10510^{-5} and 10710^{-7}. We performed 10 ps BOMD simulations, with 0.5 fs time step.

Refer to caption
Refer to caption
Figure S9: Comparison of total energies (left) and SCF iterations (right) along the simulation on DMABN with two extrapolation approaches: Quasi Time-Reversible (QTR G-Ext, blue line) and Extended Langrangian (XLBO, yellow line). For energy plots, soft colors are used to plot the actual energy values, whereas the marked line is the moving-average of the energy every 100 steps. The SCF iteration plots represent the moving-average of the number of iterations every 100 steps. SCF convergence threshold: 10410^{-4}.
Table S5: DMABN: Short- and Long-Time Stability Analysis of the QTR G-Ext and XLBO methods for molecular dynamics with different SCF convergence thresholds.
conv. threshold10410^{-4}10510^{-5}10710^{-7}
STFLTDSTFLTDSTFLTD
QTR G-Ext0.37-0.270.33-0.010.370.01
XLBO0.45-0.000.320.010.320.13
Table S6: DMABN: Performance of the QTR G-Ext method compared with the XLBO algorithm for molecular dynamics with different SCF convergence thresholds. Average k¯\overline{k} and standard deviation σ\sigma of SCF iterations.
conv. threshold10410^{-4}10510^{-5}10710^{-7}
k¯\overline{k}σ\sigmak¯\overline{k}σ\sigmak¯\overline{k}σ\sigma
QTR G-Ext2.680.973.040.225.420.69
XLBO3.860.754.000.057.510.65