2.3 Review of Density Fitting Methods
2.3.2 Fit of the Complete Electron Density
All current DFT implementations exploiting density fits rely on the expansion of the complete electron density, Eq. (2.16), according to
˜
ρ(r) =X
p
Ωp(r) dp = Ω†d (2.37)
into a set {Ωp} of atom-centered auxiliary functions. This is desirable because
the AO product basis {φµφν} in which the exact electron density is expanded is
nearly linear dependent and grows as O(N2) whereas the dimension of the basis
{Ωp} increases only as O(N ). As described above, the expansion coefficients are
obtained from the system of linear equations
with the solution
d = W−1a. (2.39)
The elements ap of the inhomogeneity vector are now defined as
ap = hΩp|W|ρi =
X
µ,ν
aµνp Pµν, (2.40)
with the three-index integrals
aµνp = hΩp|W|φµφνi. (2.41)
The Hartree energy, given by Eq. (2.22), is then approximated as ˜ Eh = 1 2( ˜ρ| ˜ρ) = 1 2d †Vd, (2.42) where Vpq = (Ωp|Ωq) (2.43)
is a two-index ERI. An analysis of the error
Eh− ˜Eh =
1
2{(ρ|ρ) − (˜ρ| ˜ρ)} = 1
2{(ρ − ˜ρ|ρ − ˜ρ) + 2(ρ − ˜ρ| ˜ρ)} (2.44) between the exact and the fitted Hartree energy shows that it contains terms linear and quadratic in the fitting error ρ − ˜ρ in the electron density. The form of Eq. (2.44) therefore suggests the alternative approximation
˜ Ehrob = (ρ| ˜ρ) − 1 2( ˜ρ| ˜ρ) = b † d −1 2d † Vd (2.45)
which goes back to Dunlap et al. [155] In Eq. (2.45) the elements of the vector b are defined as
bp = (Ωp|ρ) =
X
µ,ν
bµνp Pµν (2.46)
with the three-index ERIs
bµνp = (Ωp|φµφν). (2.47)
Fitting expressions of this kind are called robust since the error
Eh− ˜Ehrob =
1
2{(ρ|ρ) − 2(ρ|˜ρ) + ( ˜ρ| ˜ρ)} = 1
is always quadratic in the fitting error ρ − ˜ρ. The robust energy expression (2.45) is also variational because it is a lower bound to the exact Hartree energy,
˜
Ehrob ≤ Eh, (2.49)
which follows directly from Eq. (2.48). In other words, the expansion coefficients dp have been determined in such a way as to maximize the robust approximation
to the Hartree energy. Therefore, derivatives of the expansion coefficients will not appear in expressions for the gradient of the energy if robust fitting is per- formed. The concepts of robust and variational fitting in various contexts have been thoroughly discussed by Dunlap [155, 165–172].
For a generally fitted case one obtains ˜ Vh,µν = ∂ ˜Eh ∂Pµν = ∂ ∂Pµν 1 2d † Vd = ∂d † ∂Pµν Vd (2.50)
for the matrix elements of the Hartree potential and the derivatives of the fitting coefficients are required. These are given as
∂d ∂Pµν
= W−1 ∂a ∂Pµν
= W−1aµν, (2.51) which follows from Eqs. (2.39) and (2.40). The approximated matrix elements of the Hartree potential thus become
˜
Vh,µν = aµν
†
W−1Vd. (2.52)
For robust fitting the approximated matrix elements are given as ˜ Vh,µνrob = ∂ ˜E rob h ∂Pµν = bµν†d + aµν†W−1{b − Vd} . (2.53) It is not possible to say much about the quality of the fitted matrix elements ˜Vh,µν
given by Eq. (2.52). For the robust approximation ˜Vrob
h,µν [Eq. (2.53)], however,
the first term on the right hand side is (φµφν|˜ρ) and the term in the brackets is
(Ω|ρ − ˜ρ). Thus, the approximation of the matrix elements will be good, if the fit for the electron density is sufficiently accurate.
If the Coulomb norm Eq. (2.35) is employed in the fitting procedure, then W = V and a = b and the expansion coefficients are obtained from the system of linear equations
with the solution
d = V−1b. (2.55)
The elements of V are two-index ERIs as defined in Eq. (2.43) and b contains three-index ERIs [Eqs. (2.46) and (2.47)].
Now the following equality holds [cf. Eq. (2.54)],
( ˜ρ| ˜ρ) = d†Vd = b†d = (ρ| ˜ρ). (2.56) Thus the linear term in the error of the fitted Hartree energy [Eq. (2.44)] vanishes and the robust and the simple approximation to the Hartree energy become identical, ˜ Ehrob = ˜Eh = 1 2d † Vd. (2.57)
This explains the observation that the Coulomb norm is the best. The derivatives of the fitting coefficients with respect to the elements of the density matrix are in this case given as
∂d ∂Pµν
= V−1bµν (2.58)
and the approximated matrix elements of the Hartree potential become ˜ Vh,µν = ∂d† ∂Pµν Vd = bµν†d = (φµφν|˜ρ). (2.59)
This expression is of course identical to the robust approximation and the error in the matrix elements will be small if the fit of the electron density is good.
Scaling behavior
Before discussing methods fitting individual overlap densities, some conclusions about the scaling behavior of methods fitting the complete electron density shall be drawn. For simplicity, it will be assumed that the Coulomb norm has been employed. The formal scaling behavior is O(N3) for the evaluation of the ERIs
since only two- and three-index quantities Vpq and bµνp have to be evaluated.
Due to the long-range nature of the Coulomb interaction the asymptotic scal- ing behavior remains O(N2) like for the four-index ERIs, however with a much
smaller prefactor. The number of ERIs that need to be explicitly evaluated is much smaller because the number of required fitting functions Ωp is considerably
smaller than the number of significant overlap densities φµφν generated from the
AO basis set. A speed-up by more than a factor of 10 is generally achieved and the computational expense is typically dominated by the numerical quadrature for the evaluation of the XC energy and its matrix elements [127]. The necessity to compute at most three-center ERIs is furthermore very appealing since these can be evaluated with a much simpler algorithm than for the general case [173]. The determination of the expansion coefficients requires the inversion of the ma- trix V whose dimension grows linearly with the system size. The computational effort for such a matrix inversion grows cubically with the dimension of the ma- trix. Although the prefactor is rather small, the O(N3) scaling of this matrix inversion might therefore become dominant for very large systems. The actual determination of the expansion coefficients from Eq. (2.55) is done in O(N2)
operations in each SCF iteration.
There have also been efforts to restrict the fit basis in such density fitting methods. They are based on a partitioning of the total electron density into con- tributions from different regions in space. The approach of Baerends et al. [153] relies on the decomposition into atom pair densities according to
ρ(r) = X A≥B (2 − δAB)ρAB(r), (2.60) with ρAB(r) = X µA,νB PµAνBφµA(r)φνB(r). (2.61)
The additional subscript (A, B) indicates the particular atom on which an AO is located. Each of these atom pair densities is fitted individually using only fit functions located on the respective atoms A and B. Thus, the fitting procedure requires O(N2) inversions of matrices V
[AB] of size-independent dimension. At
the same time the integrals of the inhomogeneity of the system of linear equations (2.54) for the determination of the expansion coefficients reduce to two-center in- tegrals of the type bµAνB
pA = (ΩpA|φµAφνB). The resulting formal O(N
2) scaling
for the fitting procedure reduces to linear scaling in the asymptotic regime be- cause the number of significant atom pair densities is O(N ) [126, 174]. For the evaluation of the approximated matrix elements ˜Vh,µν of the Hartree potential
according to Eq. (2.59), however, three-index ERIs bµν
required. This yields a formal O(N3) scaling behavior for the evaluation of the
ERIs which reduces to O(N2) in the asymptotic limit, just as for methods fitting
the complete electron density. If the matrix elements of the Hartree potential are evaluated by numerical quadrature, as is actually done in the work of Baerends et al. [153], then the Hartree potential has to be first evaluated at each grid point. This is a formal O(N2) process because the number of fitting functions scales lin-
early as in the worst case does the number of sampling points for the potential. Because the Coulomb interaction is long range, this scaling behavior cannot be reduced by simple cut-off schemes [126, 174]. The subsequent evaluation of the matrix elements is a formal O(N3) process which can be reduced to O(N ) in the asymptotic limit by employing cut-off techniques similar to the ones used for the XC quadrature. The density fitting procedure can also be implemented in O(N ) versions by employing a divide-and-conquer (DAC) approach for the partitioning of the electron density [175–179]. The formal and asymptotic scaling behavior for the evaluation of the matrix elements of the Hartree potential, however, remains in any case O(N3) and O(N2), respectively. Note that simple fitting expressions which work with a different expansion basis for different parts of a subdivided electron density are neither robust nor variational. It should finally be mentioned that a subdivision of the electron density enables a trivial parallelization of the density fitting process.
Auxiliary basis sets for the density expansion
The choice of an auxiliary basis for the expansion of the electron density is cer- tainly a topic that requires extensive and lengthy experimentation. However, in order to reproduce SCF total energies with good accuracy, it has been shown that the reproduction of the behavior of the exact expansion near the atomic nuclei is important [157]. Therefore, the expansion basis set should include one-center products of the AO basis set, which account for by far the largest contributions to the total electron density. Consequently, the auxiliary functions should cover the range of the sums of the exponents and angular momentum quantum numbers of the original basis functions. In practice, it is sufficient to use a relatively short, even-tempered expansion ranging between the highest and lowest exponent given by this recipe [180–182]. Efficient and at the same time accurate auxiliary basis
sets for the density expansion are available [127, 183]. The exponents of these basis sets fulfill a dependence similar to the definition of an even-tempered basis and have been optimized by exploiting the variational property of the approx- imated energy expression, Eq. (2.49). An increase of computational efficiency has recently been achieved by the substitution of a large part of the expansion functions by so-called Poisson functions. Although in this case the total number of expansion functions required for the density fit increases, the major part of the ERIs become simple overlap integrals without further approximation [128, 184].