The requirement that the linear density fitting error in the integral exactly vanishes introduces unphysical long range contributions to the approximate density when the auxiliary basis is incomplete. A quasi-robust density fitting formulation is presented where spatial locality is recovered at the expense of permitting a linear error that is made small by the fitting procedure, which involves optimising the Coulomb potential of the approximate charge density. The method is shown to be stable and almost as accurate as standard robust density fitting without local approximations in practical calculations using standard density fitting basis sets.

The mean-field or correlated treatment of the electronic Schrödinger equation using the LCAO (linear combination of atomic orbital) approach necessitates the evaluation of four-centre two-electron repulsion integrals

(1)
(2)

where χμ are atomic orbitals, ϕp = Cμpχμ are molecular orbital, and Cμp are the molecular orbital coefficients. The density fitting approximation was introduced to reduce the computational effort required to build the integrals (rs|pq) through a reduced rank formulation.1,2 The central idea is to fit each charge density χμ(r1)χν(r1) with an auxiliary basis set of atom-centred density fitting functions ϕP(r1) so that

(3)
(4)

The coefficients of the approximate charge density |μν̃) are determined by minimising the error in the Coulomb energy

(5)

This enforces that the error in the integral is bilinear in the fitting error ϵJ = (ϵκλ|ϵμν) and the approximation is termed robust.3 The optimal coefficients are computed by solving

(6)

This formulation has the unsatisfactory feature that although the AOs |μν) belong to at most two atoms, the auxiliary functions |P) used to fit that charge density are drawn from all of the atoms of the system and the coefficients decay in the worst case only as the reciprocal of the distance between the charge centre of |μν) and the fitting function |P).4 

Local density fitting formulations circumvent this extraneous long-range behaviour either (a) by replacing Eq. (5), which is a least squares fit to the density using the Coulomb metric, by a least squares fit with a short-ranged metric such as the overlap,5–7 Yukawa-Coulomb4 or attenuated8 or Gaussian damped9 Coulomb metrics, or (b) by using a domain-based fit that excludes contributions from distant fitting functions a priori.10–14 In both cases, the error ϵJ in the integral Eq. (4) is then linearly dependent on the fitting error and, when using standard libraries of atom-centred density fitting functions, the magnitude of linear error makes Eq. (4) impractical for general application.5,15–18 Local density fitting therefore either follows a pair-domain scheme, with standard fitting in the unified domain of (κλ| and |μν), or uses Dunlap’s robust formula for the integral3 that removes the linear error by adding the linear terms

(7)

In all cases, the dependence on integrals (Q|μν) with (Q| distant from |μν) remains, appearing either in the fitting formula or in the integral expression.

Consider again Eq. (6), which determines the fitting coefficients. The functions |P) fit the charge density |μν) and the functions (Q| act as test functions where the Coulomb potential from |μν̃) should be accurate or, more precisely, yield accurate Coulomb energies (Q|μν̃). If we insert an approximate resolution of the identity (RI) 1PR|PSPR1R|, where SPR is the overlap metric between auxiliary basis functions, we obtain

(8)

Here (Rμν) is a three-centre one-electron overlap integral. The decay of the coefficients CμνP follows SPR1(Rμν) and is therefore exponential in the distance between the charge centre |μν) and the function |P). The test functions (Q|, however, span the whole molecule. Equation (8) suggests CμνP=SPR1(Rμν), which is understood to be impractical as a direct means for determining CμνP because the incompleteness errors in the approximate RI are substantial, leading to large linear errors in the Coulomb energy.6 For functions |μ) and |ν) located on different atoms, the charge centre |μν) lies in the vacuum between the atoms, whereas the fitting functions are all atom-centred and therefore often not well suited to fitting |μν). As a consequence, the approximate charge density |μν̃) resulting from Eq. (6) acquires unphysical contributions from |P) far away from |μν) that cancel the linear errors and yield the correct Coulomb energy (Q|μν̃)=(Q|μν). The long-range behaviour of standard density fitting is thus seen to be a consequence of the requirement that the linear error in the integral vanishes entirely when the RI is incomplete. To summarise, the auxiliary functions in Eq. (5) have a dual role: they are used both to approximate a charge distribution |μν) and to test the accuracy of the approximation |μν̃). It is the second role that is responsible for the non-locality inherent to standard density fitting.

