원시데이터 수집 시스템
선정목록으로

Mass-zero constrained dynamics for simulations based on orbital-free density functional theory

관련 수소연료전지 · (5) 연료전지용 수분제어장치(가습기)

기본 정보

저자
  1. Alessandro Coretti — Centre Européen de Calcul Atomique et Moléculaire (CECAM), Ecole Polytechnique Fédérale de Lausanne 3 , 1015 Lausanne, Switzerland|||Department of Mathematical Sciences, Politecnico di Torino 2 , I-10129 Torino, Italy|||Faculty of Physics, University of Vienna 1 , Kolingasse 14-16, 1090 Vienna, Austria|||Polito - Politecnico di Torino = Polytechnic of Turin (Politecnico di Torino - Corso Duca degli Abruzzi, 24 10129 Torino - Italy)
  2. Taylor J. Baird — Centre Européen de Calcul Atomique et Moléculaire (CECAM), Ecole Polytechnique Fédérale de Lausanne 3 , 1015 Lausanne, Switzerland
  3. Rodolphe Vuilleumier — PASTEUR, Département de chimie, École normale supérieure, PSL University, Sorbonne Université, CNRS 4 , 75005 Paris, France
  4. Sara Bonella — Centre Européen de Calcul Atomique et Moléculaire (CECAM), Ecole Polytechnique Fédérale de Lausanne 3 , 1015 Lausanne, Switzerland
DOI
10.1063/5.0130117
저널
The Journal of Chemical Physics
발행년도
2022
발행기관
American Institute of Physics
피인용수
3
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1063/5.0130117
토픽
Solid-state spectroscopy and crystallography
OpenAlex ID
W4309187331

평가 내용

관련도
관련
사업분야
수소연료전지 · (5) 연료전지용 수분제어장치(가습기)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '수소연료전지 > 연료전지용 수분제어장치(가습기)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

A new algorithm for efficient and fully time-reversible integration of first-principles molecular dynamics based on orbital-free density functional theory (OFDFT) is presented. The algorithm adapts to this nontrivial case, the recently introduced Mass-Zero (MaZe) constrained dynamics. The formalism ensures that full adiabatic separation is enforced between nuclear and electronic degrees of freedom and, consequently, that the exact Born-Oppenheimer probability for the nuclei is sampled. Numerical integration of the MaZe dynamics combines standard molecular dynamics algorithms, e.g., Verlet or velocity Verlet, with the SHAKE method to impose the minimum conditions on the electronic degrees of freedom as a set of constraints. The developments presented in this work, which include a bespoke adaptation of the standard SHAKE algorithm, ensure that the quasilinear scaling of OFDFT is preserved by the new method for a broad range of kinetic and exchange-correlation functionals, including nonlocal ones. The efficiency and accuracy of the approach are demonstrated via calculations of static and dynamic properties of liquid sodium in the constant energy and constant temperature ensembles.

본문 129,090자

