The Journal ARTICLE of Chemical Physics scitation.org/journal/jcp

Dirac-Fock calculations on molecules in an adaptive multiwavelet basis

Cite as: J. Chem. Phys. 151, 234112 (2019); doi: 10.1063/1.5128908 Submitted: 23 September 2019 • Accepted: 21 November 2019 • Published Online: 18 December 2019

Joel Anderson,1,a) Bryan Sundahl,1 Robert Harrison,1 and Gregory Beylkin2

AFFILIATIONS 1 Institute for Advanced Computational Science, Stony Brook University, Stony Brook, New York 11794-5250, USA 2Department of Applied Mathematics, University of Colorado at Boulder, UCB 526, Boulder, Colorado 80309-0526, USA

a)[email protected]

ABSTRACT We report the first fully numerical approach for relativistic quantum chemical calculations applicable to molecules. The approach usesan adaptive basis of multiwavelet functions to solve the full four-component Dirac-Coulomb equation to a user-specified accuracy. The accuracy of the code is demonstrated by comparison with ground state energy calculations of atoms performed in GRASP, and the applicability to molecules is shown via ground state calculations of some simple molecules, including water analogs up to H2Po. In the case of molecules, comparison is made with basis set calculations in DIRAC. Published under license by AIP Publishing. https://doi.org/10.1063/1.5128908., s

I. INTRODUCTION A. Dirac-Fock The relativistic Dirac-Fock equation is given by , in principle, enables accurate calculations

of molecular properties, but for higher accuracy calculations, espe- (hd + V + J − K)φi = εiφi, (1) cially those involving heavier atoms, one must take into account 1 the effects of special relativity. There has been success in adapt- 2 ing existing basis-set methods to handle the effects of special rela- hd = c α ⋅ p + βmc , (2) tivity, but these come with the same weaknesses of nonrelativistic basis-set calculations, i.e., poor scaling with respect to number of φ∗(r′)φ (r′) = (r) ∑ i i r′ basis functions, and the large number of linear dependencies when Jφj φj ∫ ′ d , (3) i ∣r − r ∣ calculating with large basis sets.2 Additionally, basis sets for rela- tivistic calculations must be chosen and contracted even more care- φ∗(r′)φ (r′) fully to maintain the correct relation between the large and small = ( ′) ∑ i j ′ 3 Kφj φi r ∫ ′ dr . (4) components to avoid variational collapse. Fully numerical codes i ∣r − r ∣ exist, but only for atoms4 or small molecules of high symmetry.5–7 MADNESS8 provides the first fully numerical relativistic code that Here, c = 137.035 989 5 is the speed of light in atomic units, can be applied to general molecules, and this paper details the imple- taken from Ref.9, m is the rest mass of the electron (unity in atomic units), and p is the 3-component vector of linear momentum opera- mentation and initial results. In Sec.IA, we briefly review the Dirac ∂ tors pi = −i . V is the external potential. The matrices α and β are equation and the integral equation approach. A brief description of ∂xi k the multiwavelet basis used by MADNESS is given in Sec.IB. In given by Sec.II, we give the details of our calculations, and we present results 0 σk I2 0 in Sec. III. In Sec.IV, we make some concluding remarks and discuss αk = [ ] β = [ ], future directions. σk 0 0 −I2

J. Chem. Phys. 151, 234112 (2019); doi: 10.1063/1.5128908 151, 234112-1 Published under license by AIP Publishing The Journal ARTICLE of Chemical Physics scitation.org/journal/jcp