This paper communicates a new fully separable local density fitting formulation where a charge density |μν) is fit only using functions |P) near by and where it is not necessary to compute the Coulomb interaction between |μν) and distant functions (Q|. The method is derived by decoupling the two roles of the auxiliary basis functions and by permitting linear error that is made small by the fitting procedure. It will be shown to be stable and almost as accurate as standard robust density fitting without local approximations in practical calculations using standard density fitting basis sets.

The target integrals are computed as

(9)

For a given set of μν, a set of fitting functions Pμν ∈ {P} local to |μν) are selected according to the criteria

(10)

with SPP = 1. A set of test functions Xμν ∈ {P} are selected according to the criteria

(11)

where f(A,B)=αβα+β|AB|2 for two functions with centres A, B and (smallest primitive) exponents α, β. The coefficients CμνP are determined so that the Coulomb potential is accurate at the test points, by minimising the errors in the Coulomb energies between the charge density |μν̃) and the test densities |X),

(12)

The number of test functions Xμν is larger than the number of fitting functions Pμν and the appropriate solution to this system of equations is achieved through QR factorisation of the rectangular matrix (Pμν|Xμν).

The criteria for selecting the domain Pμν of fitting functions follows directly from the RI in Eq. (8). The criteria for selecting the test functions Xμν is based on Gauss’s theorem: If the Coulomb potential is correct at functions around |μν̃) that do not overlap with |μν̃), then it will also be correct at functions further away. In this work, the test functions have been drawn from the density fitting set, but any set could in principle be used. Using delta functions, for example, is equivalent to probing the Coulomb potential on a grid. The current choice of test set is preferable since it retains a direct link to robust density fitting. This can be seen by noticing that Eq. (12) reduces to Eq. (6) when {Xμν} = {Pμν} = {P}.

The above local density fitting scheme has several favourable features: In the limit of vanishing T and infinite R, standard robust density fitting is recovered; the coefficients CμνP are in no way dependent on κλ and the formulation is in this sense fully separable and straightforward to parallelise; the coefficients CμνP can be computed with costs that scale linearly with system size; the only components with quadratic scaling over the lengthscale determined by the slow 1/r decay are the integrals (P|Q), which only need to be computed once at the start of a calculation.

The numerical results reported in Sec. III will demonstrate that contrary to the predominant view in the literature, it is possible to use non-robust local formulas and obtain an accuracy comparable to that of standard robust density fitting for Coulomb and exchange contributions to the Fock matrix and for the integrals required for the MP2 energy and that the naturally local formulation of density fitting presented above achieves this. The implications for efficient algorithms for computing Coulomb, exchange, and MP2 integrals are discussed in Sec. IV.

The accuracy of the quasi-robust local density fitting approximation for Coulomb, exchange, and MP2 integrals was first assessed by comparing the resulting Coulomb (J), exchange (K), and MP2 correlation energies to those computed exactly and to those computed using standard robust density fitting. First, a Hartree–Fock calculation was performed using the def2-TZVPP basis set19 and the RI-JK approximation as implemented in the Turbomole program package.20 This involves standard robust density fitting for both the Coulomb and exchange contributions to the energy and Fock matrix. Weigend’s RI-JK fitting basis sets21 and RI-MP2 sets22 were used. Using the converged orbitals and the same basis sets, the J, K, and MP2 correlation energies were computed using quasi-robust local density fitting (QR-J, QR-K, and QR-MP2). The energies were also computed using standard robust density fitting20,23 and analytically computed 4c-2e electron repulsion integrals. All calculations were performed with a locally modified version of the Turbomole program.24 

Figure 1 displays the density fitting error in the QR-J, QR-K, and QR-MP2 energies as a function of the overlap threshold T for the alkane chain C24H50 in an idealised linear arrangement. Overlap screening was performed for sets of μν belonging to the same shell pair and a conservative threshold of R=40a02 was chosen to select the test functions. Figure 2 displays the corresponding distribution of distances between the fitting functions Pμν and the centre of the charge density |μν), summed over all shell pairs μν, and reveals the spatial locality of the fitting set as a function of T.

FIG. 1.

Absolute errors in the QR-J, QR-K, and QR-MP2 energies for C24H50 as a function of truncation threshold T, using the def2-TZVPP basis sets. Dashed lines are errors for standard RI-J, RI-K, and RI-MP2.