본문 펼치기
## Mass-Zero constrained dynamics for simulations based on orbital-free density functional theory A. Coretti, <sup>1, 2, 3</sup> T. Baird, <sup>3</sup> R. Vuilleumier, <sup>4</sup> and S. Bonella <sup>3, a)</sup> 1) _Faculty_ _of_ _Physics,_ _University_ _of_ _Vienna,_ _Kolingasse_ _14-16,_ _1090_ _Vienna,_ _Austria_ 2) _Department_ _of_ _Mathematical_ _Sciences,_ _Politecnico_ _di_ _Torino,_ _I-10129_ _Torino,_ _Italy_ 3) _Centre_ _Europ´een_ _de_ _Calcul_ _Atomique_ _et_ _Mol´eculaire_ _(CECAM),_ _Ecole_ _Polytechnique_ _F´ed´erale_ _de_ _Lausanne,_ _1015_ _Lausanne,_ _Switzerland_ 4) _PASTEUR,_ _D´epartement_ _de_ _chimie,_ _´Ecole_ _normale_ _sup´erieure,_ _PSL_ _University,_ _Sorbonne_ _Universit´e._ _CNRS,_ _75005_ _Paris,_ _France_ (Dated: 11 October 2022) A new algorithm for efficient and fully time-reversible integration of _first-principles_ molecular dynamics based on orbital-free density functional theory (OFDFT) is presented. The algorithm adapts to this nontrivial case the recently introduced Mass-Zero (MaZe) constrained dynamics. The formalism ensures that full adiabatic separation is enforced between nuclear and electronic degrees of freedom and, consequently, that the exact Born-Oppenheimer probability for the nuclei is sampled. Numerical integration of the MaZe dynamics combines standard molecular dynamics algorithms, e.g. Verlet or velocity Verlet, with the SHAKE method to impose the minimum conditions on the electronic degrees of freedom as a set of constraints. The developments presented in this work, that include a bespoke adaptation of the standard SHAKE algorithm, ensure that the quasilinear scaling of OFDFT is preserved by the new method for a broad range of kinetic and exchange-correlation functionals, including nonlocal ones. The efficiency and accuracy of the approach is demonstrated via calculations of static and dynamic properties of liquid sodium in the constant energy and constant temperature ensembles. Keywords: First-principles Molecular Dynamics, Orbital-free Density Functional Theory, Constrained Molecular Dynamics I. INTRODUCTION In this paper, we detail the use of the Mass-Zero (MaZe) constrained dynamics for the interesting case of _first-principles_ molecular dynamics based on OrbitalFree Density Functional Theory (OFDFT). MaZe is a general method for simulating the evolution of a set of physical degrees of freedom (dofs) whose dynamics depends on parameters subject to given conditions. <sup>1,2</sup> In MaZe these parameters are treated as degrees of freedom of zero inertia in an extended dynamical system and the conditions are imposed as constraints. The method is formulated in the Lagrangian framework, enabling the key properties of the approach, namely full time reversibility and exact sampling of the probability density of the physical dofs, to emerge naturally from a fully consistent dynamical and statistical viewpoint. An important application domain for MaZe is adiabatic dynamics. In the following we shall focus, in particular, on the _first-principles_ adiabatic evolution of a set of coupled ionic (slow) and electronic (fast) dofs. The energy of this system is a function of the ionic positions and a functional of the electronic density. In OFDFT-based simulations, the density is represented in a basis, e.g. plane waves, and the expansion coefficients play the role of the electronic dofs. The well-separated timescales of the motion a)Electronic mail: [sara.bonella@epfl.ch](mailto:sara.bonella@epfl.ch) of the slow and fast dofs enable one to adopt the BornOppenheimer approximation for the dynamics. In this approximation, classical evolution equations govern the ionic motion, but the forces acting on these dofs depend parametrically on the values of the fast variables. These values, in turn, are determined by the condition that the energy is at a minimum with respect to the fast dofs for each ionic configuration along the trajectory. Typical numerical methods for _first-principles_ MD can be grouped into two main families. The first directly implements Born-Oppenheimer dynamics: standard classical MD for the ions is combined with minimization of the energy with respect to the electronic dofs, for example via nonlinear conjugate gradient <sup>3,4</sup> or via _ad_ _hoc_ evolutions as in the always stable predictor-corrector method. <sup>5,6</sup> The second implements Car-Parrinello MD: <sup>7</sup> the fast dofs are treated as dynamical variables (of finite mass) by defining an appropriate Lagrangian and the minimum is approximately tracked by the overall dynamics. <sup>8</sup> A hybrid method that introduces new dynamical variables, in addition to those directly associated with the electronic dofs, and uses them to provide good starting values for energy minimizers such as the conjugate-gradient method, was also proposed in the extended Lagrangian Born-Oppenheimer (XL-BOMD) framework. <sup>9–11</sup> These methods are routinely used and have produced remarkable results, but they suffer from problems that motivate further developments. In particular, full convergence of minimization based approaches can be too expensive for large-scale simulations of condensed-phase systems. <sup>12</sup> In complete convergence has serious consequences on the evolution, including instabilities, <sup>13</sup> violation of adiabaticity <sup>14,15</sup> and therefore energy drifts and breaking of time reversibility of the propagation. Violation of adiabaticity affects also Car-Parrinello MD <sup>3</sup> and forces either the use of thermostats (which, however, lead to questions on the statistical ensemble sampled) or of a very small mass associated to the auxiliary variables (which, however, imposes a very small timestep for the numerical propagation). Full time reversibility or ease of portability of the algorithm is problematic for the predictorcorrector and XL-BOMD methods, that have system dependent parameters or forces that must be tuned for each calculation. <sup>5,6</sup> Indeed, the violation of strict adiabaticity is intrinsic to extended-Lagrangian methods as long as the mass of the auxiliary variables is finite. <sup>8,16–18</sup> MaZe provides an alternative approach that eliminates or mitigates the problems mentioned above. It employs the framework of constrained dynamics <sup>19,20</sup> to ensure fully adiabatic propagation and, consequently, correct sampling of the target probability for the physical dofs. Using an adapted SHAKE algorithm, <sup>21</sup> it enables efficient satisfaction of the minimum condition with a level of precision close to the numerical limit. <sup>1,2,22</sup> The SHAKEbased integration algorithm is symplectic <sup>23</sup> and fully time reversible, leading to long-time stability of the simulation with a timestep determined by the typical frequencies of the motion of the slow dofs. Recent applications of MaZe that illustrate these properties cover the simulation of classical models for polarizable systems, <sup>1,22,24</sup> including the nontrivial case of classical polarizable systems in external magnetic field, <sup>25</sup> and proof-of-principle OFDFT calculations that employed simple energy functionals. <sup>2</sup> In the following, we considerably extend our previous exploratory work for MaZe in OFDFT simulations by tackling two important issues. Firstly, as discussed in detail in Sec. II, the MaZe OFDFT constrained variables are the _complex_ coefficients in a Fourier-series expansion of the electronic density. This implies that the Lagrange multipliers associated to our problem are also complex. The generalization of the SHAKE algorithm to this case is presented in this work. The second, critical problem that we address stems from the specific nature of the minimum constraint. As a rule, SHAKE has been applied to relatively simple constraints, involving only small subsets of degrees of freedom, e.g. fixing bond lengths in molecules where the functional form of the constraint is quadratic in the coordinates of the few atoms involved in each bond. This local structure is key for the rapid convergence of the iterative algorithm (almost) universally adopted for solving the constrained evolution of the system. <sup>21</sup> The minimum constraint appearing in MaZe, on the other hand, is typically a global and highly nonlinear function of many auxiliary degrees of freedom that, for general energy functionals, cannot be solved efficiently with the standard algorithm. In this work then, we introduce an alternative procedure, based on work of Weinbach and Elber, <sup>26</sup> to solve the constraint equations and prove its remarkable efficacy. This development is essential in view of MaZe deployment to large-scale simulations based on OFDFT with functionals of arbitrary complexity, including nonlocal kinetic and exchange-correlation functionals. <sup>27,28</sup> The paper is organized as follows. We start by discussing in detail the MaZe formalism for the specific case of OFDFT _first-principles_ MD at constant number of particles, volume and energy. We then show how the constrained dynamics is adapted to the case of complex Lagrange multipliers. In Sec. III, we discuss first the solution of the constraints via the standard algorithm (see Sec. III A) and highlight its high numerical cost for generic kinetic and exchange-correlation functionals. In Sec. III B the new, numerically efficient and general algorithm for the solution of the constraint equations is then introduced. The accuracy and efficiency enabled by these developments are illustrated in the Results section for constant energy and constant temperature systems. Here, we first validate the algorithm via benchmark calculations on liquid sodium and then compare the numerical performance (both in terms of number of operations per timestep and in clocking of the timestep) of the new and standard SHAKE algorithms. In particular, we demonstrate that, for commonly adopted energy functionals at the GGA level, the algorithm scales quasilinearly with system size. II. MAZE DYNAMICS FOR ORBITAL-FREE DFT OFDFT was proposed <sup>29</sup> as a computationally convenient alternative to DFT dynamics based on the use of Kohn-Sham orbitals. <sup>18</sup> The main advantage of OFDFT is that, in contrast to Kohn-Sham-based DFT, it enables a representation of the total energy that does not require auxiliary orthonormal orbitals. This entails that the overall cost of the calculation per timestep is quasilinear in the system’s volume Ω, ( _O_ (Ωlog Ω)) and memory requirements conveniently scale linearly as _O_ (Ω). Unfortunately, developing reliable and transferable kineticenergy functionals for general systems (and for different phases of matter) is an open challenge <sup>30</sup> that prevents universal use of the method. In spite of this well-known issue, OFDFT remains a useful approach, often enabling the simulation of system sizes out of reach of alternative methods. <sup>30,31</sup> The method is also implemented in different high performance codes for the simulation of materials, such as GPAW <sup>32,33</sup> or PROFESS. <sup>34</sup> Very recently, the use of machine learning methods to obtain flexible and accurate kinetic-energy functionals <sup>35,36</sup> has also led to a renewed interest in OFDFT. In OFDFT, the ground state electronic energy is written as a function of the _N_ ionic positions, _R_ _≡_ _{_ _R_ 1 _, ...,_ _R_ _N_ _}_, and as a functional of the electronic density _n_ _E_ [ _R_ _, n_ ] _≡_ _E_ KE[ _n_ ] + _E_ Hart[ _n_ ] + _E_ xc[ _n_ ] (1) + _E_ ext[ _R_ _, n_ ] + _E_ Coul( _R_ ) _,_ where _E_ KE[ _n_ ] is the kinetic energy of a noninteracting electron gas at the density of the physical system, and _E_ Hart[ _n_ ] and _E_ xc[ _n_ ] are the Hartree and exchangecorrelation energies, respectively. _E_ Coul( _R_ ) is the classical Coulomb energy of the ions and _E_ ext[ _R_ _, n_ ] is the interaction energy between the electrons and the ions. In MD simulations, the density is typically represented in the plane-wave basis that contains the 2 _NG_ Fourier coefficients other than the one corresponding to _G_ 0 = (0 _,_ 0 _,_ 0). This latter coefficient is associated to the additional condition that the total number of electrons _N_ el, must be conserved along the dynamics. In the plane wave basis, this condition is expressed as _n_ ˜ _G_ 0Ω= _N_ el _,_ (6) where Ωis the volume of the simulation box. The MaZe evolution for OFDFT _first-principles_ dynamics is obtained by promoting the coefficients _n_ ˜ _G_ _α_ and _n_ ˜ <sup>_⋆_</sup> _G_ _α_ <sup>to</sup> <sup>the</sup> <sup>role</sup> <sup>of</sup> <sup>dynamical</sup> <sup>variables.</sup> <sup>The</sup> <sup>evo-</sup> lution equations, obtained from a Lagrangian formulation of the dynamics of the ions and these additional variables, are then complemented with the conditions in Eqs. (4) and (6), which are interpreted as constraints. In the following, we impose the conservation of the number of electrons by enforcing Eq. (6) and the minimum condition on _n_ ˜ _G_ 0 as an initial condition. We then exclude this quantity from the set of auxiliary dynamical variables and consider it as a constant in the simulations. To simplify the notation, we also drop the explicit indication of the dependence of the ground state energy and of the constraints on _n_ ˜ _G_ 0. To proceed, we assign (temporarily) a finite (scalar) inertia, _µ_, to the additional variables _n_ ˜, and define the following Lagrangian for the system <sup>1</sup> _n_ ( _r_ ) = _G_ _n_ ˜ _G_ _e_ <sup>_i_</sup> <sup>_G_</sup> <sup>_·_</sup> <sup>_r_</sup> _,_ (2) where _G_ = <sup><u>2</u></sup> _L_ <sup>_<u>π</u>_</sup> where _G_ = <sup><u>2</u></sup> _L_ <sup>_<u>π</u>_</sup> <sup>(</sup> <sup>_i, j, k_</sup> <sup>),</sup> <sup>with</sup> <sup>_L_</sup> <sup>the</sup> <sup>size</sup> <sup>of</sup> <sup>the</sup> <sup>cubic</sup> <sup>box</sup> and _i_, _j_, _k_ integers. This expansion is truncated with _n_ ˜ _G_ = 0 if any component of the wavevector is larger than a cutoff, _|G_ <sup>_l_</sup> _| > G_ c, _l_ = _x, y_ or _z_ . Since the density in real space _n_ ( _r_ ) is, by definition, a real function, the Fourier coefficients _n_ ˜ _G_ (typically complex quantities), satisfy the relationship _n_ ˜ _−_ _G_ = _n_ ˜ <sup>_⋆_</sup> _G_ <sup>.</sup> <sup>Once the Fourier representation</sup> relationship _n_ ˜ _−_ _G_ = _n_ ˜ <sup>_⋆_</sup> _G_ <sup>.</sup> <sup>Once the Fourier representation</sup> is adopted, the ground state energy becomes a function of the ionic positions and the expansion coefficients. _First-principles_ OFDFT molecular dynamics relies on the Born-Oppenheimer approximation: the forces on the ions are computed at each timestep as the gradient of the ground state energy with respect to the ionic positions, with the energy computed at an electronic density that minimizes its value. In the plane wave representation of the density, this minimum condition is equivalent to imposing that the derivatives of the ground state energy with respect to the coefficients of the Fourier expansion are null. In taking these derivatives, we have the choice to adopt as independent variables the real and imaginary parts of _n_ ˜ _G_ or to consider instead _n_ ˜ _G_ and _n_ ˜ <sup>_⋆_</sup> _G_ <sup>.</sup> <sup>Indeed,</sup> the definition of the complex derivatives (also known as Wirtinger derivatives) _σ_ = _{σ_ _G_ 1 _, . . ., σ_ _G_ _NG_ _, σ_ _G_ <sup>_⋆_</sup> _G_ <sup>_⋆_</sup> 1 <sup>_, . . ., σ_</sup> _G_ <sup>_⋆_</sup> _First-principles_ OFDFT molecular dynamics relies on the Born-Oppenheimer approximation: the forces on the ions are computed at each timestep as the gradient of the ground state energy with respect to the ionic positions, with the energy computed at an electronic density that minimizes its value. In the plane wave representation of the density, this minimum condition is equivalent to imposing that the derivatives of the ground state energy with respect to the coefficients of the Fourier expansion are null. In taking these derivatives, we have the choice to adopt as independent variables the real and imaginary parts of _n_ ˜ _G_ or to consider instead _n_ ˜ _G_ and _n_ ˜ <sup>_⋆_</sup> _G_ <sup>.</sup> <sup>Indeed,</sup> We then introduce the vector of the 2 _NG_ constraints _N_ _I_ _L_ = <sup><u>1</u></sup> 2 _L_ = <sup><u>1</u></sup> _MI_ _R_ <sup>˙</sup> _I_ <sup>2</sup> _I_ <sup>2</sup> <sup>+</sup> <sup>_<u>µ</u>_</sup> <sup>_<u>µ</u>_</sup> _n_ ˜ ˙ 2 _⋆_ _·_ _n_ ˜ ˙ _−_ _E_ ( _R_ _,_ ˜ _n_ ) _._ (7) _G_ <sup>_⋆_</sup> _NG_ <sup>_},_</sup> (8) _,_ _,_ _<u>∂E</u>_ _∂n_ ˜ <sup>_⋆_</sup> _G_ _<u>∂E</u>_ _∂n_ ˜ _G_ = <sup><u>1</u></sup> 2 and the 2 _NG_ Lagrange multipliers _λ_ = _{λ_ _G_ 1 _, . . . λ_ _G_ _NG, λ_ _G_ <sup>_⋆_</sup> _G_ <sup>_⋆_</sup> 1 <sup>_, . . ., λ⋆_</sup> _G_ <sup>_⋆_</sup> _G_ _NG_ <sup>_},_</sup> (9) = <sup><u>1</u></sup> 2 - _<u>∂E</u>_ _<u>∂E</u>_ _∂_ Re[˜ _n_ _G_ ] <sup>+ i</sup> _∂_ Im[˜ _n_ _G_ ] - _<u>∂E</u>_ _<u>∂E</u>_ _∂_ Re[˜ _n_ _G_ ] <sup>_−_</sup> <sup>i</sup> _∂_ Im[˜ _n_ _G_ ] (3) (where Re[˜ _n_ _G_ ] and Im[˜ _n_ _G_ ] are the real and imaginary parts of _n_ ˜ _G_ ) ensures the equivalence of these choices. In the following, we adopt _n_ ˜ _G_ and _n_ ˜ <sup>_⋆_</sup> _G_ <sup>as</sup> <sup>independent</sup> <sup>vari-</sup> ables. Furthermore, from now on all Fourier coefficients are taken in the interval _G_ _∈_ [ 0 _,_ _G_ max], a shorthand notation to indicate that wavevectors span one-half space (we denote _NG_ the number of such vectors). With these choices, the Born-Oppenheimer conditions become _σ_ _G_ _α_ ( _R_ _,_ ˜ _n_ _,_ ˜ _n_ _G_ 0) = <sup>_<u>∂E</u>_</sup> <sup><u>(</u></sup> <sup>_<u>R</u>_</sup> <sup>_<u>,</u>_</sup> <sup><u>˜</u></sup> <sup>_<u>n</u>_</sup> <sup>_<u>,</u>_</sup> <sup><u>˜</u></sup> <sup>_<u>n</u>_</sup> <sup>_<u>G</u>_</sup> <sup><u>0)</u></sup> in order to form the constrained Lagrangian _L_ = _L_ + _σ_ <sup>_⋆_</sup> _·_ _λ_ _._ (10) Note that, at variance with typical situations in molecular dynamics, the constraints and the Lagrange multipliers are, in general, _complex_ quantities, making it necessary to generalize standard algorithms for their treatment. The prescribed form for the Lagrangian respects two important properties. The constraint term, in fact, can be rewritten as _∂n_ ˜ <sup>_⋆_</sup> _·_ Im( _λ_ ) _,_ (11) - - _<u>∂E</u>_ _·_ Re ( _λ_ ) + Im _∂_ _n_ ˜ _G_ _α_ - _<u>∂E</u>_ _∂_ _n_ ˜ _G_ <sup>_⋆_</sup> _α_ <sup>(</sup> <sup>_R_</sup> <sup>_,_</sup> <sup>˜</sup> <sup>_n_</sup> <sup>_,_</sup> <sup>˜</sup> <sup>_n_</sup> <sup>_G_</sup> 0 <sup>) =</sup> <sup>_<u>∂E</u>_</sup> <sup><u>(</u></sup> <sup>_<u>R</u>_</sup> <sup>_<u>,</u>_</sup> <sup><u>˜</u></sup> <sup>_<u>n</u>_</sup> <sup>_<u>,</u>_</sup> <sup><u>˜</u></sup> <sup>_<u>n</u>_</sup> <sup>_<u>G</u>_</sup> <sup><u>0)</u></sup> = 0 for _α ∈_ [1 _, NG_ ]; = 0 for _α ∈_ [0 _, NG_ ] _._ _σ_ <sup>_⋆_</sup> _·_ _λ_ = Re _σ_ <sup>_⋆_</sup> _∂n_ ˜ _G_ _α_ (4) In the equation above, we have introduced, for future convenience, the vector 1 We define the scalar product of two complex vectors, _a_ _,_ _b_ _∈_ C _N_ _N_ _i_ =1 _a_ <sup>_⋆_</sup> _i_ <sup>_bi_</sup> <sup>.</sup> _a_ <sup>_⋆_</sup> _i_ _n_ ˜ = _{n_ ˜ _G_ 1 _, . . .,_ ˜ _n_ _G_ _NG,_ ˜ _n_ _G_ <sup>_⋆_</sup> _G_ <sup>_⋆_</sup> 1 <sup>_, . . .,_</sup> <sup>˜</sup> <sup>_n⋆_</sup> _G_ <sup>_⋆_</sup> _G_ _NG_ <sup>_},_</sup> (5) as _a_ <sup>_⋆_</sup> _·_ _b_ = where we have introduced the vector of derivatives: _<u>∂E</u>_ _, . . .,_ _∂n_ ˜ _G_ _NG_ _G_ 1 _<u>∂E</u>_ _∂_ _n_ ˜ <sup>=</sup> _<u>∂E</u>_ _∂n_ ˜ _G_ 1 _∂n_ ˜ <sup>_⋆_</sup> _,_ <sup>_<u>∂E</u>_</sup> _._ (12) _<u>∂E</u>_ _, . . .,_ _∂n_ ˜ <sup>_⋆_</sup> _G_ _NG_ Eq. (11) shows that the scalar product of the constraints and Lagrange multipliers is real and, therefore, so is the constrained Lagrangian, Eq. (7). Furthermore, the expression verifies, once more, the equivalence of choosing _n_ ˜ _G_ _α_ and _n_ ˜ <sup>_⋆_</sup> _G_ _α_ <sup>or the real and imaginary parts of the den-</sup> sity coefficients as independent variables. Indeed, with the latter choice, the equation indicates that, as expected and consistently, the constraints _<u>∂E</u>_ _<u>∂E</u>_ _∂_ Re[˜ _n_ _G_ _α_ ] <sup>= 0;</sup> _∂_ Im[˜ _n_ _G_ _α_ ] <sup>= 0</sup> <sup>_,_</sup> (13) would be satisfied, via the — real — Lagrange multipliers Re ( _λ_ _G_ _α_ ) and Im ( _λ_ _G_ _α_ ). The constrained evolution equations for the MaZe OFDFT system are then given by _MI_ _R_ <sup>¨</sup> _I_ = _−∇_ _R_ _I_ _E_ ( _R_ _,_ ˜ _n_ ) + ( _∇_ _R_ _I_ _σ_ <sup>_⋆_</sup> ) _·_ _λ_ ; <sup><u>(</u></sup> <sup>_<u>R</u>_</sup> <sup>_<u>,</u>_</sup> <sup><u>˜</u></sup> <sup>_<u>n</u>_</sup> <sup><u>)</u></sup> + <sup>_<u>∂</u>_</sup> <sup>_<u>σ</u>_</sup> <sup>_⋆_</sup> _∂_ _n_ ˜ <sup>_⋆_</sup> _∂_ _n_ ˜ <sup>_⋆_</sup> _µ_ _n_ <sup>¨</sup> ˜ = _−_ <sup>_<u>∂E</u>_</sup> <sup><u>(</u></sup> <sup>_<u>R</u>_</sup> <sup>_<u>,</u>_</sup> <sup><u>˜</u></sup> <sup>_<u>n</u>_</sup> <sup><u>)</u></sup> <sup>_<u>∂</u>_</sup> <sup>_<u>σ</u>_</sup> <sup>_⋆_</sup> _∂_ _n_ ˜ <sup>_⋆_</sup> <sup>_·_</sup> <sup>_λ_</sup> (14) _≡_ <sup>_<u>∂E</u>_</sup> <sup><u>(</u></sup> <sup>_<u>R</u>_</sup> <sup>_<u>,</u>_</sup> <sup><u>˜</u></sup> <sup>_<u>n</u>_</sup> <sup><u>)</u></sup> + Σ <sup>_†_</sup> _·_ _λ_ _,_ _∂_ _n_ ˜ <sup>_⋆_</sup> where we have introduced the matrix Σ <sup>_†_</sup> _≡_ _∂_ <sup>_<u>∂</u>_</sup> _n_ <sup>_<u>σ</u>_</sup> ˜ <sup>_⋆⋆_</sup> <sup>,</sup> <sup>which</sup> is the Hermitian conjugate of <sup>_⋆_</sup> _NG_ + _α,NG_ + _β_ <sup>=</sup> <sup>_<u>∂σ</u>_</sup> <sup>_<u>G</u>_</sup> <sup>_<u>α</u>_</sup> _{_ Σ _}α,β_ = _{_ Σ _}_ <sup>_⋆_</sup> _N_ _∂n_ ˜ _G_ _β_ ; _._ (15) with _γ_ = lim _µ→_ 0 <sup>_<u>λ</u>_</sup> _µ_ <sup>.</sup> Eq. (17) defines the MaZe dynamics for OFDFT. Some important properties must be noted. Firstly, since the Lagrange multipliers _λ_ go to zero with the auxiliary mass _µ_, the evolution of the physical variables is not affected by the constraint forces. Secondly, the evolution of _n_ ˜, controlled only by the constraint forces, satisfies by construction the minimum conditions at all times. These conditions are thus automatically fulfilled also in the first of Eq. (17) which is then fully equivalent to Born-Oppenheimer dynamics. This implies that, by rigorously enforcing the mass-zero limit for the auxiliary variables, MaZe provides an evolution that leads to the exact adiabatic dynamics for the physical variables. This has the important consequence that the probability density sampled from the dynamical system for the ions is exactly the one typically associated with BornOppenheimer dynamics. <sup>2,22</sup> MaZe is then free of sampling errors typically encountered in schemes with finite values of the auxiliary variables’ mass. From the point of view of the algorithm, the first equation can be integrated via any standard MD algorithm (e.g. Verlet) with a timestep determined only by the force acting on the ions. At each timestep, the Lagrange multipliers _γ_, that appear as unknown, time-dependent parameters, must also be determined. This is done adopting the SHAKE strategy. <sup>20,21</sup> In the next section, details of the algorithm for OFDFT MaZe dynamics are provided. III. MAZE ALGORITHM FOR ORBITAL-FREE DFT The numerical integration of the dynamical system in Eq. (17) proceeds as follows. The evolution of the ionic degrees of freedom is performed via standard classical MD algorithms. Here we discuss the case of Verlet propagation but there is no difficulty in adopting, for example, the velocity version of the scheme. Thus <sup>_⋆_</sup> _NG_ + _α,β_ <sup>=</sup> <sup>_<u>∂σ</u>_</sup> <sup>_<u>G</u>_</sup> <sup>_<u>α</u>_</sup> _∂n_ ˜ <sup>_⋆_</sup> _{_ Σ _}α,NG_ + _β_ = _{_ Σ _}_ <sup>_⋆_</sup> _∂n_ ˜ <sup>_⋆_</sup> _G_ _β_ The evolution equations for the additional variables can be rearranged by first observing that the vector derivative of the energy with respect to the expansion coefficients is the null vector since it corresponds to the constraints. Dividing the evolution equation for the additional variables by the inertia we obtain _MI_ _R_ <sup>¨</sup> _I_ = _−∇_ _R_ _I_ _E_ ( _R_ _,_ ˜ _n_ ) + ( _∇_ _R_ _I_ _σ_ <sup>_⋆_</sup> ) _·_ _λ_ ; _R_ _I_ ( _t_ + _δt_ ) = 2 _R_ _I_ ( _t_ ) _−_ _R_ _I_ ( _t−δt_ ) _−_ <sup>_<u>δt</u>_</sup> <sup>2</sup> _MI_ _∇_ _R_ _I_ _E_ - _R_ ( _t_ ) _,_ ˜ _n_ ( _t_ )� _,_ (18) where _δt_ is the timestep of the simulation. This algorithm requires, at each step, the computation of the forces acting on the ions after advancement of their positions. These forces _n_ ¨˜ = _µ_ <sup><u>1</u></sup> <sup>Σ</sup> <sup>_† ·_</sup> <sup>_λ_</sup> <sup>_._</sup> (16) The key step in the MaZe approach follows by considering the limit _µ_ _→_ 0 for the second equation above and imposing that this limit is taken keeping the accelerations of _n_ ˜ finite. This implies that, for every component of the vector of the Lagrange multipliers, the ratio _λ_ _G_ _<u>β</u>_ _γ_ _G_ _β_ = lim _µ→_ 0 _µ_ must remain finite, entailing that the _F_ _I_ ( _t_ + _δt_ ) = _−∇_ _R_ _I_ _E_ - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ ( _t_ + _δt_ )� _,_ (19) _λ_ _G_ _<u>β</u>_ _γ_ _G_ _β_ = lim _µ→_ 0 _µ_ must remain finite, entailing that the Lagrange multipliers are proportional to _µ_ . In the limit of zero mass for the auxiliary variables, then, the constraint forces acting on the ionic degrees of freedom vanish and the system becomes depend both on the advanced ionic coordinates and on the values of the _n_ ˜ ( _t_ + _δt_ ). The latter can be formally obtained as _n_ ˜ ( _t_ + _δt_ ; _γ_ ) =2˜ _n_ ( _t_ ) _−_ _n_ ˜ ( _t −_ _δt_ ) + _δt_ <sup>2</sup> Σ( _t_ ) <sup>_†_</sup> _·_ _γ_ =˜ _n_ <sup>_P_</sup> + Σ( _t_ ) <sup>_†_</sup> _·_ ˜ _γ_ _._ (20) _MI_ _R_ <sup>¨</sup> _I_ = _−∇_ _R_ _I_ _E_ ( _R_ _,_ ˜ _n_ ); _n_ ¨˜ = Σ <sup>_†_</sup> _·_ _γ_ _._ (17) In the second line above, we have implicitly defined _n_ ˜ <sup>_P_</sup> = 2˜ _n_ ( _t_ ) _−_ _n_ ˜ ( _t −_ _δt_ ), to be called later the “provisional” value of the coefficient, and we have scaled the Lagrange multipliers - as usually done in SHAKE by the square of the timestep, so _γ_ ˜ = _δt_ <sup>2</sup> _γ_ . The updated density coefficients depend on the set of Lagrange multipliers that are, at this stage, unknown. Following the SHAKE strategy, the multipliers are determined by imposing that the constraints for example, - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ <sup>_κ_</sup> <sup>�</sup> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ _σ_ _G_ _α_ - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ <sup>_κ_</sup> <sup>�</sup> = <sup>_∂E_</sup> _,_ (25) - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ <sup>_κ_</sup> <sup>�</sup> _G_ _α_ _σ_ - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ ( _t_ + _δt_ ; ˜ _γ_ )� = 0 _,_ (21) are satisfied at the positions predicted by the MD algorithm. Eqs. (21) are, in general, a system of nonlinear equations to be solved for the Lagrange multipliers. The solution of the nonlinear system is obtained via an adapted iterative Newton-Raphson scheme in which the values of the Lagrange multipliers at iteration _κ_ + 1 are given by _γ_ ˜ <sup>_κ_</sup> <sup>+1</sup> = _γ_ ˜ <sup>_κ_</sup> _−_ _ω_ J <sup>_−_</sup> <sup>1</sup> (˜ _n_ <sup>_κ_</sup> ) _σ_ - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ <sup>_κ_</sup> <sup>�</sup> _._ (22) In the equation above, we have introduced J <sup>_−_</sup> <sup>1</sup> (˜ _n_ <sup>_κ_</sup> ), the inverse of the Jacobian J(˜ _n_ <sup>_κ_</sup> ) _≡_ _<u>∂</u>_ _<u>σ</u>_ _∂_ <u>(˜</u> _γn_ ˜ <sup>_κ_</sup> <u>)</u> whose matrix elements are given by <sup>_⋆_</sup> _NG_ + _α,NG_ + _β_ <sup>=</sup> <sup>_<u>∂σ</u>_</sup> <sup>_<u>G</u>_</sup> <sup>_<u>α</u>_</sup> <sup><u>(˜</u></sup> <sup>_<u>n</u>_</sup> <sup>_κ_</sup> <sup><u>)</u></sup> _{_ J(˜ _n_ <sup>_κ_</sup> ) _}α,β_ = _{_ J(˜ _n_ <sup>_κ_</sup> ) _}_ <sup>_⋆_</sup> _∂γ_ ˜ _G_ _β_ where the ground state energy, _E_ is expressed as the sum in Eq. (1). The _σ_ _G_ <sup>_⋆_</sup> _α_ - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ <sup>_κ_</sup> <sup>�</sup> can be obtained via complex conjugation. Eq. (25) highlights that the calculation of the constraints is identical to that of the force on the electronic coefficients in Car-Parrinello OFDFT <sup>29</sup> or of the derivatives employed in conjugate-gradient minimization in Born-Oppenheimer OFDFT <sup>34</sup> . Direct evaluation shows that the derivatives are obtained at an Ωlog Ωcost for any form of the energy functional, and in particular of the kinetic energy functional. We do not report the explicit expressions for these quantities since they are standard and available in the literature. <sup>28,34</sup> Secondly, the evolution equations (20) and the update of the density coefficients (24) require a matrix-vector product Σ <sup>_†_</sup> _·_ _γ_ . In Appendix A we show that this can be performed with Ωlog Ωscaling for GGA functionals and in Appendix B that the same scaling can be achieved for nonlocal functionals. Having a procedure to compute the matrix-vector product between Σ <sup>_†_</sup> and a generic vector, also offers a means to compute the matrix-vector product of a generic vector with J, exploiting the fact that the Jacobian can be expressed as J = Σ(˜ _n_ <sup>_κ_</sup> ) _·_ Σ( _t_ ) <sup>_†_</sup> . The latter relationship can be proven by considering the definition of the matrix elements in Eq. (23). For example, <sup>_⋆_</sup> _NG_ + _α,β_ <sup>=</sup> <sup>_<u>∂σ</u>_</sup> <sup>_<u>G</u>_</sup> <sup>_<u>α</u>_</sup> <sup><u>(˜</u></sup> <sup>_<u>n</u>_</sup> <sup>_κ_</sup> <sup><u>)</u></sup> _∂γ_ ˜ <sup>_⋆_</sup> ; _,_ (23) _{_ J(˜ _n_ <sup>_κ_</sup> ) _}α,NG_ + _β_ = _{_ J(˜ _n_ <sup>_κ_</sup> ) _}_ <sup>_⋆_</sup> _∂γ_ ˜ <sup>_⋆_</sup> _G_ _β_ with _α, β_ = 1 _, ..., NG_, and _n_ ˜ <sup>_κ_</sup> is the vector of the electronic density coefficients at iteration _κ_ . The parameter _ω_ in Eq. (22) is a scaling factor that, following common practice in minimization algorithms, <sup>37</sup> modulates the update of the Lagrange multipliers. Previous calculations <sup>38</sup> show that using such a scaling improves convergence in standard implementations of SHAKE. At each iteration in the cycle, the Fourier coefficients are updated as _n_ ˜ <sup>_κ_</sup> <sup>+1</sup> = _n_ ˜ <sup>_κ_</sup> + Σ( _t_ ) <sup>_†_</sup> _·_ ˜ _γ_ <sup>_κ_</sup> _,_ (24) and used in Eq. (22) to update the vector of constraints. The iteration cycle is typically initialized using null values for the Lagrange multipliers or assigning them as the converged values of the previous timestep. The process is stopped when max _G_ _α |σ_ _G_ _α_ _|_ becomes smaller than a predefined tolerance. The convergence of the Newton-Raphson algorithm is normally quadratic. <sup>37</sup> The numerical efficiency of the method therefore hinges on the cost of the different quantities and operations necessary to perform the iterations. Below, we summarize the main characteristics of these quantities by showing — when necessary — their explicit component-wise expression, reporting the numerical cost of the key operations in the algorithm. Detailed assessment of these numerical costs is given in the Appendices to avoid interrupting the main text with lengthy calculations. Let us begin with the evaluation of the constraint vector _σ_ - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ <sup>_κ_</sup> <sup>�</sup> . From Eq. (21), we have to compute, _{_ J(˜ _n_ <sup>_κ_</sup> ) _}α,β_ = <sup>_<u>∂σ</u>_</sup> <sup>_<u>G</u>_</sup> <sup>_<u>α</u>_</sup> _∂γ_ ˜ _G_ _β_ _<u>∂n</u>_ <u>˜</u> _<u>G</u>_ _<u>λ</u>_ _∂γ_ ˜ _G_ _β_ + <sup>_<u>∂σ</u>_</sup> <sup>_<u>G</u>_</sup> <sup>_<u>α</u>_</sup> _G_ _λ_ = = = _NG_ �Σ(˜ _n_ <sup>_κ_</sup> ) _·_ Σ( _t_ ) <sup>_†_</sup> <sup>�</sup> _α,β_ <sup>_._</sup> (26) - _<u>∂σ</u>_ _<u>G</u>_ _<u>α</u>_ _∂n_ ˜ _G_ _λ_ _∂n_ ˜ <sup>_⋆_</sup> _<u>G</u>_ _<u>λ</u>_ _∂γ_ ˜ _G_ _β_ _λ_ =1 _NG_ _∂n_ ˜ <sup>_⋆_</sup> + <sup>_<u>∂σ</u>_</sup> <sup>_<u>G</u>_</sup> <sup>_<u>α</u>_</sup> <sup><u>(˜</u></sup> <sup>_<u>n</u>_</sup> <sup>_κ_</sup> <sup><u>)</u></sup> - _<u>∂σ</u>_ _<u>G</u>_ _<u>α</u>_ <u>(˜</u> _<u>n</u>_ _κ_ <u>)</u> _∂n_ ˜ _G_ _λ_ _∂σ_ _G_ <sup>_⋆_</sup> _β_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> _∂n_ ˜ <sup>_⋆_</sup> _G_ _λ_ _∂σ_ _G_ <sup>_⋆_</sup> _β_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> _∂n_ ˜ _G_ _λ_ _∂n_ ˜ <sup>_⋆_</sup> _G_ _λ_ _λ_ =1 - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ <sup>_κ_</sup> <sup>�</sup> . From Eq. (21), we have to compute, In going from the first to the second line in the equations above, the derivative of the density coefficients with respect to the Lagrange multipliers was computed from Eq. (20) and the notation indicates that derivatives of the constraints are computed either at the provisional values of the coefficients, _n_ ˜ <sup>_κ_</sup>, or with variables computed at time _t_ . Similar expressions hold for the other blocks of the matrix proving the result. Finally, the solution of the Newton-Raphson system, Eq. (22), requires evaluation and inversion of the Jacobian, Eq. (23). These steps are characteristic of the MaZe approach and nontrivial. The number of elements in the Jacobian matrix, in fact, scales quadratically with the number of electronic coefficients and brute force inversion of the matrix would take the cost of MaZe dynamics to cubic order in CPU operations and to quadratic order in memory requirements. Indeed, it is well known even in standard applications of classical constrained MD, that the dimensions of the Jacobian are typically too large to allow for direct inversion. The commonly adopted strategy is then to consider the diagonal approximation of the Jacobian (i.e., all off-diagonal elements are set to zero) enabling inversion at linear cost in the matrix dimensions. In the next subsection, we discuss in detail this consolidated approach, that we shall indicate as standard SHAKE and that has been employed also in previous work with MaZe. For energy functionals beyond the GGA class, such as those including the more recent and accurate nonlocal kinetic energies, however, linear scaling of this algorithm fails due to the intrinsic cost of computing the diagonal elements of the Jacobian. In the following subsection, we then describe an effective and completely general alternative implementation of SHAKE that preserves the Ωlog Ωscaling of OFDFT simulations also for nonlocal functionals. Both implementations of SHAKE discussed in the following avoid propagation of the (numerical) error in the enforcement of the constraint at different timesteps. Furthermore, they are symplectic and time reversible, <sup>39,40</sup> leading to stable propagation for very long times. Before moving to the details of the SHAKE implementations, we note that the algorithm described so far for a system of ions evolving at constant energy (NVE ensemble) can be applied with very limited changes also to ionic evolution in other ensembles. In particular, ionic motion at constant temperature will be considered in the Results section. In the full adiabatic limit, the overall system is characterized in this case by a steady nonequilibrium regime in which the electronic degrees of freedom remain strictly at zero temperature and respect the minimum conditions, while the ions move at an assigned temperature, _T_ . The coupled dynamical system is then obtained by considering thermostatted evolution equations (e.g. Langevin) for the ionic degrees of freedom and constraining the electronic coefficients at each configuration along the ionic trajectory as described above. A. Standard SHAKE (STD-SHAKE) The diagonal approximation of the Jacobian matrix defined in Eq. (23) is given by _NG_ components. Furthermore, as the second _NG_ equations in the diagonal system corresponds to the complex conjugate of the first _NG_, we only need to solve for the _NG_ -dimensional vector _γ_ ˜ _G_ _α_ . Eq. (28) is then restricted to _NG_ components with the _NG_ _× NG_ diagonal matrix _<u>∂σ</u>_ _<u>G</u>_ _<u>α</u>_ _{_ J _D}α,α_ = _∂γ_ ˜ _G_ _β_ <sup>_δα,β_</sup> <sup>.</sup> Previous experience shows that the use of such diagonal approximation of the Jacobian does not hinder the speed of convergence of the NewtonRaphson process, in particular when — as usual in applications of SHAKE in classical MD — this matrix is diagonally dominant. Furthermore, in typical classical MD applications, the evaluation of the diagonal elements of the Jacobian does not pose a numerical challenge because the constraints have simple forms (e.g. fixed bond distances in molecules), and involve small subsets of degrees of freedom (e.g. neighboring atoms in the molecules). This is, unfortunately, not the case for the constraints considered in this work. To appreciate the effort required to compute the matrix elements of the Jacobian, let us consider the different terms in Eq. (26). From the definition of the constraints, we have, for example, with analogous expressions for the other terms. The second derivatives of the energy with respect to the expansion coefficients, in particular for the kinetic and exchange-correlation terms, are typically available via libraries of energy functionals for DFT calculations. In the following, we refer to the lib ~~x~~ c <sup>41</sup> library that has been used in our implementation of MaZe OFDFT. Explicit expressions for the second derivatives are more easily discussed by considering separately the terms in Eq. (1). Let us begin by observing that the Coulomb interaction between the ions (that does not depend on the electronic density) and the interaction energy between electrons and ions, _E_ ext[ _R_ _, n_ ] (that depends linearly on the electronic density) do not contribute to the second derivatives. The Hartree term, on the other hand, is quadratic in the electronic density. Using its expression in Fourier space, it is immediate to show that _<u>∂σ</u>_ _<u>G</u>_ _<u>α</u>_ <u>(˜</u> _<u>n</u>_ <sup>_κ_</sup> <u>)</u> _∂n_ ˜ _G_ _λ_ _<u>∂σ</u>_ _<u>G</u>_ _<u>α</u>_ <u>(˜</u> _<u>n</u>_ <sup>_κ_</sup> <u>)</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _λ_ <sup>_⋆_</sup> _G_ _λ_ <sup>_∂n_</sup> <sup>˜</sup> _G_ <sup>_⋆_</sup> _<u>∂</u>_ <sup>2</sup> _<u>E</u>_ <u>[˜</u> _<u>n</u>_ <sup>_κ_</sup> <u>]</u> = _∂n_ ˜ _G_ _λ_ _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ _<u>∂</u>_ <sup>2</sup> _<u>E</u>_ <u>[˜</u> _<u>n</u>_ <sup>_κ_</sup> <u>]</u> = _∂n_ ˜ _G_ _λ_ _∂n_ ˜ <sup>_⋆_</sup> _G_ _<u>∂</u>_ <sup>2</sup> _<u>E</u>_ <u>[˜</u> _<u>n</u>_ <sup>_κ_</sup> <u>]</u> = _∂n_ ˜ <sup>_⋆_</sup> _G_ _λ_ <sup>_∂n_</sup> <sup>˜</sup> _G_ <sup>_⋆_</sup> ; _,_ (29) _G_ <sup>_⋆_</sup> _α_ _{_ J _D}α,β_ = <sup>_<u>∂σ</u>_</sup> <sup>_<u>G</u>_</sup> <sup>_<u>α</u>_</sup> _∂γ_ ˜ _G_ _β_ _{_ J _D}α,NG_ + _β_ = 0; _{_ J _D}NG_ + _α,β_ = 0; indicating that this term is diagonal in reciprocal space. The evaluation of the second derivatives of the exchangecorrelation (xc) and kinetic energy functionals is less straightforward. In the following, we shall consider the GGA class of approximation for these quantities, so they will depend, in general, on the electronic density and its gradient. GGA xc functionals are often used in condensed-phase applications both in orbital-free and Kohn-Sham DFT, <sup>42</sup> indicating that the algorithm discussed here has a broad interest. Within OFDFT, GGA _<u>∂</u>_ <sup>2</sup> _<u>E</u>_ <u>Hart[</u> _<u>n</u>_ <u>]</u> _∂n_ ˜ _G_ _β_ _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ = <sup><u>4</u></sup> <sup>_<u>π</u>_</sup> <sup><u>Ω</u></sup> (30) _|_ _G_ _α|_ <sup>2</sup> <sup>_δα,β,_</sup> _<u>G</u>_ _{_ J _D}NG_ + _α,NG_ + _β_ = <sup>_∂σ⋆_</sup> _<u>G</u>_ _<u>α</u>_ <sup>_∂σ⋆_</sup> _∂γ_ ˜ <sup>_⋆_</sup> _G_ _β_ _δα,β_ ; _δα,β,_ _G_ _β_ leading to approximate Eq. (22) as _γ_ ˜ <sup>_κ_</sup> <sup>+1</sup> = _γ_ ˜ <sup>_κ_</sup> _−_ _ω_ J <sup>_−_</sup> _D_ <sup>1(˜</sup> <sup>_n_</sup> <sup>_κ_</sup> <sup>)</sup> <sup>_σ_</sup> - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ <sup>_κ_</sup> <sup>�</sup> (27) _._ (28) This diagonal approximation trivially decouples the first _NG_ components of the vectors _σ_ and _γ_ from the second kinetic energy functionals include the Thomas-Fermi-von Weizs¨acker <sup>43</sup> (TFvW) and Perrot <sup>44</sup> approximations discussed in the Results section. The lib ~~x~~ c library processes the kinetic and xc functionals in the same way, and in the following we shall discuss directly the sum of these two terms, i.e. _E_ KXC[ _n, ∇n_ ] = _E_ KE[ _n, ∇n_ ] + _E_ xc[ _n, ∇n_ ]. A description of the manipulations leading from the lib ~~x~~ c output to a form of the second derivatives suitable for our purposes is given in Appendix A. Here we report the final result (see eq. (A13)) we note for future convenience that they are real periodic functions in real space. The second derivatives with respect to different combination of coefficients and complex conjugates of coefficients that are needed in the Jacobian matrix can be obtained from the expression above using the rules of complex conjugation. Note the Hessian matrix above is dominated by its diagonal for which _G_ _β_ _−_ _G_ _α_ = 0 and all terms in the sum over _r_ interfere _<u>∂</u>_ <sup>2</sup> _<u>E</u>_ <u>KXC</u> constructively. The same is true for the term _∂n_ ˜ <sup>_<u>⋆</u>_</sup> _G_ _β_ <sup>_∂n_</sup> <sup>˜</sup> <sup>_G_</sup> _α_ <sup>.</sup> _<u>∂</u>_ <sup>2</sup> _<u>E</u>_ <u>KXC</u> _<u>∂</u>_ <sup>2</sup> _<u>E</u>_ <u>KXC</u> However, the two terms _∂n_ ˜ _G_ _β ∂n_ ˜ _G_ _α_ <sup>and</sup> _∂n_ ˜ <sup>_<u>⋆</u>_</sup> _G_ _β_ <sup>_∂n_</sup> <sup>˜</sup> _G_ <sup>_<u>⋆</u>_</sup> <sup>_<u>⋆</u>_</sup> <sup>_<u>G</u>_</sup> _G_ <sup>_<u>α</u>_</sup> _β_ <sup>, respectively,</sup> <sup>_<u>⋆</u>_</sup> _G_ _β_ <sup>_∂n_</sup> <sup>˜</sup> <sup>_<u>⋆</u>_</sup> _G_ <sup>_<u>⋆</u>_</sup> _α_ <sup>,</sup> <sup>en-</sup> _<u>∂</u>_ <sup>2</sup> _<u>E</u>_ <u>KXC</u> _∂n_ ˜ _G_ _β_ _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ <u>Ω</u> = _ND_ _r_ _∂σ_ <sup>_⋆_</sup> _∂σ_ _<u>G</u>_ <sup>_⋆_</sup> _<u>α</u>_ _∂n_ ˜ <sup>_<u>⋆</u>_</sup> _∂n_ ˜ _G_ _β_ <sup>and</sup> <sup>_<u>∂σ</u>_</sup> <sup>_<u>G</u>_</sup> _G_ <sup>_<u>α</u>_</sup> _β_ _∂n_ ˜ <sup>_<u>⋆</u>_</sup> exp[i _G_ _β_ _·_ _r_ ] exp[ _−_ i _G_ _α ·_ _r_ ] tering in the expressions of are smaller in magnitude since they all carry a phase with wavevector _±_ ( _G_ _β_ + _G_ _α_ ). The structure of the Hartree and KXC terms motivates our choice of the 2 _NG_ complex vectors defined in Eqs. (8) and (9), and to solve the constraint in Fourier space. This choice, in fact, ensures that the Jacobian matrix is diagonally dominant facilitating the convergence of the standard SHAKE algorithm. Substituting Eq. (30) and the second derivatives of the KXC term, Eq. (31), in Eq. (26), we obtain _α_ <sup>_l_</sup> <sup>)Φ</sup> <sup>_l_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) +</sup> <sup>_Gl_</sup> _β_ (31) <sup>_l_</sup> _β_ <sup>_Gm_</sup> _α_ <sup>_m_</sup> _α_ <sup>Ψ</sup> <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> _,_ _×_ Ξ( _r_ ) + i( _G_ <sup>_l_</sup> <sup>_l_</sup> _β_ <sup>_−_</sup> <sup>_Gl_</sup> where _ND_ is the number of points used to discretize the density in real space, _l_ and _m_ identify Cartesian components of the three-dimensional vectors and repetition of these indexes indicates a sum over them. The functions Ξ( _r_ ), Φ <sup>_l_</sup> ( _r_ ) and Ψ <sup>_lm_</sup> ( _r_ ) are defined in Appendix A. Here <u>Ω</u> _ND_ �2 + <sup><u>4</u></sup> <sup>_<u>π</u>_</sup> <sup><u>Ω</u></sup> _|_ _G_ _α|_ <sup>2</sup> _r_ _r_ <sup>_m_</sup> _α_ <sup>Ψ</sup> P <sup>_lm_</sup> <sup>_m_</sup> _α_ <sup>Ψ</sup> _t_ <sup>_lm_</sup> <sup>_l_</sup> _α_ <sup>_Gm_</sup> _α_ <sup>_l_</sup> _α_ <sup>_Gm_</sup> _α_ - + <sup><u>4</u></sup> <sup>_<u>π</u>_</sup> <sup><u>Ω</u></sup> P <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> _t_ <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> _|_ _G_ _α|_ <sup>2</sup> [J _D_ ] _G_ _α,_ _G_ _α_ = - <u>4</u> _<u>π</u>_ <u>Ω</u> _|_ _G_ _α|_ <sup>2</sup> �ΞP( _r_ ) + _G_ <sup>_l_</sup> <u>Ω</u> _ND_ �Ξ _t_ ( _r_ ) + _G_ <sup>_l_</sup> _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>_NG_</sup> _λ_ =1 �2 � _r_ _,_ _r_ <sup>_′_</sup> + + - <u>Ω</u> _ND_ - <u>Ω</u> _ND_ _e_ <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> <sup>_′_</sup> _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> <sup>_′_</sup> _α_ <sup>_l_</sup> <sup>)Φ</sup> _t_ <sup>_l_</sup> _α_ <sup>_l_</sup> <sup>)Φ</sup> <sup>_l_</sup> <sup>_m_</sup> _α_ <sup>Ψ</sup> _t_ <sup>_lm_</sup> _t_ <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>)</sup> _λ_ <sup>_l_</sup> <sup>_Gm_</sup> _α_ _t_ <sup>_l_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>) +</sup> <sup>_G_</sup> _λ_ <sup>_l_</sup> ��Ξ _t_ ( _r_ <sup>_′_</sup> ) _−_ i( _G_ <sup>_l_</sup> P <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_m_</sup> _α_ <sup>Ψ</sup> P <sup>_lm_</sup> _λ_ <sup>_l_</sup> <sup>_Gm_</sup> _α_ P <sup>_l_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) +</sup> <sup>_G_</sup> _λ_ <sup>_l_</sup> _×_ �ΞP( _r_ ) + i( _G_ <sup>_l_</sup> _λ_ <sup>_l_</sup> _λ_ <sup>_−_</sup> <sup>_Gl_</sup> <sup>_l_</sup> _λ_ <sup>_−_</sup> <sup>_Gl_</sup> _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>_NG_</sup> _λ_ =1 �2 � _r_ _,_ _r_ <sup>_′_</sup> �Ξ _t_ ( _r_ <sup>_′_</sup> ) + i( _G_ <sup>_l_</sup> _λ_ <sup>_l_</sup> _λ_ <sup>+</sup> <sup>_Gl_</sup> _α_ <sup>_l_</sup> <sup>)Φ</sup> _t_ <sup>_l_</sup> _α_ <sup>_l_</sup> <sup>)Φ</sup> <sup>_l_</sup> <sup>_m_</sup> _α_ <sup>Ψ</sup> _t_ <sup>_lm_</sup> _,_ _t_ <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>)</sup> _λ_ <sup>_l_</sup> <sup>_Gm_</sup> _α_ _t_ <sup>_l_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_G_</sup> _λ_ <sup>_l_</sup> _×_ P <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_m_</sup> _α_ <sup>Ψ</sup> P <sup>_lm_</sup> _λ_ <sup>_l_</sup> <sup>_Gm_</sup> _α_ P <sup>_l_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_G_</sup> _λ_ <sup>_l_</sup> _×_ �ΞP( _r_ ) _−_ i( _G_ <sup>_l_</sup> _λ_ <sup>_l_</sup> _λ_ <sup>+</sup> <sup>_Gl_</sup> where the first term in the RHS arises from the Hartree contribution to the energy functional, while the others stem from the kinetic and xc functionals or mixed terms. The Hartree contribution and the mixed terms can be easily seen to scale linearly with respect to the number of grid points. The difficult contributions in terms of numerical complexity are the last two sums, which we now discuss. The three sums appearing in these kinetic and xc terms indicate that the brute force calculation of these contributions scales cubically with the number of grid points in direct and reciprocal space, a prohibitive bottleneck for realistic calculations. In Appendix C, we show how this cost can be reduced, for GGA functionals, to Ωlog Ω scaling by exploiting periodicity in direct space. This result will be used for comparison purposes in the Results section. (32) B. SHAKE with linear conjugate gradient (LCG-SHAKE) An alternative way of performing the Newton-Raphson step, Eq. (22), can be derived by building on an approach first suggested by Weinbach and Elber. <sup>26</sup> These authors proposed to obtain the value of the constraints at each iteration _κ_ by considering an approximate and, importantly, symmetric form of the Jacobian matrix which enables to solve the Newton-Raphson system using linear conjugate gradient. This algorithm was conceived to facilitate parallelization of classical constrained MD and applied to the simulation of biological systems. <sup>26</sup> In the following we show how the approach can be adapted to the solution of the Newton-Raphson step for MaZe OFDFT and demonstrate that it overcomes the limitations of standard SHAKE by preserving linear scaling for general forms of the energy functional, including those that employ nonlocal kinetic energies. Let us consider again Eq. (22): defining _δ_ _γ_ ˜ = _γ_ ˜ <sup>_κ_</sup> <sup>+1</sup> _−_ _γ_ ˜ <sup>_κ_</sup>, this equation can be trivially rewritten as the system of linear equations J(˜ _n_ <sup>_κ_</sup> ) _δ_ _γ_ ˜ = _−ω_ _σ_ - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ <sup>_κ_</sup> <sup>�</sup> _._ (33) Our goal is to solve this system as efficiently as possible using linear conjugate gradient. In analogy with Ref. 26, that considered the case of a system of real equations, we observe that linear conjugate gradient cannot be immediately applied because the Jacobian matrix is not hermitian (symmetric in Ref. 26) due to the fact that the explicit expressions for its matrix elements (see for example Eq. (26)) contain derivatives of the constraints evaluated with the density computed at time _t_ and at the provisional value _n_ ˜ <sup>_κ_</sup> . Similar to Ref. 26, we then approximate the matrix elements of the Jacobian as _{_ J( _t_ ) _}α,β_ = <sup>_<u>∂σ</u>_</sup> <sup>_<u>G</u>_</sup> <sup>_<u>α</u>_</sup> _∂γ_ ˜ _G_ _β_ + <sup>_<u>∂σ</u>_</sup> <sup>_<u>G</u>_</sup> <sup>_<u>α</u>_</sup> <sup><u>(</u></sup> <sup>_<u>t</u>_</sup> <sup><u>)</u></sup> on constant energy (NVE) and constant temperature (NVT) simulations of a system of particles of sodium in different thermodynamic states and with different kinetic energy functionals. We start by detailing the relative efficiency of the two methods and then, having shown its merits, we move to compute static and dynamical statistical properties of the system with the LCG-SHAKE. In particular, the reliability of the algorithm for NVT calculations (never tested before), is demonstrated. Finally, we discuss preliminary comparisons the performance of MaZe to that of standard nonlinear conjugate gradient (NLCG) based Born-Oppenheimer dynamics by considering energy conservation and time reversibility for a realistic test system. For all calculations discussed in this section, periodic boundary conditions are enforced in all directions and the electrostatic interactions are treated via the Ewald summation method with a cutoff radius of _R_ c = 1 _._ 06 <sup>˚</sup> A. For these tests, Slater <sup>46,47</sup> and Perdew & Zunger <sup>48</sup> functionals are used for the exchange and correlation contributions _E_ xc to the total energy, respectively. Functionals adopted for the kinetic energy are detailed in the following. The interaction of the atomic nucleus with the electrons up to the last closed shell is modeled using the pseudopotential for sodium described by Topp and Hopfield. <sup>49</sup> The cutoff for the plane-wave expansion is set to _G_ c = 10 _E_ h and the timestep is set to _δt_ = 1 fs for all simulations. The NVE evolution of the physical degrees of freedom is performed using the velocity Verlet algorithm. As for the evolution of the coefficients of the density, the provisional values used as the initial guess for the Newton–Raphson iterative procedure in SHAKE is computed through the Verlet algorithm. The first two values of the coefficients - necessary for the initialization of the Verlet algorithm - are obtained through two minimizations of the energy functional using a NLCG algorithm and the full MaZe dynamics for the system is started from the second simulation step. The NVT ensemble is sampled via the use of a Langevin thermostat where the evolution of the physical degrees of freedom is integrated using the algorithm proposed by Vanden-Eijnden and Ciccotti. <sup>50</sup> The same approach is also used in the NVE runs - with the friction parameter of the thermostat set to _ν_ = 10 <sup>_−_</sup> <sup>5</sup> au — to equilibrate the systems to the target temperatures (see below), via runs of duration equal to 10 ps. The number of electrons is kept constant along the simulation by excluding the _G_ = (0 _,_ 0 _,_ 0) component of the electronic density expansion in reciprocal space from the dynamical system as detailed in the previous sections. Tests are focused on two different thermodynamic states of the system, <sup>2</sup> solid ( _Ts_ _≈_ 25 K, _ρs_ = 969 _._ 5 kg m <sup>_−_</sup> <sup>3</sup> ) and liquid ( _Tl_ _≈_ 430 K, _ρl_ = 926 _._ 8 kg m <sup>_−_</sup> <sup>3</sup> ). 2 The melting temperature of Sodium at room pressure is _Tm_ = 371 K. _∂σ_ _G_ <sup>_⋆_</sup> _β_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> _∂n_ ˜ <sup>_⋆_</sup> _G_ _λ_ _∂σ_ _G_ <sup>_⋆_</sup> _β_ <sup>(</sup> <sup>_t_</sup> <sup>)</sup> _∂n_ ˜ _G_ _λ_ _≈_ = _NG_ �Σ( _t_ ) _·_ Σ( _t_ ) <sup>_†_</sup> <sup>�</sup> _α,β_ <sup>_,_</sup> - _<u>∂σ</u>_ _<u>G</u>_ _<u>α</u>_ <u>(</u> _<u>t</u>_ <u>)</u> _∂n_ ˜ _G_ _λ_ _∂n_ ˜ <sup>_⋆_</sup> _G_ _λ_ _λ_ =1 (34) and similarly for the other blocks of the matrix. Compared to the exact SHAKE expression, all derivatives in the equations above are evaluated using the density at time _t_, with similar expressions for the other blocks in Eq. (23). We denote this approximate Jacobian as J� _n_ ˜ ( _t_ )� _≡_ J( _t_ ). Direct inspection of the approximate Ja cobian shows that it is hermitian. Furthermore, we have _ζ_ <sup>_⋆_</sup> J( _t_ ) _ζ_ = _ζ_ <sup>_⋆_</sup> Σ( _t_ )Σ <sup>_†_</sup> ( _t_ ) _ζ_ _>_ 0 _,_ (35) for all _ζ_ _̸_ = 0, proving that the matrix is positive definite. The solution of _,_ (36) J( _t_ ) _δ_ _γ_ ˜ = _−ω_ _σ_ - _R_ ( _t_ + _δt_ ) _,_ ˜ _n_ <sup>_κ_</sup> <sup>�</sup> (that we take as an approximant for Eq. (33)) can then be obtained by direct application of linear conjugate gradient with complex variables, with or without preconditioning. <sup>45</sup> (Note that using linear conjugate gradient, requires the application of the matrix J( _t_ ) on complex vectors of size 2 _NG_ . This operation can be performed with Ωlog Ωscaling for either GGA (see Appendix A) and nonlocal (see Appendix B) energy functionals.) In Ref. 26 the authors showed that the solution of this system converges to the same set of Lagrange multipliers of the standard SHAKE. In the Results section, we also show that this method is more efficient than standard SHAKE when applied to OFDFT dynamics. IV. BENCHMARKS AND RESULTS The algorithms described in the previous sections are tested and compared in the orbital-free DFT framework To set the stage for the production runs, we recall that, as discussed in Sec. III A, when using the standard SHAKE algorithm, the calculation of the matrix J _D_ defined in Eq. (27) is the most expensive ingredient in the solution of the constraints. To explore this calculation, we implemented and computed it, as per its Ωlog Ωscaling expression in Eq. (C9), for a system of _N_ = 128 sodium atoms in the solid (box size of _Ls_ = 17 _._ 1 <sup>˚</sup> A) and liquid (box size _Ll_ = 17 _._ 4 <sup>˚</sup> A). We considered two different kinetic energy functionals: Thomas-Fermi-von Weizs¨acker <sup>43</sup> (TFvW) and Perrot. <sup>44</sup> Two simulations of 1000 steps for the solid and liquid systems were performed, computing J _D_ for configurations obtained every 100 steps. Results for liquid Sodium are reported as a function of the modulus of the wave-vector, as red (TFvW) and blue (Perrot) squares in Figure 1. Calculations for the solid (not reported) show very similar behavior. Note that the results for the 10 configurations selected in these test runs are essentially superimposed for both curves. These plots show then that the shape of the denominator does not change significantly along the simulation. This behavior is an additional confirmation of the fact that the Hessian of the Hartree term in the energy functional - independent of the electronic density and thus constant along the simulation - has a dominant role in the computation of the denominator, therefore corroborating the discussion after Eq (30) and Eq. (31). In Figure 1, the numerical values of the SHAKE denominator are also compared to the analytical approximation: �4 _π_ Ω�2 _|_ _G_ _α|−_ 4 _,_ (37) �2 _|_ _G_ _α|_ <sup>4</sup> + employ it only as an effective preconditioner in the LCGSHAKE algorithm described in Section III B. We now move to the comparison of the efficiency of the standard SHAKE and LCG-SHAKE implementations of MaZe. The tests below have been performed using the same set of configurations employed in the discussion above. We begin by showing, in Figure 2, the path to convergence of the Newton-Raphson solution of the constraint equations for the two different algorithms. The figure reports, as a function of the total number of iterations needed to converge, the modulus of the largest component of the constraint vector below a given threshold. In red, results for the standard SHAKE are reported, showing the characteristic monotonic decrease of max _G_ _α_ _|σ_ _G_ _α_ _|_ with number of iterations already observed in previous MaZe implementations. <sup>2</sup> The blue curves, on the other hand, show the path to convergence of the LCG-SHAKE. We recall that for the latter, the linear system, Eq. (33), needs to be solved via linear conjugate gradient, implying an additional iterative procedure. This linear system is considered solved when the square-root of the norm of the residuals is less than 5 _·_ 10 <sup>_−_</sup> <sup>14</sup> au. The iterations needed for this solution are represented in Figure 2 as the horizontal segments. Both for standard SHAKE and for the LCG-SHAKE, we set the convergence threshold of the Newton-Raphson algorithm to 10 <sup>_−_</sup> <sup>10</sup> au. A successive over-relaxation parameter _ω_ = 0 _._ 35 and _ω_ = 0 _._ 21 is set in the standard SHAKE algorithm when the TFvW and Perrot kinetic energy functionals are used, respectively. For the LCG-SHAKE algorithm, _ω_ = 1 proved the best choice in all tests performed. The panels in the figure show that, for the functional considered and irrespective of the solid (upper panel) or liquid (lower) state of the system, both algorithms converge in a relatively small number of iterations. Furthermore, LCG-SHAKE clearly outperforms standard SHAKE when the Perrot functional is adopted. The apparent advantage of standard SHAKE for the TFvW functional is however limited to the number of iterations. In fact, comparing the efficiency of the two algorithms in terms of average wall time to solution, Figure 3, we see that the algorithms (both very efficient) have relatively similar performances for the TFvW calculations, while LCG-SHAKE is faster than standard SHAKE for Perrot, most notably in the case of the liquid simulations. We conclude this survey of the numerical properties of MaZe by demonstrating, for the more efficient LCGSHAKE, the linear scaling of the computational cost with respect to the system size. For this particular benchmark, 10 simulation steps of a system of solid sodium modelled with the TFvW kinetic energy functional have been performed for a number of particles ranging from _N_ = 2000 to _N_ = 500094, and the average wall time per timestep has been reported in Figure 4 as a function of the number of particles in the simulation, showing a very good linear scaling. Accuracy and reliability of the LCG-SHAKE MaZe method in performing physically realistic simulations [J _D_ ] <sup>analytical</sup> _G_ _α,_ _G_ _α_ = - <u>Ω</u> 4 _ρ_ where Ωis the volume of the simulation box and _ρ_ = _N_ el _/_ Ωis the uniform electron density of the system. This analytical approximation is obtained as the sum of the diagonal Hartree contribution, which is dominant at small _|_ _G_ _α|_, and of the von Weizs¨acker contribution to the kinetic energy functional, dominant at large _|_ _G_ _α|_ . The latter is given by d <sup>3</sup> _r_ <sup>_<u>|∇n</u>_</sup> <sup><u>(</u></sup> <sup>_<u>r</u>_</sup> <sup><u>)</u></sup> <sup>_<u>|</u>_</sup> <sup>2</sup> _._ (38) _n_ ( _r_ ) _E_ vW[ _n_ ] = <sup><u>1</u></sup> 8 Ω Assuming _n_ ( _r_ ) = _ρ_ constant at the denominator in the integral, we have _E_ vW[ _n_ ] _≈_ <sup><u>1</u></sup> 8 _ρ_ Ω d <sup>3</sup> _r_ _|∇n_ ( _r_ ) _|_ <sup>2</sup> _≈_ <sup><u>Ω</u></sup> 4 _ρ_ _NG_ _α_ =1 _|_ _G_ _α|_ <sup>2</sup> _n_ ˜ <sup>_⋆_</sup> _G_ _α_ <sup>_n_</sup> <sup>˜</sup> <sup>_G_</sup> _α_ <sup>_._</sup> (39) In Figure 1 the analytical approximation, Eq. (37), is shown as the yellow curve and turns out to be remarkably accurate, at least for the system under investigation. (Similar results were obtained for solid Sodium, not shown.) Adoption of this expression for the SHAKE denominator might be used to reduce the computational cost of our calculations. In the following, however, we 1x10 <sup>17</sup> 1x10 <sup>16</sup> 1x10 <sup>15</sup> 1x10 <sup>14</sup> 1x10 <sup>13</sup> 1x10 <sup>12</sup> Analytic Approximation Perrot TFvW Liquid Na 1.2 1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0 1 2 3 4 5 6 7 Perrot TFvW 0 1 2 3 4 5 6 7 Modulus of G-vector |G| FIG. 1. Main plot: Diagonal of the SHAKE matrix (SHAKE denominator) for liquid sodium for different kinetic energy functionals (red points TFvW, blue points Perrot) compared with the analytic approximation obtained from Eq. (37) (yellow curve). Inset: Ratio between the SHAKE denominator and the analytic approximation. are now shown on a system of liquid sodium modelled through the Perrot kinetic energy functional. Two sets of simulations are presented in the following, in the NVE and NVT ensemble. The temperature of the system is the same for both sets of simulations, _T_ = 434 K. In all cases, the calculation of the coefficients of the density in reciprocal space is performed using MaZe together with the LCG-SHAKE algorithm, where the provisional value of the additional dofs is computed through a standard Verlet algorithm. We begin by considering the radial distribution function of the system, shown in Figure 5. The red curve shows the result obtained for an NVE run of duration 100 ps. Position and height of the two peaks are in agreement with previous numerical studies <sup>51</sup> performed at the same temperature and are compatible with experimental results <sup>52,53</sup> obtained at _T_ exp = 373 K. The green and purple curves, on the other hand, report NVT results for two different values of the friction coefficient _ν_ obtained from 50 ps long simulations. As expected, within noise, this static property is independent of the choice of the friction and identical to the NVE output. Figure 6 shows the velocity autocorrelation function obtained from the constant energy run. Both the characteristics of this curve and the diffusion coefficient obtained integrating the result over time (shown as the red curve in Figure 7) are in very good agreement with previous numerical results. <sup>54</sup> In particular, our computed value of the NVE diffusion is equal to 5 _._ 37 _±_ 0 _._ 16 cm <sup>2</sup> s <sup>_−_</sup> <sup>1</sup> which agrees with the nu merical results reported in Ref. 51 and with the experimental results reported in Ref. 55 for the temperature of _T_ = 434 K at which the simulations are performed. Figure 7 shows also the value of the diffusion coefficients computed in NVT simulations with different values of the friction coefficients. In this case, the result naturally depends on the choice of _ν_, but we observe that, again as expected, it approaches the reference NVE for small friction further illustrating the reliability of our canonical MaZe. In the NVT ensemble, the number of iterations to converge the calculation of the electronic density is also affected by the choice of _ν_ . In Figure 8 the path to convergence for a typical run is shown for two different values of the friction coefficient: _ν_ = 10 <sup>_−_</sup> <sup>3</sup> au, in purple, and _ν_ = 10 <sup>_−_</sup> <sup>5</sup> au, in green, and compared with the NVE result, in red. The trends in Figure 8 indicate that the increase in the number of iterations necessary to solve the equation of the constraints with increasing _ν_ is mainly due to a difference in the value of the maximum component of the constraints at the start of the iterative loop. Since the thermostat only affects the dynamics of the physical degrees of freedom, this depends on the fact that the provisional value of the electronic coefficients used to initialize the SHAKE routine at each timestep, is a less accurate first guess for higher values of the ionic friction. Indeed, once the initial penalty associated to the violation of the constraint at zero iteration is absorbed, typically in one Newton-Raphson step, the speed 1 10 <sup>-2</sup> 10 <sup>-4</sup> 10 <sup>-6</sup> 10 <sup>-8</sup> 10 <sup>-10</sup> 10 <sup>-12</sup> Perrot Solid Na STD-SHAKE LCG-SHAKE 1 10 <sup>-2</sup> 10 <sup>-4</sup> 10 <sup>-6</sup> 10 <sup>-8</sup> 10 <sup>-10</sup> 10 <sup>-12</sup> Thomas-Fermi-von Weizsacker Solid Na STD-SHAKE LCG-SHAKE Tolerance Tolerance 0 10 20 30 40 50 60 70 Iteration Thomas-Fermi-von Weizsacker Liquid Na 0 50 100 150 200 250 Iteration Perrot Liquid Na 1 10 <sup>-2</sup> 10 <sup>-4</sup> 10 <sup>-6</sup> 10 <sup>-8</sup> 10 <sup>-10</sup> 10 <sup>-12</sup> STD-SHAKE LCG-SHAKE 1 10 <sup>-2</sup> 10 <sup>-4</sup> 10 <sup>-6</sup> 10 <sup>-8</sup> 10 <sup>-10</sup> 10 <sup>-12</sup> STD-SHAKE LCG-SHAKE Tolerance Tolerance 0 50 100 150 200 Iteration 0 200 400 600 800 1000 1200 1400 Iteration FIG. 2. Total number of iterations to reach convergence for Newton-Raphson solution of the equation of constraints via standard SHAKE and LCG-SHAKE algorithms. In the LCG-SHAKE case the horizontal (parallel to the _x_ -axis) segments represent the number of linear CG iterations used to solve the linearized equation of the constraints, as the values on the _y_ -axis refers to the Newton-Raphson iterations. of convergence becomes comparable with that of NVE. Furthermore, even for large values of _ν_, the total number of iterations to convergence remains relatively small. We conclude this section by benchmarking LCGSHAKE MaZe against standard Born-Oppenheimer dynamics, based on nonlinear conjugate-gradient (NLCG) minimization. <sup>56</sup> Tests are particularly focused on the time-reversibility properties of the algorithms and relative efficiency of the two approaches. Note however that for Born-Oppenheimer dynamics we have used a simple textbook implementation of the NLCG algorithm. The initial density for NLCG is taken at each timestep to be the final density of the last timestep, thus no extrapolation was performed. Similarly, no preconditioning of the NLCG was used. The comparison is performed on a set of simulations of _N_ = 16 particles of liquid sodium ( _L_ = 8 _._ 68 <sup>˚</sup> A) using the Perrot kinetic energy functional. <sup>29,44</sup> The low number of particles has been chosen to ensure that possible numerical errors arising in the simulations are mainly due to the propagation algorithm and not to the computation of the forces. Time reversibility of the algorithms is tested as follows: Starting from the same initial configuration, a _T_ = 10 ps simulation is performed using either nonlinear conjugate-gradient Born-Oppenheimer or MaZe to enforce the minimum energy condition (forward trajectory). The velocities of the final configuration of the forward runs are then reversed and a new 10 ps simulation is performed (backward trajectory). Along the forward and backward trajectories, positions of the particles are recorded every 10 fs. Average root mean square displacements normalized to the length of the simulation box are computed for corresponding configurations along backward and forward trajectories for the two algorithms. The convergence threshold of the minimum condition is set to a very stringent value (residual lower than 10 <sup>_−_</sup> <sup>10</sup> au for the modulus of the maximum component of the derivative of the energy, compare with Tables I and II). Results for LCG-SHAKE MaZe and NLCG BornOppenheimer with this threshold are shown as the red and blue open squares symbols, respectively, in Figure 9. The figure shows that results for the two algorithms are very similar with this strict tolerance. The slow violation of time reversibility observed can be attributed to the numerical error associated to the finite timestep and round off that are amplified by the Lyapunov instability. With this strong convergence requirement, however, the average time needed by NLCG to solve the minimiza <u>1</u> RMSD( _t_ ) = _NL_ _N_ _i_ =1 ~~�~~ <u>�</u> _r_ _i_ <sup>+</sup> _i_ <sup>_−_</sup> <sup>(</sup> <sup>_t_</sup> <sup>)</sup> _i_ <sup>+(</sup> <sup>_T_</sup> <sup>_−_</sup> <sup>_t_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_r_</sup> _i_ <sup>_−_</sup> <u>�2</u> _,_ (40) ��� �� �� �� <mark>��</mark> ��������������� <mark>��</mark> ������������ <mark>��</mark> ����� ������ ����� NVT, ν = 10 <sup>-3</sup> au NVT, ν = 10 <sup>-5</sup> au NVE ����� 2.5 2 1.5 1 0.5 0 ���� ����� ����� ���� ���� ����� ���� ���� ���� ���� ������ ���� ������ ������������������������� FIG. 3. Average wall time per timestep comparison between Standard SHAKE and LCG-SHAKE algorithms for different kinetic energy functionals and different thermodynamic states. 400 350 300 250 200 150 100 50 0 <u>TFvW</u> 0 100 200 300 400 500 600 Number of Particles (x 10 <sup>3</sup> ) FIG. 4. Performance scaling of a system of solid sodium with TFvW kinetic energy functional with respect to the number of particles for the LCG-SHAKE algorithm. tion problem is ten times larger than the one needed by MaZe to solve the equation of the constraints. Table I reports timings for LCG-SHAKE for different tolerances. For each user-chosen tolerance, we report not only the observed timing but also the actual residual achieved. The final residual can be significantly lower than the target tolerance as only one Newton-Raphson (NR) iteration can lead to high convergence. The average number of NR iterations is also reported in this table. For comparison, Table II reports the timings for our textbook implementation of the NLCG method. In order to allow for a one to one correspondence with the 0 1 2 3 4 5 6 7 8 9 r (A) FIG. 5. Comparison between radial distribution functions from NVT runs performed using the algorithm in Ref. 50 for a Langevin thermostat for different values of the friction parameters _ν_ . The NVE result is obtained from a 100 ps simulation of _N_ = 128 particles of sodium at _T_ = 434 K. The other values of _ν_ are obtained from 50 ps NVT simulations of _N_ = 128 particles of sodium at _T_ <sup>_∗_</sup> = 434 K. 1 0.8 0.6 0.4 0.2 0 -0.2 -0.4 0 0.5 1 1.5 2 t (ps) FIG. 6. Normalized velocity autocorrelation function for a 100 ps NVE simulation of _N_ = 128 particles of liquid sodium at _T_ = 434 K. LCG-SHAKE case, the NLCG tolerance is set to the observed residual in Table I. To obtain comparable average times per timestep along the simulation, the tolerance of the nonlinear conjugate gradient has to be relaxed by nine orders of magnitude compared the lowest tolerance achieved with LCG-SHAKE. NLCG runs at low convergence, however, lead to dramatic effects and, in particular, the algorithm suffers an essentially complete loss of time reversibility as shown in Figure 9, where the blue open circles shows that the average distance between 12 10 8 6 4 2 0 NVT, ν = 10 <sup>-3</sup> au NVT, ν = 10 <sup>-5</sup> au NVE 0 0.5 1 1.5 2 t (ps) TABLE I. Performance assessment for MaZe using LCGSHAKE algorithm for the solution of the constraint equation. The user-chosen tolerance of the iterative procedure is reported in the second column, while in the third column the actual residual on the constraints after the self-consistent cycle is shown. Wall timings for a single MD step on a single core (AMD Ryzen 7 5800X CPU) and number of NewtonRaphson iterations to reach convergence are reported in the fourth and fifth column respectively. <u>Method</u> <u>Tol</u> <u>( au)</u> <u>Res</u> <u>( au)</u> <u>Time</u> <u>(s)</u> <u>NR</u> <u>Iters</u> LCG-SHAKE 10 <sup>_−_</sup> <sup>1</sup> 1 _._ 4 _×_ 10 <sup>_−_</sup> <sup>4</sup> 3 _._ 3 _×_ 10 <sup>_−_</sup> <sup>2</sup> 1 10 <sup>_−_</sup> <sup>3</sup> 2 _._ 0 _×_ 10 <sup>_−_</sup> <sup>6</sup> 5 _._ 8 _×_ 10 <sup>_−_</sup> <sup>2</sup> 1 10 <sup>_−_</sup> <sup>5</sup> 1 _._ 3 _×_ 10 <sup>_−_</sup> <sup>6</sup> 8 _._ 0 _×_ 10 <sup>_−_</sup> <sup>2</sup> 1 10 <sup>_−_</sup> <sup>7</sup> 5 _._ 0 _×_ 10 <sup>_−_</sup> <sup>9</sup> 1 _._ 5 _×_ 10 <sup>_−_</sup> <sup>1</sup> 2 10 <sup>_−_</sup> <sup>10</sup> 2 _._ 2 _×_ 10 <sup>_−_</sup> <sup>11</sup> 2 _._ 7 _×_ 10 <sup>_−_</sup> <sup>1</sup> 3 FIG. 7. Comparison between diffusion coefficients from NVT runs for different values of the friction parameter _ν_ . The NVE result is obtained from a 100 ps simulation of _N_ = 128 particles of Na at _T_ = 434 K. The other values of _ν_ are obtained from 50 ps NVT simulations of _N_ = 128 particles of Na at _T_ <sup>_∗_</sup> = 434 K. TABLE II. Performance assessment of standard BornOppenheimer MD using nonlinear conjugate gradient algorithm. Comparison between the methods is carried out by setting the same tolerance (second column) for the nonlinear conjugate gradient method as the residual on the constraints shown in Table I. Wall timings for a single MD step for the same system used for tests reported in Table I are reported in the last column. An additional high tolerance is shown in the first line where the performances in terms of wall time are comparable between the two methods. Note that MaZe algorithm is faster than NLCG even when the precision is nine order of magnitudes higher than standard nonlinear conjugate gradient. <u>Method</u> <u>Tol</u> <u>( au)</u> <u>Time</u> <u>(s)</u> 8 _._ 1 _×_ 10 <sup>_−_</sup> <sup>2</sup> 3 _._ 8 _×_ 10 <sup>_−_</sup> <sup>1</sup> 8 _._ 8 _×_ 10 <sup>_−_</sup> <sup>5</sup> 9 _._ 9 _×_ 10 <sup>_−_</sup> <sup>1</sup> 10 <sup>2</sup> 1 10 <sup>-2</sup> 10 <sup>-4</sup> 10 <sup>-6</sup> 10 <sup>-8</sup> 10 <sup>-10</sup> 10 <sup>-12</sup> NVT, ν = 10 <sup>-3</sup> NVT, ν = 10 <sup>-5</sup> NVE NLCG 1 _._ 3 _×_ 10 <sup>_−_</sup> <sup>6</sup> 2.3 4 _._ 4 _×_ 10 <sup>_−_</sup> <sup>9</sup> 3.7 1 _._ 6 _×_ 10 <sup>_−_</sup> <sup>11</sup> 4.6 Tolerance 0 100 200 300 400 500 600 700 Iteration FIG. 8. Total number of iterations to reach convergence for NVT simulation with LCG-SHAKE for different values of the friction parameter _ν_ . The horizontal (parallel to the _x_ -axis) segments represent the number of linear CG iterations used to solve the linearized equation of the constraints, as the values on the _y_ -axis refers to the Newton-Raphson iterations. Results are for a typical minimization path along a simulation. time-reversed configurations quickly reaches the box dimensions. We also report in Figure 9, the RMSD for an LCG-SHAKE run with intermediate tolerance, corresponding to only one NR iteration per timestep. It can be seen that such a trajectory is stable, with an RMSD that parallels the RMSD with the lowest tolerance. Essentially identical results are obtained for energy conservation in the different runs. Figure 10 shows the MaZe (red curve with open squares) and NLCG (blue curve with open squares) energies obtained with the same timestep. Also in this case, when the same stringent convergence threshold is imposed, the results for the two algorithms are superimposed. However, a significant drift in the ionic energy appears as shown (blue curve with open circles) when the convergence in NLCG is relaxed to match the timings of MaZe. V. CONCLUSIONS This work generalizes previous results for OFDFT _first-principles_ dynamics using the MaZe approach in two important ways. Firstly, a detailed derivation of the evolution equations has been presented, highlighting, in par 1 0.01 0.0001 1x10 <sup>-6</sup> 1x10 <sup>-8</sup> 1x10 <sup>-10</sup> 1x10 <sup>-12</sup> 1x10 <sup>-14</sup> LCG-SHAKE: Tol 10 <sup>-10</sup> LCG-SHAKE: Tol 10 <sup>-10</sup> NLCG: Tol 1.6 x 10 <sup>-11</sup> LCG-SHAKE: Tol 10 <sup>-5</sup> NLCG: Tol 8.1 x 10 <sup>-2</sup> NLCG: Tol 8.1 x 10 <sup>-2</sup> 0 2 4 6 8 10 Time (ps) FIG. 9. Test of time-reversibility properties of MaZe (LCG-SHAKE, curves with red symbols) with respect to standard BornOppenheimer alternatives, where the minimization of the energy functional is performed with standard nonlinear conjugategradient (NLCG, curves with blue symbols) techniques with different convergence thresholds. The test is based on comparing configurations along a forward- and a backward-in-time trajectory and comparing the average RMSD for corresponding configurations (see Eq. (40) and relative discussion). The upper limit on the _y_ -axis represents an estimate of the maximum allowed _~~√~~_ valuedistant from each other).of the RMSD consideringAn intermediate threshold of 10the presence of the PBCs <sup>_−_</sup> <sup>5</sup> (andfor MaZe is also presented (red line open triangles) to demonstratetherefore the fact that two particles are never more than <sup>_<u>L</u>_</sup> 2 <u>3</u> the levels of time reversibility and stability attainable with intermediate tolerances. ticular, the consequences of the complex nature of the Lagrange multipliers associated with the evolution of the coefficients of the expansion of the electronic density in the plane-wave basis. The OFDFT MaZe dynamical system can be integrated combining standard MD algorithms for the evolution of the ions with the SHAKE method to enforce the minimum condition on the electronic degrees of freedom. Efficient implementation of the constraints for generic forms of the kinetic and exchangecorrelation functionals, however, is highly nontrivial. We have shown how to achieve linear scaling in the standard implementation of SHAKE for GGA functionals, and introduced an original approach that enables Ωlog Ω scaling of the method for arbitrary forms of the kinetic and exchange-correlation functional, including nonlocal expressions where standard SHAKE fails. The accuracy and efficiency of both algorithms has been demonstrated via simulations of a challenging benchmark system, solid and liquid sodium. Use of the MaZe approach beyond constant energy simulations has also been illustrated, presenting results for NVT simulations of the same system. An in-depth comparison of OFDFT MaZe with alternative state-of-the-art approaches, in particular XLBOMD and advanced implementations of NLCG Born Oppenheimer dynamics including preconditioning and smart initialization, will be performed in future studies. Here we make some general preliminary comments. Numerically, when compared to the original Car-Parrinello dynamics, MaZe has the advantage of enabling the use of a timestep consistent with the ion dynamics instead of the shorter timesteps typically used in Car-Parrinello MD. It also enforces full adiabatic separation via the limit of zero mass for the auxiliary variables. Together with the fact that SHAKE efficiently converges the minimum condition essentially to numerical precision, this prevents energy drifts and avoids the need for thermostats to stabilize the dynamics. Even though the overall approach is different, MaZe shares some similarities the recent XLBOMD method, such as the presence of a limit of the fictitious mass going to zero. However, in XL-BOMD an extra dissipation of the dynamics of the electronic dofs is needed in practice and the accuracy of propagating the electronic dofs still remains dependent on the integration timestep _δt_ in XL-BOMD, going as _δt_ <sup>_−_</sup> <sup>2</sup> . <sup>57</sup> MaZe also avoids the numerical cost of computing the kernel involved in XL-BOMD. The advantage over Car-Parrinello and XL-BOMD comes at the non-trivial cost of the computation of the Lagrange multipliers. The calculations 7.5x10 <sup>-6</sup> 5x10 <sup>-6</sup> 2.5x10 <sup>-6</sup> 0 -2.5x10 <sup>-6</sup> -5x10 <sup>-6</sup> -7.5x10 <sup>-6</sup> NLCG: Tol 1.6 x 10 <sup>-11</sup> NLCG: Tol 8.1 x 10 <sup>-2</sup> LCG-SHAKE: Tol 10 <sup>-10</sup> LCG-SHAKE: Tol 10 <sup>-5</sup> 0 2 4 6 8 10 Time (ps) FIG. 10. Test of energy-conservation properties of MaZe (LCG-SHAKE, curves with red symbols) with respect to standard Born-Oppenheimer alternatives, where the minimization of the energy functional is performed with standard nonlinear conjugate gradient (NLCG, curves with blue symbols) techniques with different convergence thresholds. An intermediate threshold of 10 <sup>_−_</sup> <sup>5</sup> for MaZe is also presented (red line open triangles) to prove the stability and energy conservation of the algorithm for intermediate tolerances. The total energy on the _y_ -axis is shifted by the value at the beginning of the simulation. Results are for the forward trajectories only. presented in this work, however, show that this numerical cost can be controlled and remains quasilinear with respect to the system size. The developments presented in this paper, and the remarkable efficiency of the algorithms introduced, then open the way to applications of MaZe to more realistic OFDFT models of condensedphase systems and set the stage to the future extension of the approach to Kohn-Sham based DFT. ACKNOWLEDGMENTS The authors would like to thank Giovanni Ciccotti, Benjamin Rotenberg and Mathieu Salanne for fruitful discussions. Part of this work was supported under the European Union’s Horizon 2020 research and innovation programme under Grant Agreement No. 676531 (project E-CAM). R.V. would also like to acknowledge hospitality at CECAM, where this work started. DATA AVAILABILITY STATEMENT The data that support the findings of this study together with the source code used for the numerical simulations are available from the corresponding author upon reasonable request. Appendix A: Expressions of forces and Hessians and Ωlog Ω scaling for matrix-vector multiplications of standard GGA functionals The calculations in this paper require the value of the energy functional and its first and second derivatives. The manipulations presented in the main text are for the most part general but in our specific implementation we exploit the lib xc library to obtain these quantities. lib ~~x~~ c takes as input the electronic density and its derivatives in real space and returns the value of _ϵ_, the energy per unit particle, and its derivatives in real space. The library employs the electronic density _n_ ( _r_ ) and the modulus square of its gradient _ς_ ( _r_ ) = _|∇n_ ( _r_ ) _|_ <sup>2</sup> as independent “variables”. This is the general formulation for a GGA functional. The Hartree contribution to first and second derivatives is trivial, the most problematic term being the kineticexchange-correlation contribution that we adress first. The kinetic-exchange-correlation energy is returned as _E_ KXC[ _n_ ( _r_ ) _, ς_ ( _r_ )] = <sup><u>Ω</u></sup> _N_ D _r_ _ε_ KXC - _n_ ( _r_ ) _, ς_ ( _r_ )� _,_ (A1) where _ND_ is the number of points in the direct space grid used to represent the discretized density and _ε_ KXC - _n_ ( _r_ ) _, ς_ ( _r_ )� the local kinetic-exchange-energy per unit volume. The library also outputs the derivatives of the functional with respect to the density and to the modulus square of the gradients: _υ_ KXC <sup>_n_</sup> = <sup>_∂ε_</sup> <sup>KXC</sup> - _n_ ( _r_ ) _, ς_ ( _r_ ) - _n_ ( _r_ ) _, ς_ ( _r_ ) ; _∂n_ ( _r_ ) (A2) _υ_ KXC <sup>_ς_</sup> = <sup>_∂ε_</sup> <sup>KXC</sup> - _n_ ( _r_ ) _, ς_ ( _r_ ) - _n_ ( _r_ ) _, ς_ ( _r_ ) _._ _∂ς_ ( _r_ ) Finally, lib xc provides also the following derivatives, associated to the Hessian of the functional _f_ KXC <sup>_nn_</sup> = <sup>_∂_</sup> <sup>2</sup> <sup>_ε_</sup> <sup>KXC</sup> - _n_ ( _r_ ) _, ς_ ( _r_ ) ; _∂_ <sup>2</sup> _n_ ( _r_ ) - _n_ ( _r_ ) _, ς_ ( _r_ ) _f_ KXC <sup>_nς_</sup> = <sup>_∂_</sup> <sup>2</sup> <sup>_ε_</sup> <sup>KXC</sup> - _n_ ( _r_ ) _, ς_ ( _r_ ) ; _∂n_ ( _r_ ) _∂ς_ ( _r_ ) - _n_ ( _r_ ) _, ς_ ( _r_ ) (A3) _f_ KXC <sup>_ςς_</sup> = <sup>_∂_</sup> <sup>2</sup> <sup>_ε_</sup> <sup>KXC</sup> - _n_ ( _r_ ) _, ς_ ( _r_ ) _._ _∂_ <sup>2</sup> _ς_ ( _r_ ) - _n_ ( _r_ ) _, ς_ ( _r_ ) All derivatives above are defined per unit volume. The lib ~~x~~ c outputs can be easily combined to obtain the first and second derivatives of the kinetic and exchange correlation energy functional with respect to the Fourier coefficients of the electronic densities (see sections III A and III B). As an example, we describe in some detail the calculation of the first derivative of the kinetic and exchange functional. We have: _<u>∂E</u>_ <u>KXC</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ <u>Ω</u> = _ND_ <u>Ω</u> = _ND_ <u>Ω</u> = _ND_ _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ - _<u>∂ε</u>_ <u>KXC(</u> _<u>r</u>_ <u>)</u> _∂n_ ( _r_ ) _r_ _r_ _r_ - _<u>∂n</u>_ <u>(</u> _<u>r</u>_ <u>)</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ _<u>∂ε</u>_ <u>KXC(</u> _<u>r</u>_ <u>)</u> (A4) _<u>∂n</u>_ <u>(</u> _<u>r</u>_ <u>)</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ _<u>∂n</u>_ <u>(</u> _<u>r</u>_ <u>)</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ + <sup>_<u>∂ε</u>_</sup> <sup><u>KXC(</u></sup> <sup>_<u>r</u>_</sup> <sup><u>)</u></sup> _∂ς_ ( _r_ ) + <sup>_<u>∂ε</u>_</sup> <sup><u>KXC(</u></sup> <sup>_<u>r</u>_</sup> <sup><u>)</u></sup> _<u>∂ς</u>_ <u>(</u> _<u>r</u>_ <u>)</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ _<u>∂ς</u>_ <u>(</u> _<u>r</u>_ <u>)</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ _G_ _α_ KXC <sup>_n_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) +</sup> <sup>_<u>∂ς</u>_</sup> <sup><u>(</u></sup> <sup>_<u>r</u>_</sup> <sup><u>)</u></sup> _∂n_ ˜ <sup>_⋆_</sup> KXC <sup>_ς_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> _υ_ <sup>_n_</sup> _∂n_ ˜ <sup>_⋆_</sup> _,_ _υ_ <sup>_ς_</sup> where the derivatives of the kinetic-exchange-correlation kernel have been defined in Eqs. (A2). The derivatives of _n_ ( _r_ ) and _ς_ ( _r_ ) with respect to the coefficients of the electronic density in reciprocal space can be easily computed. From the definition of the Fourier transform of the electronic density, we have _<u>∂n</u>_ <u>(</u> _<u>r</u>_ <u>)</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ = exp[ _−_ i _G_ _α ·_ _r_ ] _._ (A5) The derivative of _ς_ ( _r_ ) can be computed using the chain rule _<u>∂ς</u>_ <u>(</u> _<u>r</u>_ <u>)</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ _<u>∂ς</u>_ <u>(</u> _<u>r</u>_ <u>)</u> = _∂_ _∇_ _n_ ( _r_ ) <sup>_·_</sup> <sup>_<u>∂</u>_</sup> _∂_ <sup>_<u>∇</u>_</sup> _n_ ˜ <sup>_<u>n⋆</u>_</sup> _G_ <sup><u>(</u></sup> _α_ <sup>_<u>r</u>_</sup> <sup><u>)</u></sup> _G_ _α_ _∂n_ ˜ <sup>_⋆_</sup> _._ (A6) Above, the gradient of the density is given by _,_ (A7) _∇_ _n_ ( _r_ ) = _NG_ - _n_ ˜ _G_ _β_ exp[i _G_ _β_ _·_ _r_ ]i _G_ _β_ _−_ _n_ ˜ <sup>_⋆_</sup> _G_ _β_ <sup>exp[</sup> <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_β_</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>]i</sup> <sup>_G_</sup> <sup>_β_</sup> - _n_ ˜ _G_ _β_ exp[i _G_ _β_ _·_ _r_ ]i _G_ _β_ _−_ _n_ ˜ <sup>_⋆_</sup> _G_ _β_ =1 taking the derivative of this quantity with respect to _n_ ˜ <sup>_⋆_</sup> _G_ _α_ <sup>,</sup> <sup>and</sup> <sup>recalling</sup> <sup>that</sup> <sup>_ς_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) =</sup> <sup>_|_</sup> <sup>_∇_</sup> <sup>_n_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_|_</sup> <sup>2,</sup> <sup>Eq.</sup> <sup>(A6)</sup> <sup>can</sup> <sup>then</sup> <sup>be</sup> recast as _<u>∂ς</u>_ <u>(</u> _<u>r</u>_ <u>)</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ = _−_ 2 _∇_ _n_ ( _r_ ) _·_ i _G_ _α_ exp[ _−_ i _G_ _α ·_ _r_ ] _._ (A8) Substituting Eqs. (A5) and (A8) in Eq. (A4) we get _<u>∂E</u>_ <u>KXC</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ <u>Ω</u> = _ND_ _r_ KXC <sup>_n_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) exp[</sup> <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>]</sup> <sup>_−_</sup> <sup><u>Ω</u></sup> _υ_ <sup>_n_</sup> _ND_ _·_ i _G_ _α._ (A9) 2 _r_ _υ_ <sup>_ς_</sup> KXC <sup>_ς_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_∇_</sup> <sup>_n_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) exp[</sup> <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α ·_</sup> <sup>_r_</sup> <sup>]</sup> The expression above can be conveniently rewritten as the sum of two Fourier transforms: KXC <sup>_n_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> _<u>∂E</u>_ <u>KXC</u> _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ <u>Ω</u> = _ND_ FT - _υ_ <sup>_n_</sup> _−_ 2FT - _υ_ <sup>_ς_</sup> KXC <sup>_ς_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_∇_</sup> <sup>_n_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> _·_ i _G_ _α_ _,_ (A10) and computed numerically via discrete Fourier transforms (FT[ _•_ ] in the equation above) with an Ωlog Ωcost. The second derivatives of the kinetic-exchange-correlation functional are obtained by differentiation of the result above and using, where appropriate, the definitions in Eqs. (A3) and the chain rule for the derivatives. For example, we have _<u>∂</u>_ <sup>2</sup> _<u>E</u>_ <u>KXC</u> <u>Ω</u> = _∂n_ ˜ _G_ _β_ _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ _ND_ - exp[i _G_ _β_ _·_ _r_ ] exp[ _−_ i _G_ _α ·_ _r_ ] _r_ (A11) _f_ <sup>_nn_</sup> ( _r_ ) _−_ 2i _∂ln_ ( _r_ )( _−G_ <sup>_l_</sup> _α_ <sup>_l_</sup> <sup>)</sup> <sup>_f nς_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) + 2</sup> <sup>_Gl_</sup> _β_ <sup>_l_</sup> _β_ <sup>_Gm_</sup> _α_ _α_ _×_ <sup>_l_</sup> _β_ <sup>+</sup> <sup>_G_</sup> _α_ <sup>_l_</sup> - - <sup>�</sup> _υ_ <sup>_ς_</sup> ( _r_ ) _δlm_ + 2 _∂ln_ ( _r_ ) _∂mn_ ( _r_ ) _f_ <sup>_ςς_</sup> ( _r_ ) _._ In the equation above, _∂ln_ ( _r_ ) indicates the derivative of the density with respect to the Cartesian component _l_ of the position _r_ and repeated Latin indexes are summed over. For future convenience, we define the functions Ξ( _r_ ) _≡_ _f_ <sup>_nn_</sup> ( _r_ ); Φ <sup>_l_</sup> ( _r_ ) _≡_ 2 _∂ln_ ( _r_ ) _f_ <sup>_nς_</sup> ( _r_ ); (A12) Ψ <sup>_lm_</sup> ( _r_ ) _≡_ 2 - _υ_ <sup>_ς_</sup> ( _r_ ) _δlm_ + 2 _∂ln_ ( _r_ ) _∂mn_ ( _r_ ) _f_ <sup>_ςς_</sup> ( _r_ ) - _,_ to rewrite Eq. (A11) as _<u>∂</u>_ <sup>2</sup> _<u>E</u>_ <u>KXC</u> _∂n_ ˜ _G_ _β_ _∂n_ ˜ <sup>_⋆_</sup> _G_ _α_ _α_ <sup>_l_</sup> <sup>)Φ</sup> <sup>_l_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) +</sup> <sup>_Gl_</sup> _β_ <u>Ω</u> = _ND_ _r_ <sup>_l_</sup> _β_ <sup>_Gm_</sup> _α_ <sup>_m_</sup> _α_ <sup>Ψ</sup> <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> _._ (A13) exp[i _G_ _β_ _·_ _r_ ] exp[ _−_ i _G_ _α ·_ _r_ ] _×_ Ξ( _r_ ) + i( _G_ <sup>_l_</sup> _β_ <sup>_l_</sup> _β_ <sup>_−_</sup> <sup>_G_</sup> _α_ <sup>_l_</sup> The second derivatives with respect to different combination of coefficients and complex conjugates of coefficients that are needed in the calculation of the matrix Σ <sup>_†_</sup> = Σ <sup>_†_</sup> = Σ <sup>_†_</sup> Hart <sup>+Σ</sup> <sup>_†_</sup> KXC <sup>can be obtained from the expression above using</sup> the rules of complex conjugation. While the Hartree term is diagonal in the density coefficients when using plane waves �Σ <sup>_†_</sup> Hart _α,β_ <sup>=</sup> �Σ <sup>_†_</sup> Hart �Σ <sup>_†_</sup> _α,NG_ + _β_ <sup>=</sup> _|_ _G_ <sup><u>4</u></sup> <sup>_<u>π</u>_</sup> _α_ <sup><u>Ω</u></sup> _|_ (A14) _|_ _G_ <sup><u>4</u></sup> <sup>_<u>π</u>_</sup> _α_ <sup><u>Ω</u></sup> _|_ <sup>2</sup> <sup>_δα,β,_</sup> and so the matrix-vector product is trivial, the final result for the matrix Σ <sup>_†_</sup> matrix-vector product is trivial, the final result for the matrix Σ <sup>_†_</sup> KXC <sup>is</sup> <sup>given</sup> <sup>by</sup> �Σ <sup>_†_</sup> KXC� _α,β_ <sup>=</sup> <u>Ω</u> - exp[i _G_ _β_ _·_ _r_ ] exp[ _−_ i _G_ _α ·_ _r_ ] _×_ �Ξ( _r_ ) + i( _G_ <sup>_l_</sup> _β_ <sup>_−_</sup> <sup>_G_</sup> _α_ <sup>_l_</sup> <sup>)Φ</sup> <sup>_l_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) +</sup> <sup>_G_</sup> _β_ <sup>_l_</sup> <sup>_m_</sup> _α_ <sup>Ψ</sup> <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> _α_ <sup>_l_</sup> <sup>)Φ</sup> <sup>_l_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) +</sup> <sup>_G_</sup> _β_ <sup>_l_</sup> _r_ _r_ exp[i _G_ _β_ _·_ _r_ ] exp[ _−_ i _G_ _α ·_ _r_ ] _×_ ; _β_ <sup>_l_</sup> <sup>_Gm_</sup> _α_ Ξ( _r_ ) + i( _G_ <sup>_l_</sup> _β_ <sup>_l_</sup> _β_ <sup>_−_</sup> <sup>_G_</sup> _α_ <sup>_l_</sup> KXC <u>Ω</u> _α,β_ <sup>=</sup> _ND_ _α_ <sup>_l_</sup> <sup>)Φ</sup> <sup>_l_</sup> <sup>(</sup> <sup>_r_</sup> <sup>))</sup> <sup>_−_</sup> <sup>_G_</sup> _β_ <sup>_l_</sup> (A15) Ξ( _r_ ) _−_ i( _G_ <sup>_l_</sup> �Σ <sup>_†_</sup> KXC �Σ <sup>_†_</sup> - <u>Ω</u> _α,NG_ + _β_ <sup>=</sup> _ND_ <u>Ω</u> _α,NG_ + _β_ <sup>=</sup> _ND_ exp[ _−_ i _G_ _β_ _·_ _r_ ] exp[ _−_ i _G_ _α ·_ _r_ ] _×_ _._ <sup>_m_</sup> _α_ <sup>Ψ</sup> <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> _β_ <sup>_l_</sup> <sup>_Gm_</sup> _α_ <sup>_l_</sup> _β_ <sup>+</sup> <sup>_Gl_</sup> which is more complicated to treat. Considering the three terms in the square brackets separately and starting from the first one, the matrix-vector product can however be written <u>Ω</u> _ND_ _NG_ _β_ =1 _r_ _NG_ _β_ =1 _r_ <u>Ω</u> _ND_ (A16) exp[i _G_ _β_ _·_ _r_ ] exp[ _−_ i _G_ _α ·_ _r_ ]Ξ( _r_ ) _γ_ _G_ _β_ exp[ _−_ i _G_ _β_ _·_ _r_ ] exp[ _−_ i _G_ _α ·_ _r_ ]Ξ( _r_ ) _γ_ _G_ <sup>_⋆_</sup> _β_ �( _G_ _α_ ) _,_ = 2Ω _r_ exp[ _−_ i _G_ _α ·_ _r_ ]Ξ( _r_ )IFT[ _γ_ ]( _r_ ) = 2ΩFT �Ξ( _r_ )IFT[ _γ_ ]( _r_ ) where FT[ _•_ ] denotes a discrete Fourier transform and IFT[ _•_ ] an inverse discrete Fourier transform. Note that the discrete inverse Fourier transform is defined including the term _G_ = _G_ 0 = (0 _,_ 0 _,_ 0), which is excluded from the constrained degrees of freedom in our approach. In the numerical implementation of the Fourier transform above, we thus set _γ_ _G_ 0 = 0 to include this term in the sum over the vectors in reciprocal space. Using Fast Fourier Transforms these operations can thus be done with Ωlog Ωscaling. Similar manipulations show that the same is true also for the other two terms. Appendix B: Ωlog Ω scaling for matrix-vector multiplications of nonlocal functionals For kinetic energy functionals with a nonlocal kernel, we consider the form discussed by Wang et al. for densityindependent kernels <sup>28</sup>, which we write in the more general form _r_ <sup>_′_</sup> _T_ K <sup>_f,g_</sup> = _C_ K _T_ K <sup>_f,g_</sup> _r_ _f_ - _n_ ( _r_ )� _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) _g_ - _n_ ( _r_ <sup>_′_</sup> )� _,_ (B1) - _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) _g_ where _CK_, is a constant, _f_ and _g_ are generic functions of the density (Wang et al. considered only powers, compare with Eq. (46) of Ref. 28) and _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) is the nonlocal kernel. Products of this form are conveniently expressed in Fourier space as _T_ K <sup>_f,g_</sup> = _C_ K _T_ K <sup>_f,g_</sup> _G_ _F_ - <sup>_⋆_</sup> ( _G_ ) _W_ �( _G_ ) _,_ _G_ <sup>�</sup> ( _G_ ) _,_ (B2) where _F_ <sup>�</sup> ( _G_ ), _G_ <sup>�</sup> ( _G_ ) and _W_ <sup>�</sup> ( _G_ ) indicates the Fourier transforms of the functions _f_ - _n_ ( _r_ )�, _g_ - _n_ ( _r_ )� and _w_ ( _r_ ), respec tively. Note that these Fourier transforms include the term _G_ = _G_ 0 = (0 _,_ 0 _,_ 0) and the sum extends from _−_ _G_ max to _G_ max. - _n_ ( _r_ ) - _n_ ( _r_ )� where _F_ <sup>�</sup> ( _G_ ), _G_ <sup>�</sup> ( _G_ ) and _W_ <sup>�</sup> ( _G_ ) indicates the Fourier transforms of the functions _f_ �, _g_ Let us begin by considering the first derivative of a kinetic energy functional of this nonlocal form. We have: _<u>∂T</u>_ <u>K</u> <sup>_f,g_</sup> _r_ <sup>_′_</sup> _<u>∂f</u>_ _∂n_ _<u>∂f</u>_ _∂n_ _r_ <sup>_′_</sup> _r_ _f_ - _n_ ( _r_ ) <u>K</u> _∂n_ ˜ <sup>_⋆_</sup> _∂n_ - _n_ ( _r_ <sup>_′_</sup> )� _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> <sup>_′_</sup> _r_ _r_ - _n_ ( _r_ )� _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> IFT[ _W_ <sup>�</sup> ( _G_ ) _G_ <sup>�</sup> ( _G_ )]( _r_ ) + _C_ K - _n_ ( _r_ )� _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) _g_ - _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> IFT[ _W_ <sup>�</sup> ( _G_ ) _G_ <sup>�</sup> ( _G_ )]( _r_ ) + _C_ K - _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) _g_ - _n_ ( _r_ <sup>_′_</sup> )� + _C_ K - _n_ ( _r_ <sup>_′_</sup> ) _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) <sup>_<u>∂g</u>_</sup> - _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> <sup>_′_</sup> _G_ _α_ = _C_ K = _C_ K IFT[ _W_ <sup>�</sup> <sup>_⋆_</sup> ( _G_ ) _F_ <sup>�</sup> ( _G_ )] <sup>_⋆_</sup> ( _r_ <sup>_′_</sup> ) _∂n_ <sup>_<u>∂g</u>_</sup> IFT[ _W_ <sup>�</sup> <sup>_⋆_</sup> ( _G_ ) _F_ <sup>�</sup> ( _G_ )] <sup>_⋆_</sup> ( _r_ <sup>_′_</sup> ) _∂n_ <sup>_<u>∂g</u>_</sup> - _n_ ( _r_ <sup>_′_</sup> )� _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> <sup>_′_</sup> )� _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> <sup>_′_</sup> _r_ <sup>_′_</sup> (B3) - _<u>∂f</u>_ _∂n_ - - <sup>�</sup> _n_ ( _r_ <sup>_′_</sup> ) ( _G_ _α_ ) - <sup>�</sup> ) ( _G_ _α_ ) ( _G_ _α_ ) + _C_ KFT IFT[ _W_ <sup>�</sup> <sup>_⋆_</sup> ( _G_ ) _F_ <sup>�</sup> ( _G_ )] <sup>_⋆_</sup> ( _r_ <sup>_′_</sup> ) _∂n_ <sup>_<u>∂g</u>_</sup> IFT[ _W_ <sup>�</sup> <sup>_⋆_</sup> ( _G_ ) _F_ <sup>�</sup> ( _G_ )] <sup>_⋆_</sup> ( _r_ <sup>_′_</sup> ) _∂n_ <sup>_<u>∂g</u>_</sup> = _C_ KFT - _n_ ( _r_ ) �IFT[ _W_ <sup>�</sup> ( _G_ ) _G_ <sup>�</sup> ( _G_ )]( _r_ ) As observed by Wang et al., the evaluation of this term - which only involves direct and inverse Fourier transforms - can be performed numerically with Ωlog Ωeffort. We now show that also the product of the matrix of second derivatives of the nonlocal kinetic energy with the _γ_ needed for the solution of our constraints (see also first part of this Appendix for GGA functionals) can be performed with the same numerical scaling. We start from _NG_ - _NG_ _β_ =1 Σ <sup>_†_</sup> _T_ Σ <sup>_†_</sup> _T_ _γ_ _G_ _β_ = _α,β_ _<u>∂</u>_ <sup>2</sup> _<u>f</u>_ _∂n_ <sup>2</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_β_</sup> <sup>_r_</sup> _γ_ _G_ _β_ _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) _g_ - _n_ ( _r_ <sup>_′_</sup> )� - _n_ ( _r_ <sup>_′_</sup> ) _r_ _r_ _r_ _r_ _r_ <sup>_′_</sup> _r_ <sup>_′_</sup> _r_ <sup>_′_</sup> _r_ <sup>_′_</sup> - _n_ ( _r_ )� _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> - _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> _NG_ _β_ =1 <u>K</u> _∂n_ ˜ _G_ _β_ _∂n_ ˜ <sup>_⋆_</sup> _<u>∂</u>_ <sup>2</sup> _<u>T</u>_ <u>K</u> <sup>_f,g_</sup> _G_ _α_ _γ_ _G_ _β_ = _C_ K + _C_ K + _C_ K + _C_ K _β_ =1 (B4) _<u>∂f</u>_ _∂n_ _<u>∂f</u>_ _∂n_ )� _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) <sup>_<u>∂g</u>_</sup> _β_ =1 - _n_ ( _r_ ) _∂n_ - - <sup>�</sup> - <sup>_NG_</sup> _n_ ( _r_ <sup>_′_</sup> ) _β_ =1 _e_ <sup>i</sup> <sup>_G_</sup> <sup>_β_</sup> <sup>_r_</sup> <sup>_′_</sup> _γ_ _G_ _β_ - - <sup>�</sup> - <sup>_NG_</sup> _n_ ( _r_ ) - <sup>�</sup> - <sup>_NG_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_β_</sup> <sup>_r_</sup> _γ_ _G_ _β_ - _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) <sup>_<u>∂g</u>_</sup> _∂n_ - _n_ ( _r_ <sup>_′_</sup> )� _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> <sup>_′_</sup> _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> <sup>_′_</sup> _∂n_ <sup>2</sup> _f_ - _n_ ( _r_ ) _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) <sup>_<u>∂</u>_</sup> <sup>2</sup> <sup>_<u>g</u>_</sup> - - <sup>�</sup> - <sup>_NG_</sup> _n_ ( _r_ <sup>_′_</sup> ) _β_ =1 _e_ <sup>i</sup> <sup>_G_</sup> <sup>_β_</sup> <sup>_r_</sup> <sup>_′_</sup> _γ_ _G_ _β_ where we have used the derivative of Eq. (B3) with respect to ˜ _n_ _G_ _β_ . Adding to this the second term of the matrix-vector _α,NG_ + _β_ <sup>_γ_</sup> _G_ <sup>_⋆_</sup> _G_ <sup>_⋆_</sup> _β_ <sup>and</sup> <sup>defining</sup> <sup>_γD_</sup> <sup>(</sup> <sup>_r_</sup> <sup>) = �</sup> <sup>_N_</sup> _β_ =1 <sup>_G_</sup> _G_ <sup>_⋆_</sup> _β_ <sup>= FT[</sup> <sup>_γ_</sup> <sup>](</sup> <sup>_r_</sup> <sup>)</sup> <sup>(where</sup> <sup>again,</sup> product <sup>�</sup> _β_ <sup>_N_</sup> =1 <sup>_G_</sup> �Σ <sup>_†_</sup> _T_ <sup>_N_</sup> _β_ =1 <sup>_G_</sup> <sup>_e_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_β_</sup> <sup>_r_</sup> <sup>_γ_</sup> <sup>_G_</sup> _β_ <sup>+ �</sup> _β_ <sup>_N_</sup> =1 <sup>_G_</sup> _β_ <sup>_N_</sup> =1 <sup>_G_</sup> <sup>_e−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_β_</sup> <sup>_r_</sup> <sup>_γ_</sup> _G_ <sup>_⋆_</sup> in the numerical implementation of the Fourier transform FT, we set _γ_ _G_ 0 = 0), we can rewrite the matrix-vector product as _NG_ _β_ =1 �Σ <sup>_†_</sup> _T_ _α,β_ <sup>_γ_</sup> <sup>_G_</sup> <sup>_β_</sup> <sup>+</sup> _NG_ _β_ =1 �Σ <sup>_†_</sup> _T_ _α,NG_ + _β_ <sup>_γ_</sup> _G_ <sup>_⋆_</sup> _G_ <sup>_⋆_</sup> _β_ <sup>=</sup> <sup>_C_</sup> <sup>K</sup> _<u>∂</u>_ <sup>2</sup> _<u>f</u>_ _∂n_ <sup>2</sup> _r_ _r_ <sup>_′_</sup> - _n_ ( _r_ )� _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> _γD_ ( _r_ ) _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) _g_ - _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> _γD_ ( _r_ ) _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) _g_ - _n_ ( _r_ <sup>_′_</sup> )� - _n_ ( _r_ <sup>_′_</sup> ) _r_ <sup>_′_</sup> _r_ <sup>_′_</sup> _r_ <sup>_′_</sup> _<u>∂f</u>_ _∂n_ _<u>∂f</u>_ _∂n_ _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) <sup>_<u>∂g</u>_</sup> _∂n_ + _C_ K + _C_ K + _C_ K _r_ _r_ _r_ - _n_ ( _r_ ) - _n_ ( _r_ <sup>_′_</sup> )� _γD_ ( _r_ <sup>_′_</sup> ) (B5) _γD_ ( _r_ ) _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) <sup>_<u>∂g</u>_</sup> - _n_ ( _r_ ) _∂n_ - _n_ ( _r_ <sup>_′_</sup> )� _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> <sup>_′_</sup> - _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> <sup>_′_</sup> _∂n_ <sup>2</sup> - _n_ ( _r_ <sup>_′_</sup> )� _γD_ ( _r_ <sup>_′_</sup> ) _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> <sup>_′_</sup> _._ _f_ - _n_ ( _r_ ) )� _w_ ( _r_ _−_ _r_ <sup>_′_</sup> ) <sup>_<u>∂</u>_</sup> <sup>2</sup> <sup>_<u>g</u>_</sup> - _γD_ ( _r_ <sup>_′_</sup> ) _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>_r_</sup> <sup>_′_</sup> _._ The structure of the four terms in the expression above is the same as that of the two terms involved in the expression of the first derivative of the kinetic energy functional, Eq. (B3). Using the same manipulations, each one of them can then be expressed as a sequence of direct and inverse Fourier transforms, thus leading to an Ωlog Ωnumerical effort in the calculations. Appendix C: Ωlog Ω scaling for computation of the SHAKE matrix for GGA functionals In the following we show how the cost of computing the diagonal elements of the SHAKE matrix (see eq. (32)) can be reduced to Ωlog Ωscaling by exploiting periodicity in direct space. We report below the expression of these diagonal elements for convenience: <u>Ω</u> _ND_ �2 + <sup><u>4</u></sup> <sup>_<u>π</u>_</sup> <sup><u>Ω</u></sup> _|_ _G_ _α|_ <sup>2</sup> _r_ _r_ <sup>_m_</sup> _α_ <sup>Ψ</sup> <sup>_lm_</sup> P <sup>_m_</sup> _α_ <sup>Ψ</sup> <sup>_lm_</sup> _t_ <sup>_l_</sup> _α_ <sup>_Gm_</sup> _α_ <sup>_l_</sup> _α_ <sup>_Gm_</sup> _α_ <sup>_lm_</sup> P <sup>(</sup> <sup>_r_</sup> <sup>)</sup> - + <sup><u>4</u></sup> <sup>_<u>π</u>_</sup> <sup><u>Ω</u></sup> <sup>_lm_</sup> _t_ <sup>(</sup> <sup>_r_</sup> <sup>)</sup> [J _D_ ] _G_ _α,_ _G_ _α_ = - <u>4</u> _<u>π</u>_ <u>Ω</u> _|_ _G_ _α|_ <sup>2</sup> �ΞP( _r_ ) + _G_ <sup>_l_</sup> _|_ _G_ _α|_ <sup>2</sup> <u>Ω</u> _ND_ �Ξ _t_ ( _r_ ) + _G_ <sup>_l_</sup> _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>_NG_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> <sup>_′_</sup> _λ_ =1 �2 � _r_ _,_ _r_ <sup>_′_</sup> + + - <u>Ω</u> _ND_ - <u>Ω</u> _ND_ _α_ <sup>_l_</sup> <sup>)Φ</sup> <sup>_l_</sup> _α_ <sup>_l_</sup> <sup>)Φ</sup> <sup>_l_</sup> _t_ <sup>_m_</sup> _α_ <sup>Ψ</sup> <sup>_lm_</sup> _t_ <sup>_l_</sup> P <sup>(</sup> <sup>_r_</sup> <sup>) +</sup> <sup>_Gl_</sup> _λ_ <sup>_l_</sup> _λ_ <sup>_Gm_</sup> _α_ <sup>_m_</sup> _α_ <sup>Ψ</sup> <sup>_lm_</sup> P <sup>_lm_</sup> P <sup>(</sup> <sup>_r_</sup> <sup>)</sup> ��Ξ _t_ ( _r_ <sup>_′_</sup> ) _−_ i( _G_ <sup>_l_</sup> <sup>_l_</sup> _t_ <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>) +</sup> <sup>_Gl_</sup> _λ_ <sup>_l_</sup> _λ_ <sup>_Gm_</sup> _α_ <sup>_lm_</sup> _t_ <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>)</sup> _×_ �ΞP( _r_ ) + i( _G_ <sup>_l_</sup> _λ_ <sup>_l_</sup> _λ_ <sup>_−_</sup> <sup>_G_</sup> _α_ <sup>_l_</sup> <sup>_l_</sup> _λ_ <sup>_−_</sup> <sup>_Gl_</sup> _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>_NG_</sup> _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> <sup>_′_</sup> _λ_ =1 �2 � _r_ _,_ _r_ <sup>_′_</sup> _α_ <sup>_l_</sup> <sup>)Φ</sup> <sup>_l_</sup> �Ξ _t_ ( _r_ <sup>_′_</sup> ) + i( _G_ <sup>_l_</sup> _λ_ <sup>_l_</sup> _λ_ <sup>+</sup> <sup>_Gl_</sup> _α_ <sup>_l_</sup> <sup>)Φ</sup> <sup>_l_</sup> _t_ <sup>_m_</sup> _α_ <sup>Ψ</sup> <sup>_lm_</sup> _t_ <sup>_l_</sup> P <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_Gl_</sup> _λ_ <sup>_l_</sup> _λ_ <sup>_Gm_</sup> _α_ <sup>_m_</sup> _α_ <sup>Ψ</sup> <sup>_lm_</sup> P <sup>_lm_</sup> P <sup>(</sup> <sup>_r_</sup> <sup>)</sup> _×_ <sup>_l_</sup> _t_ <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>)</sup> <sup>_−_</sup> <sup>_Gl_</sup> _λ_ <sup>_l_</sup> _λ_ <sup>_Gm_</sup> _α_ <sup>_lm_</sup> _t_ <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>)</sup> _,_ _×_ which we rewrite as �ΞP( _r_ ) _−_ i( _G_ <sup>_l_</sup> _λ_ <sup>_l_</sup> _λ_ <sup>+</sup> <sup>_G_</sup> _α_ <sup>_l_</sup> <u>Ω</u> _ND_ �J <sup>KXC</sup> _D_ <sup>_l_</sup> _α_ <sup>_Gm_</sup> _α_ �2 + <sup><u>4</u></sup> <sup>_<u>π</u>_</sup> <sup><u>Ω</u></sup> _|_ _G_ _α|_ <sup>2</sup> �� _r_ �Ξ _t_ ( _r_ ) + _G_ <sup>_l_</sup> _α_ <sup>_m_</sup> _α_ <sup>Ψ</sup> _t_ <sup>_lm_</sup> <sup>_m_</sup> _α_ <sup>Ψ</sup> P <sup>_lm_</sup> <sup>_l_</sup> _α_ <sup>_Gm_</sup> _α_ _G_ _α,_ _G_ _α_ - <sup>�</sup> <sup>)</sup> + _t_ <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> + P <sup>_lm_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> [J _D_ ] _G_ _α,_ _G_ _α_ = - <u>4</u> _<u>π</u>_ <u>Ω</u> _|_ _G_ _α|_ <sup>2</sup> �ΞP( _r_ ) + _G_ <sup>_l_</sup> _r_ (C1) The first term involving the Hartree contribution, as well as the mixed terms, have a numerical cost that trivially scales linearly with system size. We will discuss in this appendix the pure kinetic and exchange-correlation contribution �J <sup>KXC</sup> _D_ _G_ _α,_ _G_ _α_ <sup>.</sup> <sup>Let</sup> <sup>us</sup> <sup>begin</sup> <sup>by</sup> <sup>observing</sup> <sup>that</sup> <sup>performing</sup> <sup>the</sup> <sup>products</sup> <sup>in</sup> <sup>the</sup> <sup>triple</sup> <sup>sum</sup> <sup>above</sup> <sup>results</sup> <sup>in</sup> <sup>a</sup> <sup>total</sup> <sup>of</sup> eight terms, all of the generic form _D_ <sup>_l_</sup> _λ_ <sup>)</sup> <sup>_a_</sup> <sup>(i</sup> <sup>_Gm_</sup> _λ_ _NG_ _λ_ =1 <sup>_m_</sup> _λ_ <sup>)</sup> <sup>_bφ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_ψ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>)</sup> (C2) _h_ <sup>_ab_</sup> 1 <sup>(</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>) =</sup> _h_ <sup>_ab_</sup> 1 _L_ _r_ <sup>_′_</sup> =0 _L_ _r_ =0 - _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> <sup>_′_</sup> _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> <sup>_′_</sup> _×_ (i _G_ <sup>_l_</sup> _λ_ where we have explicitly indicated the range of the sums in direct space, _a, b_ = 0 _,_ 1 and the functions _φ_ and _ψ_ are proxies for the Ξ and Φ computed at iteration _κ_ or at time _t_ values of the electronic coefficients. Focusing at first on the sum over _r_, note that, since both Φ and Ξ are functions of the (periodic) energy of the system, the function _φ_ ( _r_ ) _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> is periodic in _r_ with period _L_ . The sums in the equation above can then be reorganized as follows <sup>_l_</sup> _λ_ <sup>)</sup> <sup>_a_</sup> <sup>(i</sup> <sup>_Gm_</sup> _λ_ _NG_ _λ_ =1 <sup>_m_</sup> _λ_ <sup>)</sup> <sup>_bφ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>)</sup> <sup>_ψ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>)</sup> _h_ <sup>_ab_</sup> 1 <sup>(</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>) =</sup> _L_ _r_ <sup>_′_</sup> =0 _L_ + _r_ <sup>_′_</sup> _r_ = _r_ <sup>_′_</sup> - _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> <sup>_′_</sup> _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> <sup>_′_</sup> _×_ (i _G_ <sup>_l_</sup> _λ_ (C3) from which, using the transformation _r_ = _r_ <sup>_′_</sup> + _r_ <sup>_′′_</sup>, <sup>_l_</sup> _λ_ <sup>)</sup> <sup>_a_</sup> <sup>(i</sup> <sup>_Gm_</sup> _λ_ _L_ _r_ <sup>_′′_</sup> =0 _NG_ _λ_ =1 <sup>_m_</sup> _λ_ <sup>)</sup> <sup>_bφ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>+</sup> <sup>_r_</sup> <sup>_′′_</sup> <sup>)</sup> <sup>_ψ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>)</sup> _h_ <sup>_ab_</sup> 1 <sup>(</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>) =</sup> _L_ _r_ <sup>_′_</sup> =0 - _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> <sup>_′′_</sup> _e_ <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> <sup>_′′_</sup> _×_ (i _G_ <sup>_l_</sup> _λ_ (C4) The terms in Eq. (C4) can now be rearranged to obtain _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> <sup>_′′_</sup> <sup>��</sup> <sup>_NG_</sup> _λ_ =1 <sup>_m_</sup> _λ_ <sup>)</sup> <sup>_b_</sup> _h_ <sup>_ab_</sup> 1 <sup>(</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>) =</sup> _L_ _r_ <sup>_′′_</sup> =0 _e_ <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> <sup>_′′_</sup> (i _G_ <sup>_l_</sup> <sup>_l_</sup> _λ_ <sup>)</sup> <sup>_a_</sup> <sup>(i</sup> <sup>_Gm_</sup> _λ_ �� _L_ _r_ <sup>_′_</sup> =0 �� _φ_ ( _r_ <sup>_′_</sup> + _r_ <sup>_′′_</sup> ) _ψ_ ( _r_ <sup>_′_</sup> ) (C5) The sum over _r_ <sup>_′_</sup> in the equation above is, by definition, the spatial correlation function ( _φ ⋆ψ_ ) ( _r_ <sup>_′′_</sup> ) = <sup>�</sup> _r_ <sup>_L_</sup> <sup>_′_</sup> =0 <sup>_φ_</sup> <sup>(</sup> <sup>_r_</sup> <sup>_′_</sup> <sup>+</sup> _r_ <sup>_′′_</sup> ) _ψ_ ( _r_ <sup>_′_</sup> ). The second triple sum in Eq. (32) can be treated in the same way to obtain _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> <sup>_′′_</sup> <sup>��</sup> <sup>_NG_</sup> _λ_ =1 <sup>_m_</sup> _λ_ <sup>)</sup> <sup>_b_</sup> �� _L_ _r_ <sup>_′_</sup> =0 �� _φ_ ( _r_ <sup>_′_</sup> + _r_ <sup>_′′_</sup> ) _ψ_ ( _r_ <sup>_′_</sup> ) (C6) _h_ <sup>_ab_</sup> 2 <sup>(</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>) =</sup> _L_ _r_ <sup>_′′_</sup> =0 _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> <sup>_′′_</sup> ( _−_ i _G_ <sup>_l_</sup> _λ_ <sup>_l_</sup> _λ_ <sup>)</sup> <sup>_a_</sup> <sup>(</sup> <sup>_−_</sup> <sup>i</sup> <sup>_Gm_</sup> _λ_ Combining these results, we have <sup>_l_</sup> _λ_ <sup>)</sup> <sup>_a_</sup> <sup>(i</sup> <sup>_Gm_</sup> _λ_ ( _φ ⋆ψ_ ) ( _r_ <sup>_′′_</sup> ) _e_ <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_α·_</sup> <sup>_r_</sup> <sup>_′′_</sup> <sup>_NG_</sup> _λ_ =1 <sup>_m_</sup> _λ_ <sup>)</sup> <sup>_b_</sup> <sup>+</sup> <sup>_e−_</sup> <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> <sup>_′′_</sup> <sup>(</sup> <sup>_−_</sup> <sup>i</sup> <sup>_G_</sup> _λ_ <sup>_l_</sup> <sup>_m_</sup> _λ_ <sup>)</sup> <sup>_b_</sup> _h_ <sup>_ab_</sup> 1 <sup>(</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>) +</sup> <sup>_hab_</sup> 2 <sup>(</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>) =</sup> _L_ _r_ <sup>_′′_</sup> =0 _e_ <sup>i</sup> <sup>_G_</sup> <sup>_λ·_</sup> <sup>_r_</sup> <sup>_′′_</sup> (i _G_ <sup>_l_</sup> _λ_ <sup>_l_</sup> <sup>)</sup> <sup>_a_</sup> <sup>(</sup> <sup>_−_</sup> <sup>i</sup> <sup>_Gm_</sup> _λ_ (C7) The expression above is particularly convenient for our purposes because the remaining sums over direct and reciprocal space are all, directly or via trivial manipulations, direct or inverse Fourier transforms that can be computed at Ωlog Ω (or equivalently _ND_ log _ND_ ) cost using libraries implementing the fast Fourier transform (FFT) algorithm. More in detail, the sum over _G_ _λ_ is, by definition, the inverse (discrete) Fourier transform of the product ( _iG_ <sup>_l_</sup> _λ_ <sup>)</sup> <sup>_a_</sup> <sup>(</sup> <sup>_iGm_</sup> _λ_ <sup>)</sup> <sup>_b_</sup> <sup>_l_</sup> _λ_ <sup>)</sup> <sup>_a_</sup> <sup>(</sup> <sup>_iGm_</sup> _λ_ multiplied by _ND_, while the correlation function ( _φ ⋆ψ_ ) can be computed as <sup>_m_</sup> _λ_ <sup>)</sup> <sup>_b_</sup> _φ_ ( _r_ <sup>_′_</sup> + _r_ <sup>_′′_</sup> ) _ψ_ ( _r_ <sup>_′_</sup> ) = _N_ DIFT ( _φ ⋆ψ_ ) ( _r_ <sup>_′′_</sup> ) = via the convolution theorem. Thus, _h_ <sup>_ab_</sup> 1 <sup>(</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>) +</sup> <sup>_hab_</sup> 2 <sup>(</sup> <sup>_G_</sup> <sup>_α_</sup> <sup>) =</sup> <sup>_N_</sup> _D_ <sup>2</sup> _r_ <sup>_′_</sup> _a,b_ �FT[ _φ_ ] <sup>_⋆_</sup> FT[ _ψ_ ]� (C8) �� IFT[(i _G_ <sup>_l_</sup> <sup>_m_</sup> _λ_ <sup>)</sup> <sup>_b_</sup> <sup>]</sup> - - <sup>��</sup> FT[ _φ_ ] <sup>_⋆_</sup> FT[ _ψ_ ] (C9) �� IFT FT <sup>_l_</sup> _λ_ <sup>)</sup> <sup>_a_</sup> <sup>(i</sup> <sup>_Gm_</sup> _λ_ Note that the FTs in Eq. (C9) return a vector of length _ND_ whose components are the _ND_ nonzero elements of _h_ <sup>_ab_</sup> 1 <sup>+</sup> <sup>_hab_</sup> 2 <sup>.</sup> <sup>This</sup> <sup>implies</sup> <sup>that,</sup> <sup>together</sup> <sup>with</sup> <sup>the</sup> <sup>other</sup> <sup>terms</sup> <sup>in</sup> <sup>Eq.</sup> <sup>(C1),</sup> <sup>the</sup> <sup>calculation</sup> <sup>of</sup> <sup>the</sup> <sup>SHAKE</sup> <sup>denominator</sup> _h_ <sup>_ab_</sup> 1 <sup>+</sup> <sup>_hab_</sup> 2 <sup>.</sup> <sup>This</sup> <sup>implies</sup> <sup>that,</sup> <sup>together</sup> <sup>with</sup> <sup>the</sup> <sup>other</sup> <sup>terms</sup> <sup>in</sup> <sup>Eq.</sup> <sup>(C1),</sup> <sup>the</sup> <sup>calculation</sup> <sup>of</sup> <sup>the</sup> <sup>SHAKE</sup> <sup>denominator</sup> is reduced to a number of _O_ ( _N_ D log _N_ D) operations equal to the number of terms of the form of the LHS of Eq. (C9). Finally, the diagonal part of the KXC contribution to the hessian, J <sup>KXC</sup> _D_, is obtained as a linear combination of these terms _h_ <sup>_ab_</sup> 1 <sup>+</sup> <sup>_hab_</sup> 2 <sup>,</sup> <sup>with</sup> <sup>some</sup> <sup>coefficients</sup> <sup>involving</sup> <sup>a</sup> <sup>product</sup> <sup>with</sup> <sup>_G_</sup> _α_ <sup>_l_</sup> <sup>or</sup> <sup>_Gm_</sup> _α_ <sup>.</sup> <sup>This</sup> <sup>however</sup> <sup>comes</sup> <sup>at</sup> <sup>nearly</sup> <sup>no</sup> <sup>extra</sup> cost and is in any case linear in the system size so that the overall cost proportional to _O_ ( _N_ D log _N_ D) is achieved. <sup>_ab_</sup> 1 <sup>+</sup> <sup>_hab_</sup> 2 <sup>,</sup> <sup>with</sup> <sup>some</sup> <sup>coefficients</sup> <sup>involving</sup> <sup>a</sup> <sup>product</sup> <sup>with</sup> <sup>_G_</sup> _α_ <sup>_l_</sup> <sup>or</sup> <sup>_Gm_</sup> _α_ 1Alessandro Coretti, Sara Bonella, and Giovanni Ciccotti. Communication: Constrained molecular dynamics for polarizable models. _The_ _Journal_ _of_ _Chemical_ _Physics_, 149(19):191102, 2018. 2Sara Bonella, Alessandro Coretti, Rodolphe Vuilleumier, and Giovanni Ciccotti. Adiabatic motion and statistical mechanics _via_ mass-zero constrained dynamics. _Physical_ _Chemistry_ _Chem-_ _ical_ _Physics_, page 10.1039.D0CP00163E, 2020. 3Andr´es Aguado, Leonardo Bernasconi, and Paul A. Madden. Interionic potentials from _ab_ _initio_ molecular dynamics: The alkaline earth oxides CaO, SrO, and BaO. _The_ _Journal_ _of_ _Chemical_ _Physics_, 118(13):5704–5717, 2003. 4Sandro Jahn, Paul A. Madden, and Mark Wilson. Dynamic simulation of pressure-driven phase transformations in crystalline al2o3. _Physical_ _Review_ _B_, 69:020106, Jan 2004. 5J. Kolafa. Time-reversible always stable predictor-corrector method for molecular dynamics of polarizable molecules. _Journal_ _of_ _Computational_ _Chemistry_, 25(3):335–342, 2004. 6Jiˇr´ı Genzer and Jiˇr´ı Kolafa. Molecular dynamics of potential models with polarizability: comparison of methods. _Journal_ _of_ _Molecular_ _Liquids_, 109(2):63 – 72, 2004. Sixth Liblice Conference on the Statistical Mechanics of Liquids. 7R. Car and M. Parrinello. Unified approach for molecular dynamics and density-functional theory. _Physical_ _Review_ _Letters_, 55:2471–2474, Nov 1985. 8G. Pastore, E. Smargiassi, and F. Buda. Theory of _ab_ _initio_ molecular-dynamics calculations. _Physical_ _Review_ _A_, 44:6334– 6347, Nov 1991. 9Anders M. N. Niklasson, C. J. Tymczak, and Matt Challacombe. Time-reversible Born–Oppenheimer molecular dynamics. _Physi-_ _cal_ _Review_ _Letters_, 97:123001, Sep 2006. 10Anders M. N. Niklasson. Extended Lagrangian Born– Oppenheimer molecular dynamics using a Krylov subspace approximation. _The_ _Journal_ _of_ _Chemical_ _Physics_, 152(10):104103, 2020. 11Anders MN Niklasson. Extended lagrangian born–oppenheimer molecular dynamics for orbital-free density-functional theory and polarizable charge equilibration models. _The Journal of Chemical_ _Physics_, 154(5):054101, 2021. 12M Pounds, S Tazi, M Salanne, and P A Madden. Ion adsorption at a metallic electrode: an _ab_ _initio_ based simulation study. _Journal_ _of_ _Physics:_ _Condensed_ _Matter_, 21(42):424109, sep 2009. 13Fabien Pacaud, Mathieu Salanne, Thibault Charpentier, Laurent Cormier, and Jean-Marc Delaye. Structural study of Na2OB2O3-SiO2-La2O3 glasses from molecular simulations using a polarizable force field. _Journal_ _of_ _Non-Crystalline_ _Solids_, 499:371 - 379, 2018. 14Dahlia K Remler and Paul A Madden. Molecular dynamics without effective potentials via the car-parrinello approach. _Molecular_ _Physics_, 70(6):921–966, 1990. 15Peter Pulay and G´eza Fogarasi. Fock matrix dynamics. _Chemical_ _physics_ _letters_, 386(4-6):272–278, 2004. 16MC Payne, JD Joannopoulos, DC Allan, MP Teter, and David H Vanderbilt. Molecular dynamics and ab initio total energy calculations. _Physical_ _review_ _letters_, 56(24):2656, 1986. 17Mike C. Payne, Michael P. Teter, Douglas C. Allan, TA Arias, and ad JD Joannopoulos. Iterative minimization techniques for ab initio total-energy calculations: molecular dynamics and conjugate gradients. _Reviews_ _of_ _modern_ _physics_, 64(4):1045, 1992. 18Dominik Marx and J urg Hutter. _Ab_ _initio_ _molecular_ _dynamics:_ _Basic theory and advanced methods_ . Cambridge University Press, Cambridge, 2012. 19Herbert Goldstein. _Classical_ _mechanics_ . Addison Wesley, San Francisco, 2002. 20G. Ciccotti and J.-P. Ryckaert. Molecular dynamics simulation of rigid molecules. _Computer_ _Physics_ _Reports_, 4(6):346 - 392, 1986. 21Jean-Paul Ryckaert, Giovanni Ciccotti, and Herman J.C Berendsen. Numerical integration of the cartesian equations of motion of a system with constraints: molecular dynamics of n-alkanes. _Journal_ _of_ _Computational_ _Physics_, 23(3):327 - 341, 1977. 22A. Coretti, L. Scalfi, C. Bacon, B. Rotenberg, R. Vuilleumier, G. Ciccotti, M. Salanne, and S. Bonella. Mass-zero constrained molecular dynamics for electrode charges in simulations of electrochemical systems. _The_ _Journal_ _of_ _Chemical_ _Physics_, 152(19):194701, May 2020. 23B. Leimkuhler and C. Matthews. _Molecular_ _dynamics_ _:_ _with_ _de-_ _terministic_ _and_ _stochastic_ _numerical_ _methods_ . Springer, Cham, 2015. 24Abel Marin-Lafl`eche, Matthieu Haefele, Laura Scalfi, Alessandro Coretti, Thomas Dufils, Guillaume Jeanmairet, Stewart K. Reed, Alessandra Serva, Roxanne Berthin, Camille Bacon, Sara Bonella, Benjamin Rotenberg, Paul A. Madden, and Mathieu Salanne. Metalwalls: A classical molecular dynamics software dedicated to the simulation of electrochemical systems. _Journal_ _of_ _Open_ _Source_ _Software_, 5(53):2373, 2020. 25D. D. Girardier, A. Coretti, G. Ciccotti, and S. Bonella. Masszero constrained dynamics and statistics for the shell model in magnetic field. _The_ _European_ _Physical_ _Journal_ _B_, 94(8):158, 2021. 26Yael Weinbach and Ron Elber. Revisiting and parallelizing SHAKE. _Journal_ _of_ _Computational_ _Physics_, 209(1):193 - 206, 2005. 27Lin-Wang Wang and Michael P. Teter. Kinetic-energy functional of the electron density. _Physical_ _Review_ _B_, 45:13196–13220, Jun 1992. 28Yan Alexander Wang, Niranjan Govind, and Emily A. 1. Orbitalfree kinetic-energy density functionals with a density-dependent kernel. _Physical_ _Review_ _B_, 60(24):16350–16358, December 1999. Publisher: American Physical Society. 29M Pearson, E Smargiassi, and P A Madden. _Ab_ _initio_ molecular dynamics with an orbital-free density functional. _Journal_ _of_ _Physics:_ _Condensed_ _Matter_, 5(19):3221–3240, may 1993. 30Vincent L. Lign`eres and Emily A. Carter. _An_ _Introduction_ _to_ _Orbital-Free Density Functional Theory_, pages 137–148. Springer Netherlands, Dordrecht, 2005. 31William C. Witt, Beatriz G. del Rio, Johannes M. Dieterich, and Emily A. Carter. Orbital-free density functional theory for materials research. _Journal_ _of_ _Materials_ _Research_, 33(7):777– 795, 2018. 32J. J. Mortensen, L. B. Hansen, and K. W. Jacobsen. Real-space grid implementation of the projector augmented wave method. _Phys._ _Rev._ _B_, 71:035109, Jan 2005. 33J Enkovaara, C Rostgaard, J J Mortensen, J Chen, M Du�lak, L Ferrighi, J Gavnholt, C Glinsvad, V Haikola, H A Hansen, H H Kristoffersen, M Kuisma, A H Larsen, L Lehtovaara, M Ljungberg, O Lopez-Acevedo, P G Moses, J Ojanen, T Olsen, V Petzold, N A Romero, J Stausholm-Møller, M Strange, G A Tritsaris, M Vanin, M Walter, B Hammer, H H¨akkinen, G K H Madsen, R M Nieminen, J K Nørskov, M Puska, T T Rantala, J Schiøtz, K S Thygesen, and K W Jacobsen. Electronic structure calculations with GPAW: a real-space implementation of the projector augmented-wave method. _Journal_ _of_ _Physics:_ _Condensed_ _Matter_, 22(25):253202, jun 2010. 34Mohan Chen, Junchao Xia, Chen Huang, Johannes M Dieterich, Linda Hung, Ilgyou Shin, and Emily A Carter. Introducing PROFESS 3.0: An advanced program for orbital-free density functional theory molecular dynamics simulations. _Computer Physics_ _Communications_, 190:228–230, 2015. 35Ralf Meyer, Manuel Weichselbaum, and Andreas W. Hauser. Machine learning approaches toward orbital-free density functional theory: Simultaneous training on the kinetic energy density functional and its functional derivative. _Journal_ _of_ _Chemical_ _Theory_ _and_ _Computation_, 16(9):5685–5694, 2020. PMID: 32786898. 36S. Alireza Ghasemi and Thomas D. K¨uhne. Artificial neural networks for the kinetic energy functional of non-interacting fermions. _The_ _Journal_ _of_ _Chemical_ _Physics_, 154(7):074107, February 2021. Publisher: American Institute of Physics. 37Jorge Nocedal and Stephen J. Wright. _Numerical_ _optimization_ . Springer, New York, 2006. 38Eric Barth, Krzysztof Kuczera, Benedict Leimkuhler, and Robert D. Skeel. Algorithms for constrained molecular dynamics. _Journal_ _of_ _Computational_ _Chemistry_, 16(10):1192–1209, October 1995. 39Benedict J. Leimkuhler and Robert D. Skeel. Symplectic numerical integrators in constrained Hamiltonian systems. _Journal_ _of_ _Computational_ _Physics_, 112(1):117 - 125, 1994. 40B. Leimkuhler and S. Reich. _Simulating_ _Hamiltonian_ _dynamics_ . Cambridge University Press, Cambridge, UK New York, 2004. 41Susi Lehtola, Conrad Steigemann, Micael J.T. Oliveira, and Miguel A.L. Marques. Recent developments in libxc - A comprehensive library of functionals for density functional theory. _SoftwareX_, 7:1–5, January 2018. 42John P. Perdew, J. A. Chevary, S. H. Vosko, Koblar A. Jackson, Mark R. Pederson, D. J. Singh, and Carlos Fiolhais. Atoms, molecules, solids, and surfaces: Applications of the generalized gradient approximation for exchange and correlation. _Phys._ _Rev._ _B_, 46:6671–6687, Sep 1992. 43von Weizs¨acker, C. F. Zur theorie der kernmassen. _Zeitschrift_ _f¨ur_ _Physik_, 96(7-8):431–458, 1935. 44F Perrot. Hydrogen-hydrogen interaction in an electron gas. _Journal_ _of_ _Physics:_ _Condensed_ _Matter_, 6(2):431–446, January 1994. 45Pascal Joly and G`erard Meurant. Complex conjugate gradient methods. _Numerical_ _Algorithms_, 4(3):379–406, October 1993. 46P. A. M. Dirac. Note on exchange phenomena in the thomas atom. _Mathematical_ _Proceedings_ _of_ _the_ _Cambridge_ _Philosophical_ _Society_, 26(3):376–385, 1930. 47F. Bloch. Bemerkung zur elektronentheorie des ferromagnetismus und der elektrischen leitf¨ahigkeit. _Zeitschrift f¨ur Physik_, 57(7):545–555, 1929. 48J. P. Perdew and Alex Zunger. Self-interaction correction to density-functional approximations for many-electron systems. _Phys._ _Rev._ _B_, 23:5048–5079, May 1981. 49William C. Topp and John J. Hopfield. Chemically motivated pseudopotential for sodium. _Physical_ _Review_ _B_, 7:1295–1303, Feb 1973. 50Eric Vanden-Eijnden and Giovanni Ciccotti. Second-order integrators for Langevin equations with holonomic constraints. _Chemical_ _Physics_ _Letters_, 429(1-3):310–316, September 2006. 51Guo-Xin Qian, M. Weinert, G. W. Fernando, and J. W. Davenport. First-principles calculation of the activation energy for diffusion in liquid sodium. _Physical_ _Review_ _Letters_, 64(10):1146– 1149, March 1990. 52A. J. Greenfield, J. Wellendorf, and Nathan Wiser. X-ray determination of the static structure factor of liquid na and k. _Phys._ _Rev._ _A_, 4:1607–1616, Oct 1971. 53T. Lee, J. Bisschop, W. van der Lugt, and W.F. Van Gunsteren. Radial distribution functions of liquid na and cs. _Physica_ _B+C_, 93(1):59–62, 1978. 54Fuyuki Shimojo, Kozo Hoshino, and Mitsuo Watabe. Dynamical correlation functions and memory functions of liquid sodium—a molecular dynamics simulation. _Journal_ _of_ _the_ _Physical_ _Society_ _of_ _Japan_, 63(1):141–155, 1994. 55M. W. Ozelton and R. A. Swalin. Self-diffusion in liquid sodium at constant volume and constant pressure. _Philosophical_ _Maga-_ _zine_, 18(153):441–451, September 1968. 56William H. Press, Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. _Numerical_ _recipes_ _in_ _C:_ _The_ _art_ _of_ _scien-_ _tific_ _computing_ . Cambridge University Press, Cambridge Cambridgeshire New York, 1992. 57Anders M. N. Niklasson and Marc J. Cawkwell. Generalized extended Lagrangian Born-Oppenheimer molecular dynamics. _The_ _Journal_ _of_ _Chemical_ _Physics_, 141(16):164123, October 2014.

