The HANDE-QMC Project: Open-Source Stochastic Quantum Chemistry from the Ground State Up
Total Page:16
File Type:pdf, Size:1020Kb
The HANDE-QMC project: open-source stochastic quantum chemistry from the ground state up James S. Spencer,y,z Nick S. Blunt,{,x,kk Seonghoon Choi,{,kk Jiˇr´ıEtrych,{,kk Maria-Andreea Filip,{,kk W. M. C. Foulkes,y,k,kk Ruth S.T. Franklin,{,kk Will J. Handley,?,#,@,kk Fionn D. Malone,y,4,kk Verena A. Neufeld,{,kk Roberto Di Remigio,r,yy,kk Thomas W. Rogers,y,kk Charles J.C. Scott,{,kk James J. Shepherd,zz,kk William A. Vigor,{{,kk Joseph Weston,y,kk RuQing Xu,xx,kk and Alex J.W. Thom∗,{,{{ yDept. of Physics, Imperial College London, South Kensington Campus, London SW7 2AZ, United Kingdom zDept. of Materials, Imperial College London, South Kensington Campus, London SW7 2AZ, United Kingdom {University Chemical Laboratory, Lensfield Road, Cambridge CB2 1EW, United Kingdom xSt John's College, St John's Street, Cambridge, CB2 1TP, United Kingdom kDepartment of Physics, University of Illinois at Urbana-Champaign, Urbana, IL 61801, USA ?Astrophysics Group, Cavendish Laboratory, Cambridge, CB3 OHE, UK #Kavli Institute for Cosmology, Madingley Road, Cambridge, CB3 0HA, UK @Gonville & Caius College, Trinity Street, Cambridge, CB2 1TA, UK 4Quantum Simulations Group, Lawrence Livermore National Laboratory, Livermore, California 94550, USA rHylleraas Centre for Quantum Molecular Sciences, Department of Chemistry, University of Tromsø - The Arctic University of Norway, N-9037 Tromsø, Norway yyDepartment of Chemistry, Virginia Tech, Blacksburg, Virginia 24061, United States zzChemistry Building, University of Iowa, Iowa, 52240, USA {{Dept. of Chemistry, Imperial College London, South Kensington Campus, London SW7 2AZ, United Kingdom xxDepartment of Modern Physics, University of Science and Technology, Hefei, Anhui, 230026, China kkAuthors listed alphabetically E-mail: [email protected] Abstract the last decade. The full configuration interac- tion quantum Monte Carlo (FCIQMC) method Building on the success of Quantum Monte allows one to systematically approach the ex- Carlo techniques such as diffusion Monte Carlo, act solution of such problems, for cases where alternative stochastic approaches to solve elec- very high accuracy is desired. The introduc- tronic structure problems have emerged over tion of FCIQMC has subsequently led to the 1 development of coupled cluster Monte Carlo duced the full configuration interaction quan- (CCMC) and density matrix quantum Monte tum Monte Carlo (FCIQMC) method.26 The Carlo (DMQMC), allowing stochastic sampling FCIQMC method allows essentially exact FCI of the coupled cluster wave function and the results to be achieved for systems beyond the exact thermal density matrix, respectively. In reach of traditional, exact FCI approaches; in this article we describe the HANDE-QMC code, this respect, the method occupies a similar an open-source implementation of FCIQMC, space to the density matrix renormalization CCMC and DMQMC, including initiator and group (DMRG) algorithm27{29 and selected semi-stochastic adaptations. We describe our CI approaches.15{20 Employing a sparse and code and demonstrate its use on three exam- stochastic sampling of the FCI wave func- ple systems; a molecule (nitric oxide), a model tion greatly reduces the memory requirements solid (the uniform electron gas), and a real solid compared to exact approaches. The intro- (diamond). An illustrative tutorial is also in- duction of FCIQMC has led to the devel- cluded. opment of several other related QMC meth- ods, including coupled cluster Monte Carlo (CCMC),30,31 density matrix quantum Monte 1 Introduction Carlo (DMQMC),32,33 model space quantum Monte Carlo (MSQMC),34{36 clock quantum Quantum Monte Carlo (QMC) methods, in Monte Carlo,37 driven-dissipative quantum their many forms, are among the most reliable Monte Carlo (DDQMC),38 and several other and accurate tools available for the investiga- variants, including multiple approaches for tion of realistic quantum systems.1 QMC meth- studying excited-state properties.34,39{41 ods have existed for decades, including notable In this article we present HANDE-QMC approaches such as variational Monte Carlo (Highly Accurate N-DEterminant Quantum (VMC),2{6 diffusion Monte Carlo (DMC)1,7{10 Monte Carlo), an open-source quantum chem- and auxiliary-field QMC (AFQMC);11 such istry code that performs several of the above methods typically have low scaling with system quantum Monte Carlo methods. In partic- size, efficient large-scale parallelization, and ular, we have developed a highly-optimized systematic improvability, often allowing bench- and massively-parallelized package to per- mark quality results in challenging systems. form state-of-the-art FCIQMC, CCMC and A separate hierarchy exists in quantum chem- DMQMC simulations. istry, consisting of methods such as coupled An overview of stochastic quantum chemistry cluster (CC) theory,12 Møller-Plesset perturba- methods in HANDE-QMC is given in Section 2. tion theory (MPPT),13 and configuration inter- Section 3 describes the HANDE-QMC package, action (CI), with full CI (FCI)14 providing the including implementation details, our develop- exact benchmark within a given single-particle ment experiences, and analysis tools. Applica- basis set. The scaling with the number of basis tions of FCIQMC, CCMC and DMQMC meth- functions can be steep for these methods: from ods are contained in Section 4. We conclude N 4 for MP2 to exponential for FCI. Various ap- with a discussion in Section 5 with views on proaches to tackle the steep scaling wall have scientific software development and an outlook been proposed in the literature: from adap- on future work. A tutorial on running HANDE tive selection algorithms15{20 and many-body is provided in the Supplementary Material. expansions for CI21 to the exploitation of the locality of the one-electron basis set22 for MP2 and CC.23{25 Such approaches have been in- creasingly successful, now often allowing chem- ical accuracy to be achieved for systems com- prising thousands of basis functions. In 2009, Booth, Thom and Alavi intro- 2 2 Stochastic quantum chem- The stochastic efficiency of the algorithm (de- termined by the size of statistical errors for istry a given computer time) can be improved by several approaches: using real weights, rather 2.1 Full Configuration Interac- than integer weights, to represent particle am- tion Quantum Monte Carlo plitudes;44,45 a semi-stochastic propagation, in which the action of the Hamiltonian in a small The FCI ansatz forP the ground state wave- j i j i f g subspace of determinants is applied exactly;44,46 function is ΨCI = i ci Di , where Di is the set of Slater determinants. Noting that and more efficient sampling of the Hamiltonian ^ N by incorporating information about the magni- (1 − δτH) jΨ0i / jΨCIi as N ! 1, where Ψ0 is some arbitrary initial vector with hΨ jΨ i 6= tude of the Hamiltonian matrix elements into 0 CI 47,48 0 and δτ is sufficiently small,42 the coeffi- the selection probabilities. The initiator approximation49 (often referred cients fcig can be found via an iterative pro- cess derived from a first-order solution to the to as i-FCIQMC) only permits new particles to imaginary-time Schr¨odingerequation:26 be created on previously unoccupied determi- X nants if the spawning determinant has a weight ^ above a given threshold | this introduces a ci(τ +δτ) = ci(τ)−δτ hDijHjDji cj(τ): (1) j systematic error which is reduced with increas- ing particle populations, but effectively reduces A key insight is that the action of the Hamil- the severity of the sign problem. This simple tonian can be applied stochastically rather modification has proven remarkably successful than deterministically: the wavefunction is dis- and permits FCI-quality calculations on Hilbert cretized by using a set of particles with weight spaces orders of magnitude beyond exact FCI. 1 to represent the coefficients, and is evolved in imaginary time by stochastically creating 2.2 Coupled Cluster Monte new particles according to the Hamiltonian ma- trix (Section 2.4). By starting with just par- Carlo ticles on the Hartree{Fock determinant or a The coupled cluster wavefunction ansatz is small number of determinants, the sparsity of T^ ^ jΨCCi = Ne jDHFi, where T is the clus- the FCI wavefunction emerges naturally. The ter operator containing all excitations up to a FCIQMC algorithm hence has substantially re- given truncation level, N is a normalisation fac- duced memory requirements26 and is naturally tor and jDHFi the Hartree{Fock determinant. 43 scalable in contrast to conventional Lanczos For convenience, we rewrite the wavefunction ^ techniques. The sign problem manifests itself in T =tHF ansatz as jΨCCi = tHFe jDHFi, where tHF is the competing in-phase and out-of-phase com- a weight onP the Hartree{Fock determinant, and binations of particles with positive and nega- ^ 0 0 define T = i tia^i, where restricts the sum to tive signs on the same determinant;42 this is be up to the truncation level,a ^i is an excitation alleviated by exactly canceling particles of op- operator (excitor) such thata ^i jDHFi results in posite sign on the same determinant, a process jDii and ti is the corresponding amplitude. Us- termed `annihilation'. This results in the dis- ing the same first-order Euler approach as in tinctive population dynamics of an FCIQMC FCIQMC gives a similar propagation equation: simulation, and a system-specific critical pop- X ^ ulation is required to obtain a statistical rep- ti(τ + δτ) = ti(τ) − δτ hDijHjDji t~j(τ): (2) 42 resentation of the correct FCI wavefunction. j Once the ground-state FCI wavefunction has been reached, the population is controlled via The key difference between Eqs. (1) and (2) is 9,26 a diagonal energy offset and statistics can t~j = hDjjΨCCi contains contributions from clus- be accumulated for the energy estimator and, ters of excitors30 whereas the FCI wavefunction if desired, other properties. is a simple linear combination. This is tricky to 3 evaluate efficiently and exactly each iteration.