FIG. 1.

Absolute errors in the QR-J, QR-K, and QR-MP2 energies for C24H50 as a function of truncation threshold T, using the def2-TZVPP basis sets. Dashed lines are errors for standard RI-J, RI-K, and RI-MP2.

Close modal
FIG. 2.

Total distribution of distances between the fitting functions Pμν and the centre of the charge density |μν) as a function of truncation threshold −log T = 4, 5, 6 for the C24H50 linear alkane in a def2-TZVPP basis.

FIG. 2.

Total distribution of distances between the fitting functions Pμν and the centre of the charge density |μν) as a function of truncation threshold −log T = 4, 5, 6 for the C24H50 linear alkane in a def2-TZVPP basis.

Close modal

Each of the J, K, and MP2 energies converges to the standard RI values as the threshold T is reduced. The K and MP2 energies converge rapidly and with a threshold of 1 × 10−5 or 1 × 10−6, and local density fitting is as accurate as robust density fitting. The QR-J energy converges more slowly, requiring a tighter threshold of 1 × 10−7 or 1 × 10−8. Since QR-DF is non-robust, the QR-K energies are not an upper bound, which can result in a variational collapse if the errors are too large.25 The threshold of 1 × 10−6 was tight enough to avoid variational collapse in all cases. Linear alkanes represent a worst case scenario for local density fitting4 due to the large surface area, which corresponds to regions at the edge of the molecule where the atom-centred RI basis is poorly saturated. Examining the corresponding Fig. 2 reveals that not only are distant fitting functions not required for an accurate fit to the potential but also more than half of the functions nearby can also be safely discarded on the basis of poor overlap with the target charge density.

Table I lists the signed fitting for the J, K, and MP2 energies using the QR and standard RI methods for a sequence of alkanes each in an idealised linear geometry, for a cluster of 21 water molecules taken from the Cambridge Cluster Database,26 for Cu(C3H6O)4+, the largest Cu+ complex from the CuCNDe33 dataset,27 for the methotrexate molecule (C20N8O5H22) and the 4T-MeOH cluster model for the adsorption of methanol on the H-ZSM-5 zeolite, taken from Ref. 28. The def2-TZVPP basis set combinations was used in all cases and fitting errors are reported in micro-Hartree per occupied orbital for J and K and per valence orbital for MP2. Conservative thresholds T = 1 × 10−6 for exchange and MP2 correlation and T = 1 × 10−8 for the Coulomb energy were used. The MP2 values for C32H66 and methotrexate are missing because the calculation without density fitting required more memory than was available on the computers used for these calculations. The accuracy of the local density fitting method matches that of standard density fitting for the progression of alkane chains with increasing length, and the density fitting error per occupied orbital is constant for both methods. For the more globular structures, the accuracy of the local fitting method is equally impressive.

TABLE I.

Density fitting errors in μEh per occupied orbital.

MoleculeQR-JRI-JQR-KRI-KQR-MP2RI-MP2
C8H18 −6 −6 10 
C16H34 −6 −6 10 
C24H50 −6 −6 10 
C32H66 −6 −6 10 … … 
(H2O)21 −6 −6 10 10 
Cu(C3H6O)4+ −6 −6 10 10 
C20N8O5H22 −4 −4 12 12 … … 
4T-MeOH −4 −4 
MoleculeQR-JRI-JQR-KRI-KQR-MP2RI-MP2
C8H18 −6 −6 10 
C16H34 −6 −6 10 
C24H50 −6 −6 10 
C32H66 −6 −6 10 … … 
(H2O)21 −6 −6 10 10 
Cu(C3H6O)4+ −6 −6 10 10 
C20N8O5H22 −4 −4 12 12 … … 
4T-MeOH −4 −4 

Table II reports the differences between the local density fitted and robust density fitted isomerisation energies for a subset of the ISOL (large isomerisation) test set of molecules,29 which are between 24 and 42 atoms in size and large enough for the local approximations to take effect. The same TZVPP basis set combination and thresholds T, R were used for these calculations as those in Table I, but here the isomerisation energies were computed using the converged self-consistent Hartree–Fock energies, employing density fitting for both J and K. Correspondingly, the RI-MP2 energy was computed using orbitals converged using RI-JK and the QR-MP2 energy was computed using the orbitals converged using the QR-JK method. No variational collapse was observed in any of the HF calculations performed. The values in Table II show that the converged HF energies obtained by local density fitting are as accurate as the energies obtained by standard density fitting, with an RMS error compared to HF isomerisation energies computed using analytic 4c-2e integrals of 0.07 kJ/mol compared to 0.06 kJ/mol for standard fitting.