n n n − 2 0 1 0 i 1 0 ϕil = 2 ϕi(2 x − l), (12) σ1 = [ ] σ2 = [ ] σ3 = [ ], 1 0 i 0 0 −1 where i = 0, 1, ..., k − 1 ranges over the Legendre polynomials where In is the identity matrix of dimension n. Solutions to Eq. (1) Pi, n = 0, 1, ... indicates the level of refinement, and l = 0, 1, ..., are complex-valued 4-component functions and can describe both 2n − 1 indexes the subinterval. These scaling functions are orthonor- electronic (positive energy) and positronic (negative energy) states. mal for a fixed n and form a complete basis in the limit n → ∞ for Methods exist to transform the Dirac equation such that one must a given value of k. The condition for ending refinement is checked only solve a two-component problem for the electronic states. using the wavelet coefficients in the following way: For any n, let Vn Good reviews of these methods exist, for example, Refs. 10 and be the space of all scaling functions at the nth level of refinement. 11. Although it is possible to use MADNESS in the context of a This space is a subspace of Vn+1. Put another way, two-component formalism, the computational cost is prohibitive for practical calculations as discussed in Ref. 12. Therefore, in V0 ⊂ V1 ⊂ V2 ⊂ ⋯. (13) this paper, we concern ourselves only with the full 4-component Hamiltonian. The space Wn is defined as the complement of Vn in Vn+1. The adaptive multiwavelet basis (to be described in Sec.IB) in Then, another way to write Vn+1 is MADNESS is not band-limited, so solving Eq. (1) by forming the equivalent matrix eigenvalue problem in the space of basis functions Vn+1 ≡ V0 ⊕ W0 ⊕ W1 ⊕ ⋯ ⊕ Wn. (14) would amplify high frequency noise in the calculation of the matrix elements. For this reason, the integral equation is solved instead by This space Wn is spanned by a set of multiwavelets that can be using the associated Green’s function. This method has been suc- constructed from the functions spanning Vn+1 (Ref. 15). By this con- cessfully applied in the nonrelativistic case,13 and we extend it to the struction, the wavelet basis functions are mutually orthogonal across relativistic case here. Rearranging (1) and application of the matrix all refinement levels and orthogonal to all scaling functions atthe Green’s function associated with the free-particle Dirac equation same and coarser levels. The resulting vanishing moments of these gives functions mean that functions that are smooth (as many physically relevant integral operators are) have sparse representations in the (hd − εi)φi(r) = (K − J − V)φi(r), (5) multiwavelet basis. φi = Gi(r) ∗ [(K − J − V)φi(r)]. (6) By the relationship shown in Eq. (14), the projection of some function in Wn can be seen as the error in representing the said Above, the ∗ represents convolution of the two operands. Gi is function in Vn as opposed to Vn+1. Thus, the wavelet basis coeffi- the matrix Green’s function for the operator on the left-hand side of cients provide a measure of when refinement can be stopped, and Eq. (5), i.e., Gi solves adaptivity is achieved by repeating this treatment individually for each subinterval. Through this method of refinement, any finite (h − ε )G (r) = δ(r)I . (7) d i i 4 but arbitrary bound on the 2-norm of the error in the function Its form, provided with proof in Ref. 14, is representation can be enforced.13,15 1 Because the basis functions are discontinuous, derivative oper- Gi(r) = [hd + εi]gi(r), (8) ators in the multiwavelet basis do not exist in the traditional sense. 2mc2 However, one can construct transition matrices for the derivative in e−μi∣r∣ the weak form, as is done in Ref. 15. Derivatives constructed in this gi(r) = , (9) manner will be used to apply the directional derivatives present in 4π∣r∣ hd of Eq. (8). Straightforward application of integral operators over √ more than one dimension is prohibitively expensive in the multi- 2 4 2 m c − εi wavelet basis. Therefore, efficient application of integral operators μi = . (10) mc2 in this basis requires constructing separated representations. Here, Note that the form of Eqs. (8)–(10) changes if the relativis- this is accomplished for the integral operator necessary in applying tic Hamiltonian used subtracts the rest energy from the standard Gi by representing the bound-state Helmholtz Green’s function as a expression for the relativistic energy of the electron. sum of Gaussians via numerical integration of the following relation, as is done in Ref. 13:

B. Multiwavelets −μr ∞ e 2 −r2e2s−μ2e−2s+s = √ ∫ e ds (15) MADNESS employs an adaptively refined multiwavelet basis to r π −∞ represent functions and operators. A detailed description of the mul- tiwavelet basis can be found in Ref. 15, and a brief summary is given for μ ≥ 0. In the case μ = 0, Eq. (15) gives the Coulomb operator, here in one dimension, with the extension to multiple dimensions which is required in application of the J and K operators. One key being straightforward. Functions are initially projected into a basis feature of MADNESS is the ability to represent a function either in n of scaled and shifted Legendre polynomials ϕil. In one dimension the basis of scaling functions or in the “compressed” form of scal- and on the interval (0, 1), ing functions and multiwavelets. Transformation between the two √ representations is fast and unitary, giving MADNESS the ability to 2i + 1Pi(2x − 1) x ∈ (0, 1) ϕi(x) = { (11) quickly and accurately switch to the representation best suited to 0 else, each operation.

J. Chem. Phys. 151, 234112 (2019); doi: 10.1063/1.5128908 151, 234112-2 Published under license by AIP Publishing The Journal ARTICLE of Chemical Physics scitation.org/journal/jcp

II. METHODS Following construction of the initial guess function, the overall Equation (6) leads to a method of iterating a function repre- algorithm for the ground-state energy calculation emulates that in sented in the multiwavelet basis to convergence. Letting n represent Ref. 13 and involves the following: the calculation iteration, we have 1. Computation of the Fock matrix in the space of occupied n+1 n n φi = Gi (r) ∗ [(K − J − V)φi (r)], (16) orbitals. 2. Diagonalization of the Fock matrix in the space of occupied n n orbitals and transformation of the occupied orbitals, as well as n ⟨φi ∣hd + J − K + V∣φi ⟩ εi = . (17) exchange orbitals, into the eigenbasis. ⟨φn∣φn⟩ i i 3. Convolution with the Green’s function [Eq. (8)]. This iteration is motivated by the successful application of a 4. Application of the Krylov-Accelerated Inexact Newton (KAIN) similar one for nonrelativistic quantum Monte Carlo calculations by solver.18 Kalos16 and the subsequent extension to the multiwavelet basis by 5. Orthogonalization of the orbitals. Harrison et al.13 Here, we extend it to the relativistic case. 6. Application of exchange, Coulomb, and nuclear potential It is worth noting that there are three different possibili- operators for the next iteration. Calculation of updated orbital ties for application of the Green’s function [Eq. (8)]. Given some energy. 4-component wavefunction ϕ(r), the convolution with G can be written as (omitting subscripts for brevity) Some notes on implementation: The ordering of the above algorithm implies that the result of applying the potential to each 1 ∗ = ( ∗ ([ ] )) initial guess orbital has been computed before iterating. In addition, G ϕ 2 ϕ hd + ε g 2mc because the KAIN solver requires a consistent history of orbitals, 1 arbitrary phases as well as rotations within degenerate eigenspaces, = [h + ε](ϕ ∗ g) 2mc2 d introduced by the eigensolver used in the diagonalization step, must 1 be removed. = (([hd + ε]ϕ) ∗ g)). All calculations were performed without spatial or time- 2mc2 reversal symmetry, meaning the code computes with one (four- The three different formulations are analytically equivalent; component) wavefunction in 3D-space for each electron. however, there is a computational trade-off. The first formulation is numerically preferable due to the error-smoothing effect of the integral operators, as long as care is taken when constructing the III. RESULTS derivative of g. However, the second method is considerably faster, In MADNESS, the user may select the number of scaling func- due largely to the low cost of applying a derivative operator com- tions (derived from Legendre polynomials) to use in each refined pared to an integral operator, and any loss of precision has been interval (defined with k) as well as the tolerance (enforced on the observed to be negligible for the systems studied here. Therefore, 2-norm of the error in the function) for refinement. All MADNESS in all MADNESS calculations reported, the second method has been calculations reported in this paper used k = 8 and a tolerance of 10−6. used. The third formulation has not been studied but is included for An internal parameter determines whether the refinement tolerance completeness. is enforced on a function itself or on both the function and its first Starting guesses are generated from a nonrelativistic Hartree- derivative. While the latter setting does increase the accuracy of cal- Fock routine, either generated by MADNESS’s own or generated 17 culation, it also substantially increases the memory requirement of by NWChem and then projected into the multiwavelet basis. For the computation. Therefore, for these calculations, this parameter a spin-restricted orbital, one nonrelativistic spatial function (here, was left at the former setting. represented with the single-valued function φnr) generates two start- Tables I andII show the results of Dirac-Fock calculations on ing guesses, each representing one electron, in the following way: atoms and molecules, respectively. In the case of atoms, compar- Two values for the large component are chosen as isons are to GRASP4 code calculations from the literature (Ref.9), 9 φnr 0 and both codes use a Fermi nuclear charge distribution model. Note φ = [ ] or φ = [ ], (18) that the potential due to a Fermi nuclear charge model has no ana- l 0 l φ nr lytic form. Instead, the nuclear charge distribution is projected into and in each case, the small component is initialized as the multiwavelet basis, and application of the Coulomb operator [Eq. (15) for μ = 0] yields the potential. 1 φs = σ ⋅ pφl (19) In the case of molecules, comparison is to the DIRAC rela- 2c tivistic quantum chemistry package19 using the built-in all-electron in order to maintain the correct nonrelativistic relationship between double-, triple-, and quadruple-zeta basis sets of Dyall20–22 with the large and small components. For a spin-unrestricted orbital, each ⟨SS|SS⟩ integrals computed explicitly, and both codes instead use nonrelativistic spatial function instead only generates one starting a Gaussian nuclear charge distribution model.9 All numbers (both guess. It should be noted that in practice, to prevent loss of accuracy atomic and molecular) reported are rounded at the 5th decimal by frequent multiplication of c, the small component is stored and place. The MADNESS Dirac-Fock code was able to reproduce the −1 computed with cφs and is rescaled by c as needed for computation total energies calculated by GRASP to at least six significant dig- of properties. its. For molecules, MADNESS was able to obtain energies similar

