Compact Orbitals Enable Low-Cost Linear-Scaling Ab Initio Molecular Dynamics for Weakly-Interacting Systems Hayden Scheiber,1, A) Yifei Shi,1 and Rustam Z
Total Page:16
File Type:pdf, Size:1020Kb
Compact orbitals enable low-cost linear-scaling ab initio molecular dynamics for weakly-interacting systems Hayden Scheiber,1, a) Yifei Shi,1 and Rustam Z. Khaliullin1, b) Department of Chemistry, McGill University, 801 Sherbrooke St. West, Montreal, QC H3A 0B8, Canada Today, ab initio molecular dynamics (AIMD) relies on the locality of one-electron density matrices to achieve linear growth of computation time with systems size, crucial in large-scale simulations. While Kohn-Sham orbitals strictly localized within predefined radii can offer substantial computational advantages over density matrices, such compact orbitals are not used in AIMD because a compact representation of the electronic ground state is difficult to find. Here, a robust method for maintaining compact orbitals close to the ground state is coupled with a modified Langevin integrator to produce stable nuclear dynamics for molecular and ionic systems. This eliminates a density matrix optimization and enables first orbital-only linear-scaling AIMD. An application to liquid water demonstrates that low computational overhead of the new method makes it ideal for routine medium-scale simulations while its linear-scaling complexity allows to extend first- principle studies of molecular systems to completely new physical phenomena on previously inaccessible length scales. Since the unification of molecular dynamics and den- LS methods restrict their use in dynamical simulations sity functional theory (DFT)1, ab initio molecular dy- to very short time scales, systems of low dimensions, namics (AIMD) has become an important tool to study and low-quality minimal basis sets6,18–20. On typical processes in molecules and materials. Unfortunately, the length and time scales required in practical and accurate computational cost of the conventional Kohn-Sham (KS) AIMD simulations, LS DFT still cannot compete with DFT grows cubically with the number of atoms, which the straightforward low-cost cubically-scaling KS DFT. severely limits the length scales accessible by AIMD. To In this work, we present an AIMD method that over- address this issue, substantial efforts have been directed comes difficulties of DFT based on compact orbitals to to the development of linear-scaling (LS) DFT. achieve LS with extremely low computational overhead. In all LS DFT methods, the delocalized eigenstates To demonstrate advantages of the new method we ap- of the effective KS Hamiltonian must be replaced with plied it here to systems of weakly-interacting molecules. an alternative set of local electronic descriptors. Most However, the same approach is readily applicable to LS methods2–5 explore the natural locality of the one- systems of strongly-interacting fragments that do not electron density matrix (DM). However, the DM DFT be- form strong covalent bonds such as ionic materials— comes advantageous only for impractically large systems salts, liquids, and semiconductors. A generalization of when accurate multifunction basis sets are used3,6–8. the method to all finite-gap systems, including covalently This issue is rectified in optimal-basis DM methods9–11 bonded atoms, will be reported later. that contract large basis sets into a small number of new localized functions and then optimize the DM in The new AIMD method utilizes a recently developed the contracted basis. Despite becoming the most popu- LS DFT8 based on absolutely localized molecular orbitals lar approach to LS DFT, the efficiency of these methods (ALMOs) – compact orbitals first described in Ref. 21. is hampered by the costly optimization of both the con- Unlike delocalized KS orbitals, each ALMO has its own tracted orbitals and the DM12. From this point of view, a localization center and a predefined localization radius 8,21 direct variation of compact molecular orbitals—orbitals Rc that typically includes nearby atoms or molecules . that are strictly localized within predefined regions—is In the current implementation, a localization center is preferable because LS can be achieved with significantly defined as a set of all Gaussian atomic orbitals of one fewer variables. Advantages of the orbitals-only LS DFT molecule. However, the approach can use other local and are especially pronounced in accurate calculations that nonlocal basis sets22,23. The key feature of ALMO DFT require many basis functions per atom. Unfortunately, is that its one-electron wavefunctions are constructed in the development of promising orbital-based LS methods a two-stage self-consistent-field (SCF) procedure8 to cir- has been all but abandoned13,14 because of the inherently cumvent the problem of the sluggish variational optimiza- difficult optimization of localized orbitals2,13–17. tion emphasized above. In the first stage, ALMOs are Thus, despite impressive progress of the LS descrip- constrained to their localization centers24 whereas, in the tion of the electronic and atomic structure of large static second stage, ALMOs are relaxed to allow delocalization systems6,18, the high computational overhead of existing onto the neighbor molecules within their localization ra- dius Rc. To achieve a robust optimization in the prob- lematic second stage, it is important to keep the delocal- ization component of the trial wavefunction orthogonal a)Electronic mail: [email protected] to the fixed orbitals obtained in the first stage. For math- b)Electronic mail: [email protected] ematical details, see the ALMO SCF method in Ref. 8. 2 ALMO constraints imposed by Rc prohibit electron zero systematically by increasing Rc and decreasing ǫSCF. density transfer between distant molecules, but retain Our approach to compensate for the missing δfiα(t) all other types of interaction such as long-range elec- term is inspired by the methodology introduced into trostatic, exchange, polarization, and—if the exchange- AIMD by Krajewski et al.27, formalized by K¨uhne et correlation (XC) functional includes them—dispersion al.28 and rationalized by Dai et al.29 before becoming in- interactions25. Since the importance of electron transfer formally known as the second generation Car-Parrinello decays exponentially with distance in finite-gap materi- molecular dynamics30. Adopting the principle of Refs. 27 als2, the ALMO approximation is expected to provide and 28, ALMO AIMD is chosen to be governed by the a natural and accurate representation of the electronic Langevin equation of motion that can be written in terms structure of molecular systems. Because of the greatly of the unknown reference forces reduced number of electronic descriptors and the robust KS γ optimization, the computational complexity of ALMO mir¨iα = fiα (t) − γmir˙iα + Riα(t), (2) DFT grows linearly with the number of molecules while where mi is the mass of atom i, riα is its position along its computational overhead remains very low. These fea- γ dimension α, γ is the Langevin scaling factor, and Riα(t) tures make ALMO DFT a promising method for accurate is the stochastic force represented by a zero-mean white AIMD simulations of large molecular systems. Gaussian noise The challenge of adopting ALMO DFT for dynamical γ simulations arises from the slightly nonvariational char- hRiα(t)i =0, (3) acter of the localized orbitals. While ALMOs are varia- γ γ ′ ′ hR (t)R (t )i =2kBTγmiδij δαβδ(t − t ). (4) tionally optimized in both SCF stages, the occupied sub- iα jβ space defined in the first stage must remain fixed dur- The last relation means that, for any value of γ, the ing the second stage to ensure convergence. In addition, damping and stochastic terms are in perfect balance and electron transfer effects can suddenly become inactive in trajectories generated with Eq. (2) will sample the canon- the course of a dynamical simulation when a neighboring ical ensemble at a specified temperature T 31. In the limit molecule crosses the localization threshold Rc. Futher- γ → 0, the Newton equation is recovered and the micro- more, the variational optimization in any AIMD method canonical ensemble is sampled. is never complete in practice and interrupted once the The main assumption of ALMO AIMD is that the error maximum norm of the gradient of the energy with respect in the ALMO forces is well approximated by Gaussian ∆ to the electronic descriptors drops below small but nev- noise Riα(t): ertheless finite convergence threshold ǫSCF. These errors ∆ do not affect the accuracy of static ALMO DFT calcula- δfiα(t)= Riα(t) (5) tions, geometry optimization, and Monte-Carlo simula- tions. Unfortunately they tend to accumulate in molec- that obeys ular dynamics trajectories leading to non-physical sam- ∆ hRiα(t)i =0, (6) pling and eventual failure. Traditional strategies to cope ∆ ∆ ′ ′ with these problems are computationally expensive and hRiα(t)Rjβ (t )i =2kBT ∆miδij δαβδ(t − t ). (7) include computing the nonvariational contribution to the 4,26 This assumption, shown to be well justified, allows us to forces via a variational coupled-perturbed procedure , rewrite the Langevin equation using the ALMO forces increasing Rc, and decreasing ǫSCF. In this work, we propose another approach that ob- ALMO γ+∆ mir¨iα = fiα (t) − γmir˙iα + Riα (t), (8) viates the need in a coupled-perturbed solver, relaxes tight constraints on Rc and ǫSCF, and thus enables us where the two stochastic terms are combined into one γ+∆ γ ∆ to maintain stable dynamics and to keep the algorithmic Riα = Riα + Riα. The only missing piece in the complexity and cost of simulations low. In our approach, modified Langevin equation is the value of ∆, which de- the forces on atoms are calculated approximately after scribes the strength of the newly introduced stochastic the two-stage ALMO SCF using a straightforward pro- term. This term compensates for imperfections in ALMO cedure that computes only the Hellmann-Feynman and forces and must be adjusted to re-balance the damping Pulay components and neglects the computationally in- and stochastic components in ALMO AIMD. tense nonvariational component of the forces. The differ- In principle, ∆ can be calculated using the integral of ence between these approximate ALMO forces and the Eq.