TABLE II.

ISOL isomerisation energies in kJ/mol.

HFRI-JKQR-JKMP2RI-MP2QR-MP2
−83.69 −83.76 −83.73 −186.86 −186.99 −187.28 
−50.58 −50.61 −50.57 −41.15 −41.15 −41.13 
−95.83 −95.84 −95.87 −157.51 −157.50 −158.05 
−80.88 −80.92 −80.94 −95.62 −95.68 −95.70 
10 −1.00 −1.05 −1.04 −38.73 −38.74 −38.77 
11 −1169.51 −1169.60 −1169.67 −538.24 −538.06 −538.77 
13 −124.01 −124.01 −123.98 −153.29 −153.27 −151.31 
14 2.00 2.00 2.03 −22.24 −22.16 −22.40 
15 14.75 14.70 14.65 2.79 3.01 2.12 
20 −21.23 −21.22 −21.20 −24.22 −24.22 −22.34 
21 −23.36 −23.50 −23.50 −49.97 −50.05 −51.57 
23 −73.22 −73.26 −73.21 −123.56 −123.56 −123.83 
RMSD  0.06 0.07  0.10 0.97 
HFRI-JKQR-JKMP2RI-MP2QR-MP2
−83.69 −83.76 −83.73 −186.86 −186.99 −187.28 
−50.58 −50.61 −50.57 −41.15 −41.15 −41.13 
−95.83 −95.84 −95.87 −157.51 −157.50 −158.05 
−80.88 −80.92 −80.94 −95.62 −95.68 −95.70 
10 −1.00 −1.05 −1.04 −38.73 −38.74 −38.77 
11 −1169.51 −1169.60 −1169.67 −538.24 −538.06 −538.77 
13 −124.01 −124.01 −123.98 −153.29 −153.27 −151.31 
14 2.00 2.00 2.03 −22.24 −22.16 −22.40 
15 14.75 14.70 14.65 2.79 3.01 2.12 
20 −21.23 −21.22 −21.20 −24.22 −24.22 −22.34 
21 −23.36 −23.50 −23.50 −49.97 −50.05 −51.57 
23 −73.22 −73.26 −73.21 −123.56 −123.56 −123.83 
RMSD  0.06 0.07  0.10 0.97 

The QR-MP2 values are less accurate. Since Table I demonstrates that the QR-MP2 energy is accurate when the correct orbitals and eigenvalues are provided, the slightly poorer MP2 energies in Table II most likely result from the deterioration in the virtual orbitals and eigenvalues due to the local fitting at the SCF level. Indeed, the cases where a large MP2 deviation is observed are also the cases where the orbital relaxation from RI-HF to QR-HF is significant. Nonetheless, the maximum local density fitting error in the computed QR-MP2 isomerisation energies is only 2 kJ/mol.

The numerical results show that accurate HF and MP2 energies can be obtained using the quasi-robust local density fitting method. From a formal perspective, this approach is computationally attractive since the coefficients CμνP are zero unless |μ), |ν), and |P) have non-negligible overlap and the number of CμνP is therefore small and grows linearly with system size. Similarly the only (Q|μν) integrals that are required are those where (Q| and |μν) are connected by overlap criteria, which also results in an early onset of linear scaling with system size for the 3c-2e integral evaluation. The cost of solving the fitting equations for each block of μν is independent of system size but carries an increased prefactor since QR factorisation (or divide and conquer single value decomposition) must be performed in the place of Cholesky decomposition.