J. Chem. Phys. 151, 234112 (2019); doi: 10.1063/1.5128908 151, 234112-3 Published under license by AIP Publishing The Journal ARTICLE of Chemical Physics scitation.org/journal/jcp

TABLE I. Comparison of MADNESS and GRASP Dirac-Fock ground state energy calculations for atoms.

Atom MADNESS GRASP Error Relative error

Be −14.575 89 −14.575 89 −9.7 × 10−7 6.7 × 10−8 Ne −128.691 94 −128.691 93 −8.9 × 10−6 6.9 × 10−8 Mg −199.935 09 −199.935 07 −2.1 × 10−5 1.1 × 10−7 Ar −528.683 80 −528.683 76 −3.6 × 10−5 6.8 × 10−8 Ca −679.710 20 −679.710 16 −3.9 × 10−5 5.7 × 10−8 Zn −1 794.613 01 −1 794.612 97 −3.1 × 10−5 1.7 × 10−8 Kr −2 788.860 65 −2 788.860 58 6.8 × 10−5 2.4 × 10−8 Sr −3 178.079 90 −3 178.079 91 8.1 × 10−6 −2.5 × 10−9 Cd −5 593.318 96 −5 593.318 45 −5.1 × 10−4 9.2 × 10−8 Xe −7 446.894 75 −7 446.894 39 −3.6 × 10−4 4.9 × 10−8 Ba −8 135.643 61 −8 135.643 58 −2.9 × 10−5 −3.6 × 10−9 Yb −14 067.664 61 −14 067.666 91 2.3 × 10−3 −1.6 × 10−7 Hg −19 648.850 95 −19 648.858 22 7.3 × 10−3 −3.7 × 10−7 Rn −23 602.012 58 −23 602.023 31 1.1 × 10−2 −4.5 × 10−7

TABLE II. Comparison of MADNESS and DIRAC Dirac-Fock ground state energy calculations for molecules.

Molecule ae2z ae3z ae4z MADNESS

HF −100.151 91 −100.162 04 −100.163 04 −100.163 18 N2 −109.041 90 −109.057 43 −109.059 20 −109.059 40 BH3 −26.405 18 −26.409 48 −26.409 93 −26.410 00 H2O −76.111 24 −76.122 01 −76.123 27 −76.123 45 H2S −399.819 30 −399.837 96 −399.838 93 −399.839 02 H2Se −2 429.753 03 −2 429.794 62 −2 429.795 71 −2 429.795 72 H2Te −6 794.858 30 −6 794.876 55 −6 794.877 33 −6 794.877 04 H2Po −22 232.156 69 −22 232.176 86 −22 232.178 07 −22 232.175 91

