Arxiv:1807.10633V1 [Physics.Chem-Ph] 27 Jul 2018
Total Page:16
File Type:pdf, Size:1020Kb
Improved speed and scaling in orbital space variational monte carlo Iliya Sabzevari1 and Sandeep Sharma1, ∗ 1Department of Chemistry and Biochemistry, University of Colorado Boulder, Boulder, CO 80302, USA In this work, we introduce three algorithmic improvements to reduce the cost and improve the scal- ing of orbital space variational Monte Carlo (VMC). First, we show that by appropriately screening the one- and two-electron integrals of the Hamiltonian one can improve the efficiency of the al- gorithm by several orders of magnitude. This improved efficiency comes with the added benefit that the resulting algorithm scales as the second power of the system size O(N 2), down from the fourth power O(N 4). Using numerical results, we demonstrate that the practical scaling obtained is in fact O(N 1:5) for a chain of Hydrogen atoms, and O(N 1:2) for the Hubbard model. Second, we introduce the use of the rejection-free continuous time Monte Carlo (CTMC) to sample the determinants. CTMC is usually prohibitively expensive because of the need to calculate a large number of intermediates. Here, we take advantage of the fact that these intermediates are already calculated during the evaluation of the local energy and consequently, just by storing them one can use the CTCM algorithm with virtually no overhead. Third, we show that by using the adaptive stochastic gradient descent algorithm called AMSGrad one can optimize the wavefunction energies robustly and efficiently. The combination of these three improvements allows us to calculate the ground state energy of a chain of 160 hydrogen atoms using a wavefunction containing ∼ 2 × 105 variational parameters with an accuracy of 1 mEh/particle at a cost of just 25 CPU hours, which when split over 2 nodes of 24 processors each amounts to only about half hour of wall time. This low cost coupled with embarrassing parallelizability of the VMC algorithm and great freedom in the forms of usable wavefunctions, represents a highly effective method for calculating the electronic structure of model and ab initio systems. Quantum Monte Carlo (QMC) is one of the most pow- to deliver results at the complete basis set limit. Al- erful and versatile tools for solving the electronic struc- though extremely powerful, one of the shortcomings of ture problem and has been successfully used in a wide real space QMC methods is that there is less error can- range of problems1{5. QMC can be broadly classified into cellation than is typically observed in basis set quantum two categories of algorithms, variational Monte Carlo chemistry. This fact, coupled with the recent success of (VMC)6,7 and projector Monte Carlo (PMC). In VMC both AFQMC and FCIQMC (both of which work in a one is interested in minimizing the energy of a suitably finite basis set), has led to renewed interest in develop- chosen wavefunction ansatz. The accuracy of VMC is ment of new QMC algorithms that work in a finite basis limited by the functional form and the flexibility of the set20{27. The present work is an attempt in this direction wavefunction employed. PMC on the other hand is po- and presents algorithmic improvements for performing tentially exact and several variants exist, such as diffusion orbital space VMC calculations. Monte Carlo (DMC)8{10, Auxiliary field quantum Monte Carlo (AFQMC)11,12 , Green's function Monte Carlo To put the orbital space VMC in the broader context (GFMC)13{15 and full configuration interaction quantum of wavefunction methods, it is useful to classify the vari- Monte Carlo (FCIQMC)16{19. Although exact in prin- ous wavefunctions used in electronic structure theory into ciple, in practice all versions of PMC suffer from the three classes. The wavefunctions in the first class al- fermionic sign problem when used for electronic prob- low one to calculate the expectation value of the energy, lems, except in a few special cases. A commonly used H , deterministically with a polynomial cost in the h j j i technique for overcoming the fermionic sign problem is number of parameters, examples of these include the con- 28 to employ the fixed-node or fixed-phase approximation figuration interaction wavefunction and matrix product 29{31 that stabilizes the Monte Carlo simulation by eliminat- states . The second class of wavefunctions only allow ing the sign problem at a cost of introducing a bias in the one to calculate the overlap of the wavefunction with a calculated energies. The fixed-node or the fixed-phase is determinant (or a real space configuration), n , de- h j i arXiv:1807.10633v1 [physics.chem-ph] 27 Jul 2018 often obtained from a VMC calculation and thus the ac- terministically with a polynomial cost in the number of 32 curacy of the PMC calculation depends to a large extent parameters, examples include the Slater-Jastrow (SJ) , 33 on the quality of the VMC wavefunction. Thus VMC correlator product states , Jastrow-antisymmetric gem- 34 wavefunction plays a pivotal role and to a large extent inal power (JAGP) . Finally, the third class of wave- determines the final accuracy obtained from a QMC cal- function are the most general and do not allow polyno- culation. (FCIQMC is unique in its ability to control the mial cost evaluation of either the expectation value of sign problem self-consistently by making use of the ini- energy or an overlap with a determinant, examples of 35 tiator approximation.) Traditionally the most commonly these include the coupled cluster wavefunction and the 36 used variant of QMC has been the real space VMC fol- projected entangled pair states . The first class of wave- lowed by the fixed-node DMC calculation which is able function are the most restrictive, but are the easiest to work with and often efficient deterministic algorithms are 2 available to variationally minimize their energy. For the A. Reduced scaling evaluation of the local energy second class of wavefunctions one has to resort to VMC algorithms to both evaluate the energy and optimize the The local energy EL[n] of a determinant n is calcu- wavefunctions. Finally, the third type of wavefunctions lated as follows j i are the most general and are often quite accurate but one needs to resort to approximations to evaluate their n H Ψ(p) EL[n] =h j j i (2) energies. In this work we will focus on the second class of n Ψ(p) h j i wavefunction, in particular the wavefunction comprising P n H m m Ψ(p) = mh j j ih j i (3) of a product of the correlator product states and a Slater n Ψ(p) determinant (CPS-Slater). h j i X m Ψ(p) The rest of the paper is organized as follows. In Sec- = Hn;m h j i; (4) n Ψ(p) tion I, we will briefly outline the main steps of the VMC m h j i algorithm, followed by the new algorithmic innovation m introduced to improve the efficiency and reduce the scal- where the sum is over all determinants that have a n m ing of the algorithm. Next, in Section II, we will describe nonzero transition matrix element (Hn;m = H ) with n. The number of such non-zero matrixh elementsj j i how the algorithm is used to calculate the energy and op- 2 2 timize the CPS-Slater wavefunction. We will also discuss Hn;m are on the order of neno, where ne is the number in detail the cost and computational scaling of the algo- of electrons and no is the number of open orbitals. This rithm. Finally in Section III we will present the results number increases as a fourth power of the system size obtained by this algorithm for model systems including and a naive use of this formula results in an algorithm the 1-D hydrogen chain and 2-D Hubbard model. that scales poorly with the size of the problem. To reduce the cost of calculating the local energy we truncate the summation over all m to just a summation I. ALGORITHMIC IMPROVEMENTS over those m, that have a Hamiltonian transition matrix element Hn;m > , In VMC, the expectation value of the Hamiltonian for X m Ψ(p) a wavefunction Ψ(p), where p are the set of wavefunction EL[n; ] = Hn;m h j i; (5) n Ψ(p) parameters, is calculated by performing a Monte Carlo m h j i integration. where is a user defined parameter. Note that in the P 2 hnjHjΨ(p)i limit that 0, we recover the exact local energy, Ψ(p) H Ψ(p) n Ψ(p) n hnjΨ(p)i ! E =h j j i = jh j ij EL[n; ] EL[n]. It is useful to note that when a lo- Ψ(p) Ψ(p) P Ψ(p) n 2 cal basis! set is used the number of elements H that h j i n jh j ij n;m X have a magnitude larger than a fixed non-zero scale = ρ E [n] n L quadratically with the size of the system. To see this, n let's consider double excitations, the argument for the = EL[n] ρ (1) h i n single excitations is similar. For a given determinant (n), hnjHjΨ(p)i we can obtain another determinant by a double excita- where, EL[n] = hnjΨ(p)i is the local energy of a deter- tion of electrons from say orbitals i and j to orbitals a minant n, the last expression denotes that the energy and b to give another determinant (m) with a matrix ele- is calculated by averaging the local energy over a set ment Hn;m = ab ij ab ji .