섹션 본문

섹션 본문이 없습니다.

참고문헌 52건

  1. Ab initio molecular dynamics with an orbital-free density functional Journal of Physics Condensed Matter · IOP Publishing · 1993 10.1088/0953-8984/5/19/019
  2. Molecular dynamics simulation of rigid molecules Computer Physics Reports · Elsevier BV · 1986 10.1016/0167-7977(86)90022-5
  3. Electronic structure calculations with GPAW: a real-space implementation of the projector augmented-wave method Journal of Physics Condensed Matter · IOP Publishing · 2010 10.1088/0953-8984/22/25/253202
  4. Kinetic-energy functional of the electron density Physical review. B, Condensed matter · American Physical Society · 1992 10.1103/physrevb.45.13196
  5. Fock matrix dynamics Chemical Physics Letters · Elsevier BV · 2004 10.1016/j.cplett.2004.01.069
  6. Revisiting and parallelizing SHAKE Journal of Computational Physics · Elsevier BV · 2005 10.1016/j.jcp.2005.03.015
  7. Interionic potentials from <i>ab initio</i> molecular dynamics: The alkaline earth oxides CaO, SrO, and BaO The Journal of Chemical Physics · American Institute of Physics · 2003 10.1063/1.1556074
  8. Algorithms for constrained molecular dynamics Journal of Computational Chemistry · Wiley · 1995 10.1002/jcc.540161003
  9. Molecular dynamics of potential models with polarizability: comparison of methods Journal of Molecular Liquids · Elsevier BV · 2003 10.1016/j.molliq.2003.08.004
  10. Real-space grid implementation of the projector augmented wave method Physical Review B · American Physical Society · 2005 10.1103/physrevb.71.035109
  11. Self-diffusion in liquid sodium at constant volume and constant pressure Philosophical magazine · Taylor & Francis · 1968 10.1080/14786436808227451
  12. Chemically Motivated Pseudopotential for Sodium Physical review. B, Solid state · American Physical Society · 1973 10.1103/physrevb.7.1295
  13. Symplectic Numerical Integrators in Constrained Hamiltonian Systems Journal of Computational Physics · Elsevier BV · 1994 10.1006/jcph.1994.1085
  14. Complex conjugate gradient methods Numerical Algorithms · Springer Science+Business Media · 1993 10.1007/bf02145754
  15. Bemerkung zur Elektronentheorie des Ferromagnetismus und der elektrischen Leitf�higkeit The European Physical Journal A · Springer Science+Business Media · 1929 10.1007/bf01340281
  16. Second-order integrators for Langevin equations with holonomic constraints Chemical Physics Letters · Elsevier BV · 2006 10.1016/j.cplett.2006.07.086
  17. Molecular Dynamics and<i>ab initio</i>Total Energy Calculations Physical Review Letters · American Physical Society · 1986 10.1103/physrevlett.56.2656
  18. Dynamical Correlation Functions and Memory Functions of Liquid Sodium–a Molecular Dynamics Simulation Journal of the Physical Society of Japan · Physical Society of Japan · 1994 10.1143/jpsj.63.141
  19. Radial distribution functions of liquid Na and Cs Physica B+C · Elsevier BV · 1978 10.1016/0378-4363(78)90111-0
  20. Theory of<i>ab initio</i>molecular-dynamics calculations Physical Review A · American Physical Society · 1991 10.1103/physreva.44.6334
  21. Introducing PROFESS 3.0: An advanced program for orbital-free density functional theory molecular dynamics simulations Computer Physics Communications · Elsevier BV · 2015 10.1016/j.cpc.2014.12.021
  22. Ion adsorption at a metallic electrode: an<i>ab initio</i>based simulation study Journal of Physics Condensed Matter · IOP Publishing · 2009 10.1088/0953-8984/21/42/424109
  23. Molecular dynamics without effective potentials via the Car-Parrinello approach Molecular Physics · Taylor & Francis · 1990 10.1080/00268979000101451
  24. Unified Approach for Molecular Dynamics and Density-Functional Theory Physical Review Letters · American Physical Society · 1985 10.1103/physrevlett.55.2471
  25. X-Ray Determination of the Static Structure Factor of Liquid Na and K Physical review. A, General physics · American Institute of Physics · 1971 10.1103/physreva.4.1607
  26. Self-interaction correction to density-functional approximations for many-electron systems Physical review. B, Condensed matter · American Physical Society · 1981 10.1103/physrevb.23.5048
  27. First-principles calculation of the activation energy for diffusion in liquid sodium Physical Review Letters · American Physical Society · 1990 10.1103/physrevlett.64.1146
  28. Hydrogen-hydrogen interaction in an electron gas Journal of Physics Condensed Matter · IOP Publishing · 1994 10.1088/0953-8984/6/2/014
  29. Dynamic simulation of pressure-driven phase transformations in crystalline Al2O3 Physical Review B · American Physical Society · 2004 10.1103/physrevb.69.020106
  30. Generalized extended Lagrangian Born-Oppenheimer molecular dynamics The Journal of Chemical Physics · American Institute of Physics · 2014 10.1063/1.4898803
  31. Time-Reversible Born-Oppenheimer Molecular Dynamics Physical Review Letters · American Physical Society · 2006 10.1103/physrevlett.97.123001
  32. Orbital-free kinetic-energy density functionals with a density-dependent kernel Physical review. B, Condensed matter · American Physical Society · 1999 10.1103/physrevb.60.16350
  33. Iterative minimization techniques for<i>ab initio</i>total-energy calculations: molecular dynamics and conjugate gradients Reviews of Modern Physics · American Physical Society · 1992 10.1103/revmodphys.64.1045
  34. Numerical integration of the cartesian equations of motion of a system with constraints: molecular dynamics of n-alkanes Journal of Computational Physics · Elsevier BV · 1977 10.1016/0021-9991(77)90098-5
  35. Note on Exchange Phenomena in the Thomas Atom Mathematical Proceedings of the Cambridge Philosophical Society · Cambridge University Press · 1930 10.1017/s0305004100016108
  36. Time‐reversible always stable predictor–corrector method for molecular dynamics of polarizable molecules Journal of Computational Chemistry · Wiley · 2003 10.1002/jcc.10385
  37. Recent developments in libxc — A comprehensive library of functionals for density functional theory SoftwareX · Elsevier BV · 2017 10.1016/j.softx.2017.11.002
  38. Structural study of Na2O-B2O3-SiO2-La2O3 glasses from molecular simulations using a polarizable force field Journal of Non-Crystalline Solids · Elsevier BV · 2018 10.1016/j.jnoncrysol.2018.07.049
  39. Communication: Constrained molecular dynamics for polarizable models The Journal of Chemical Physics · American Institute of Physics · 2018 10.1063/1.5055704
  40. Orbital-free density functional theory for materials research Journal of materials research/Pratt's guide to venture capital sources · Springer Nature · 2018 10.1557/jmr.2017.462
  41. Zur Theorie der Kernmassen The European Physical Journal A · Springer Science+Business Media · 1935 10.1007/bf01337700
  42. Adiabatic motion and statistical mechanics<i>via</i>mass-zero constrained dynamics Physical Chemistry Chemical Physics · Royal Society of Chemistry · 2020 101039d0cp00163e
  43. Adiabatic motion and statistical mechanics<i>via</i>mass-zero constrained dynamics Physical Chemistry Chemical Physics · Royal Society of Chemistry · 2020 10.1039/d0cp00163e
  44. Extended Lagrangian Born–Oppenheimer molecular dynamics using a Krylov subspace approximation The Journal of Chemical Physics · American Institute of Physics · 2020 10.1063/1.5143270
  45. Mass-zero constrained molecular dynamics for electrode charges in simulations of electrochemical systems The Journal of Chemical Physics · American Institute of Physics · 2020 10106350007192
  46. Machine Learning Approaches toward Orbital-free Density Functional Theory: Simultaneous Training on the Kinetic Energy Density Functional and Its Functional Derivative Journal of Chemical Theory and Computation · American Chemical Society · 2020 10.1021/acs.jctc.0c00580
  47. MetalWalls: A classical molecular dynamics software dedicated to the simulation of electrochemical systems The Journal of Open Source Software · Open Journals · 2020 10.21105/joss.02373
  48. Mass-zero constrained molecular dynamics for electrode charges in simulations of electrochemical systems The Journal of Chemical Physics · American Institute of Physics · 2020 10.1063/5.0007192
  49. Extended Lagrangian Born–Oppenheimer molecular dynamics for orbital-free density-functional theory and polarizable charge equilibration models The Journal of Chemical Physics · American Institute of Physics · 2021 10.1063/5.0038190
  50. Artificial neural networks for the kinetic energy functional of non-interacting fermions The Journal of Chemical Physics · American Institute of Physics · 2021 10.1063/5.0037319
  51. Mass-Zero constrained dynamics and statistics for the shell model in magnetic field The European Physical Journal B · Springer Science+Business Media · 2021 10.1140/epjb/s10051-021-00165-0
  52. Atoms, molecules, solids, and surfaces: Applications of the generalized gradient approximation for exchange and correlation Physical review. B, Condensed matter · American Physical Society · 1992 10.1103/physrevb.46.6671