In the context of efficient linear-scaling algorithms for computing HF exchange, quasi-robust density fitting is expected to be both more accurate and more efficient than ARI (atomic RI), which although restricts the fitting functions |P) to those near to |μν) uses the whole set of test functions (Q| and requires the same 3c-2e evaluation as the full RI.11,12 Since QR-K is as accurate as RI-K, it is more accurate than the COSX pseudospectral method,30 but to properly compare the relative costs efficient QR-K implementations must be designed and tested, for example, one that combines quasi-robust local density fitting with the LinK density screened exchange algorithm31,32 and uses a low-scaling proxy for Eq. (10).

Replacing standard density fitting with quasi-robust density fitting for the evaluation of the HF Coulomb contribution does not change the scaling since the cubic cost of evaluating the fitting coefficients can be avoided through early contraction with the density matrix.33 The overall scaling for the Coulomb term is in both cases determined by the number of required (κλ|μν), which is quadratic over the lengthscale of non-negligible Coulomb interactions. Any computational saving of using the QR fitting in place of standard fitting would come from replacing the Cholesky decomposition of the full (Q|P) matrix, at O(N3) cost with O(N) QR factorisations of small matrices. The size regime where this becomes advantageous is also the regime where it is likely to be more efficient to use the existing efficient linear-scaling methods based on multipole moments for far-field contributions.34,35

Quasi-robust local density fitting brings distinct advantages in the context of local correlation methods. Most implementations of PAO (projected atomic orbital) and PNO (pair natural orbital) local correlation methods14,36,37 use pair-domains for local density fitting, which requires integrals 3c-2e integrals (Qμi|μi) and (Qνj|μi) for all pairs of localised occupied orbitals i, j that have significant pair energies. In the quasi-robust formulation, the density fitting can be performed for i independently of j and the Coulomb integral formula does not require the cross terms (Qνj|μi). Therefore, once the fitting coefficients have been computed, constructing the integrals is significantly simpler and cheaper. Moreover, the simplicity of the indexing required for the integral formula makes it significantly more straightforward to cast local correlation methods as a sequence of sparse tensor operations so that the state-of-the-art sparse tensor libraries suitable can be used to exploit modern massively parallel computer architectures.

D.P.T. thanks the Royal Society for financial support. This article is dedicated to the memory of Professor Reinhart Ahlrichs.

1.
J. L.
Whitten
,
J. Chem. Phys.
58
,
4496
(
1973
).
2.
J. A.
Jafri
and
J. L.
Whitten
,
J. Chem. Phys.
61
,
2116
(
1974
).
3.
B.
Dunlap
,
J. Mol. Struct.: THEOCHEM
501
,
221
(
2000
).
4.
P. M. W.
Gill
,
A. T. B.
Gilbert
,
S. W.
Taylor
,
G.
Friesecke
, and
M.
Head-Gordon
,
J. Chem. Phys.
123
,
061101
(
2005
).
5.
E.
Baerends
,
D.
Ellis
, and
P.
Ros
,
Chem. Phys.
2
,
41
(
1973
).
6.
O.
Vahtras
,
J.
Almlöf
, and
M.
Feyereisen
,
Chem. Phys. Lett.
213
,
514
(
1993
).
7.
C.-K.
Skylaris
,
L.
Gagliardi
,
N.
Handy
,
A.
Ioannou
,
S.
Spencer
, and
A.
Willetts
,
J. Mol. Struct.: THEOCHEM
501
,
229
(
2000
).
8.
Y.
Jung
,
A.
Sodt
,
P. M. W.
Gill
, and
M.
Head-Gordon
,
Proc. Natl. Acad. Sci.
U. S. A.
102
,
6692
(
2005
).
9.
S.
Reine
,
E.
Tellgren
,
A.
Krapp
,
T.
Kjærgaard
,
T.
Helgaker
,
B.
Jansik
,
S.
Høst
, and
P.
Salek
,
J. Chem. Phys.
129
,
104101
(
2008
).
10.
R.
Polly
,
H.-J.
Werner
,
F. R.
Manby
, and
P. J.
Knowles
,
Mol. Phys.
102
,
2311
(
2004
).
11.
A.
Sodt
,
J. E.
Subotnik
, and
M.
Head-Gordon
,
J. Chem. Phys.
125
,
194109
(
2006
).
12.
A.
Sodt
and
M.
Head-Gordon
,
J. Chem. Phys.
128
,
104106
(
2008
).
13.
C.
Köppl
and
H.-J.
Werner
,
J. Chem. Theory Comput.
12
,
3122
(
2016
).
14.
H.-J.
Werner
,
F. R.
Manby
, and
P. J.
Knowles
,
J. Chem. Phys.
118
,
8149
(
2003
).
15.
B. I.
Dunlap
,
J. W. D.
Connolly
, and
J. R.
Sabin
,
J. Chem. Phys.
71
,
3396
(
1979
).
16.
B. I.
Dunlap
,
J. W. D.
Connolly
, and
J. R.
Sabin
,
J. Chem. Phys.
71
,
4993
(
1979
).
17.
A. C.
Ihrig
,
J.
Wieferink
,
I. Y.
Zhang
,
M.
Ropo
,
X.
Ren
,
P.
Rinke
,
M.
Scheffler
, and
V.
Blum
,
New J. Phys.
17
,
093020
(
2015
).
18.
D. S.
Hollman
,
H. F.
Schaefer
, and
E. F.
Valeev
,
J. Chem. Phys.
140
,
064109
(
2014
).
19.
F.
Weigend
and
R.
Ahlrichs
,
Phys. Chem. Chem. Phys.
7
,
3297
(
2005
).
20.
F.
Weigend
,
Phys. Chem. Chem. Phys.
4
,
4285
(
2002
).
21.
F.
Weigend
,
J. Comput. Chem.
29
,
167
(
2008
).
22.
F.
Weigend
,
M.
Häser
,
H.
Patzelt
, and
R.
Ahlrichs
,
Chem. Phys. Lett.
294
,
143
(
1998
).
23.
C.
Hättig
,
A.
Hellweg
, and
A.
Köhn
,
Phys. Chem. Chem. Phys.
8
,
1159
(
2006
).
24.
TURBOMOLE V7.2 2017, a development of University of Karlsruhe and Forschungszentrum Karlsruhe GmbH, 1989-2007, TURBOMOLE GmbH, since 2007, available from http://www.turbomole.com.
25.
L. N.
Wirz
,
S. S.
Reine
, and
T. B.
Pedersen
,
J. Chem. Theory Comput.
13
,
4897
(
2017
).
26.
The Cambridge Cluster Database,
D. J.
Wales
,
J. P. K.
Doye
,
A.
Dullweber
,
M. P.
Hodges
,
F. Y.
Naumkin
,
F.
Calvo
,
J.
Hernández-Rojas
, and
T. F.
Middleton
, URL: http://www-wales.ch.cam.ac.uk/ccd.html.
27.
Y.
Minenkov
,
E.
Chermak
, and
L.
Cavallo
,
J. Chem. Theory Comput.
11
,
4664
(
2015
).
28.
R. A.
Bachorz
,
F. A.
Bischoff
,
A.
Glöß
,
C.
Hättig
,
S.
Höfener
,
W.
Klopper
, and
D. P.
Tew
,
J. Comput. Chem.
32
,
2492
(
2011
).
29.
R.
Huenerbein
,
B.
Schirmer
,
J.
Moellmann
, and
S.
Grimme
,
Phys. Chem. Chem. Phys.
12
,
6940
(
2010
).
30.
F.
Neese
,
F.
Wennmohs
,
A.
Hansen
, and
U.
Becker
,
Chem. Phys.
356
,
98
(
2009
), moving Frontiers in Quantum Chemistry.
31.
E.
Schwegler
,
M.
Challacombe
, and
M.
Head-Gordon
,
J. Chem. Phys.
106
,
9708
(
1997
).
32.
C.
Ochsenfeld
,
C. A.
White
, and
M.
Head-Gordon
,
J. Chem. Phys.
109
,
1663
(
1998
).
33.
G. R.
Ahmadi
and
J.
Almlöf
,
Chem. Phys. Lett.
246
,
364
(
1995
).
34.
C. A.
White
,
B. G.
Johnson
,
P. M.
Gill
, and
M.
Head-Gordon
,
Chem. Phys. Lett.
230
,
8
(
1994
).
35.
M.
Sierka
,
A.
Hogekamp
, and
R.
Ahlrichs
,
J. Chem. Phys.
118
,
9136
(
2003
).
36.
F.
Neese
,
F.
Wennmohs
, and
A.
Hansen
,
J. Chem. Phys.
130
,
114108
(
2009
).
37.
G.
Schmitz
,
B.
Helmich
, and
C.
Hättig
,
Mol. Phys.
111
,
2463
(
2013
).