to the corresponding DIRAC basis-set calculations; however, direct nonrelativistic solution being a poor initial guess for those sys- comparison between the fully numerical MADNESS results and the tems with highly charged nuclei. Analytically, the cost per iteration basis-set DIRAC results is not straightforward due to the possibility scales quadratically with respect to the number of electrons; how- of prolapse.23,24 ever, the systems reported in this paper are not large enough to see To give the reader an idea of the scale of a MADNESS Dirac- the asymptotic scaling. Fock calculation, we describe the calculation of the ground state of The MADNESS Dirac-Fock code maintains relative errors con- Rn. In this case, each orbital is represented with a total of O(106) sistent with the truncation threshold, as shown in Table I. The coefficients across all four components. The maximum depth ofthe desired accuracy is a parameter selected by the user, and the com- refinement tree over all orbitals is 18 levels. With an interval of putational cost increases accordingly. computation of [−50, 50]3 atomic units, the smallest box for which coefficients are computed has a side length− of2 18 ≈ 3.8 × 10−4, IV. CONCLUSIONS which is approximately the scale at which the nuclear charge distri- bution becomes smooth. All MADNESS calculations were run using For the first time, a fully numerical approach to four- 16 nodes with 40 Intel Skylake cores per node (2.1 GHz). The average component relativistic quantum chemistry calculations for general time per iteration for the Rn calculation was about 627 s. molecules has been described and demonstrated. In this approach, A detailed cost comparison between codes is omitted, as this the single-particle Dirac Green’s function is used to form an inte- study merely seeks to demonstrate accuracy, and the MADNESS gral equation that can be iterated to solution. The said iteration is Dirac-Fock code is currently lacking many potential optimizations. accomplished in the multiresolution multiwavelet basis via the soft- However, a few statements can be made about the multiwavelet ware package MADNESS. The accuracy of this method is demon- code: The number of iterations required for convergence increases strated through Dirac-Hartree-Fock calculations of the ground state with the charge of the nucleus. We suspect that this is due to the energies of several atoms and molecules, with comparisons made

J. Chem. Phys. 151, 234112 (2019); doi: 10.1063/1.5128908 151, 234112-4 Published under license by AIP Publishing The Journal ARTICLE of Chemical Physics scitation.org/journal/jcp

to GRASP and DIRAC. While this approach is unlikely to replace 10W. Liu, “Ideas of relativistic quantum chemistry,” Mol. Phys. 108, 1679–1706 grid-based calculations for atoms in the near future, to the best of (2010). our knowledge it is the only fully numerical approach for general 11T. Saue, “Relativistic Hamiltonians for chemistry,” AIP Conf. Proc. 1504, 219– molecules. 227 (2012). 12J. Anderson, R. Harrison, B. Sundahl, W. Thornton, and G. Beylkin, “Real-space quasi-relativistic quantum chemistry,” Computational and ACKNOWLEDGMENTS (submitted). 13R. J. Harrison, G. I. Fann, T. Yanai, Z. Gan, and G. Beylkin, “Multiresolution J. Anderson, R. Harrison, and B. Sundahl were supported in quantum chemistry: Basic theory and initial applications,” J. Chem. Phys. 121, part by the NSF under Grant No. ACI-1450344. The authors would 11587–11598 (2004). like to acknowledge Dr. William Scott Thornton, Dr. Hideo Sekino, 14J. Blackledge and B. Babajanov, “On the Dirac scattering problem,” Math. Dr. Bhanu Das, and Dr. Srinivasa Prasannaa for helpful discussions Aeterna 3, 535–544 (2013). on relativistic quantum chemistry theory and current numerical 15B. Alpert, G. Beylkin, D. Gines, and L. Vozovoi, “Adaptive solution of par- methods. tial differential equations in multiwavelet bases,” J. Comput. Phys. 182, 149–190 (2002). 16 REFERENCES H. M. Kalos, “Monte Carlo calculations of the ground state of three- and four- body nuclei,” Phys. Rev. 128, 1791–1795 (1962). 1P. Pyykko, “Relativistic effects in structural chemistry,” Chem. Rev. 88, 563–594 17M. Valiev, E. J. Bylaska, N. Govind, K. Kowalski, T. P. Straatsma, H. J. J. (1988). Van Dam, D. Wang, J. Nieplocha, E. Apra, T. L. Windus, and W. A. De Jong, 2D. Moncrieff and S. Wilson, “Computational linear dependence in molecular “NWChem: A comprehensive and scalable open-source solution for large electronic structure calculations using universal basis sets,” Int. J. Quantum Chem. scale molecular simulations,” Comput. Phys. Commun. 181, 1477–1489 101, 363–371 (2005). (2010). 18 3R. E. Stanton and S. Havriliak, “Kinetic balance: A partial solution to the R. J. Harrison, “Krylov subspace accelerated inexact Newton method for linear problem of variational safety in Dirac calculations,” J. Chem. Phys. 81, 1910 and nonlinear equations,” J. Comput. Chem. 25, 328–334 (2004). (1984). 19DIRAC, a relativistic ab initio electronic structure program, release DIRAC15 4F. Parpia and I. Grant, “ for relativistic atomic theory: The GRASP (2015), written by R. Bast, T. Saue, L. Visscher, and H. J. Aa. Jensen, with con- project at Oxford,” J. Phys. IV Colloque 01, 33–46 (1991). tributions from V. Bakken, K. G. Dyall, S. Dubillard, U. Ekstroem, E. Eliav, 5 A. Rosén and D. Ellis, “Relativistic molecular wavefunctions: XeF2,” Chem. Phys. T. Enevoldsen, E. Fasshauer, T. Fleig, O. Fossgaard, A. S. P. Gomes, T. Helgaker, Lett. 27, 595–599 (1974). J. Henriksson, M. Ilias, Ch. R. Jacob, S. Knecht, S. Komorovsky, O. Kullie, J. K. 6J. Desclaux and P. Pyykkö, “Relativistic and non-relativistic Hartree-Fock one- Laerdahl, C. V. Larsen, Y. S. Lee, H. S. Nataraj, M. K. Nayak, P. Norman, G. Olejniczak, J. Olsen, Y. C. Park, J. K. Pedersen, M. Pernpointner, R. centre expansion calculations for the series CH4 to PbH4 within the spherical approximation,” Chem. Phys. Lett. 29, 534–539 (1974). Di Remigio, K. Ruud, P. Salek, B. Schimmelpfennig, J. Sikkema, A. J. Thorvaldsen, 7 J. Thyssen, J. van Stralen, S. Villaume, O. Visser, T. Winther, and S. Yamamoto, D. Sundholm, P. Pyykkö, and L. Laaksonen, “Two-dimensional, fully numerical see http://www.diracprogram.org. solutions of second-order dirac equations for diatomic molecules. Part 3,” Phys. 20 Scr. 36, 400–402 (1987). K. G. Dyall, Theor. Chem. Acc. 99, 366 (1998); Addendum, 108, 365 8 (2002); Revision, 115, 441 (2006), basis sets available from the Dirac web site R. J. Harrison, G. Beylkin, F. A. Bischoff, J. A. Calvin, G. I. Fann, J. Fosso-tande, http://dirac.chem.sdu.dk. D. Galindo, J. R. Hammond, R. Hartman-baker, J. C. Hill, J. Jia, J. S. Jakob, 21 M.-J. Yvonne Ou, J. Pei, L. E. Ratcliff, M. G. Reuter, A. C. Richie-Halford, K. G. Dyall, Theor. Chem. Acc. 108, 335 (2002), Erratum, 115, 441 (2006), basis N. A. Romero, H. Sekino, W. A. Shelton, B. E. Sundahl, W. Scott, E. F. Valeev, sets available from the Dirac web site http://dirac.chem.sdu.dk. 22 A. Vazquez-Mayagoitia, N. Vence, T. Yanai, and Y. Yokoi, “Madness: A multires- K. G. Dyall, Theor. Chem. Acc. 115, 441 (2006), basis sets available from the olution, adaptive numerical environment for scientific simulation,” SIAM J. Sci. Dirac web site http://dirac.chem.sdu.dk. Comput. 38, S123–S142 (2016). 23I. Grant, “Conditions for convergence of variational solutions of Dirac’s equa- 9L. Visscher and K. Dyall, “Dirac-Fock atomic electronic structure calculations tion in a finite basis,” Phys. Rev. A 25, 1230 (1982). using different nuclear charge distributions,” At. Data Nucl. Data Tables 67, 207– 24K. Faegri, “Relativistic Gaussian basis sets for the elements K-Uuo,” Theor. 224 (1997). Chem. Acc. 105, 252–258 (2001).

J. Chem. Phys. 151, 234112 (2019); doi: 10.1063/1.5128908 151, 234112-5 Published under license by AIP Publishing