## Introduction

At a very high level, density fitting (DF) is an approximation technique for speeding up calculations at several points by reducing three- and four-center integrals to linear combinations of one- and two-center integrals, enabling the reuse of these intermediate computations with (theoretically) little reduction in accuracy. While its applications have been broadened in recent years, the history of DF begins with computing the integral components of the electronic Hamiltonian, so that's where we will start our discussion as well.

The five parts of the electronic Hamiltonian are the electron kinetic energy, electron-electron repulsion, electron-nuclear attraction, nuclear-nuclear repulsion, and nuclear kinetic energy, as shown in the equation below.

\begin{equation} \hat{H} = \hat{T}_{e} + \hat{V}_{ee} + \hat{V}_{eN} + \hat{V}_{NN} + \hat{T}_{N} \end{equation}Under the Born-Oppenheimer approximation, we can treat the nuclear kinetic energy as zero and reduce our Hamiltonian to four terms. Further, given the stationary nuclei under this approximation, we can also reduce the nuclear-nuclear repulsion term to a constant, leaving only three terms actually requiring integration of our wavefunction. The nuclear repulsion energy is given by the constant expression

\begin{equation} \hat{V}_{NN} = \sum_{A > B} \frac{Z_AZ_B}{R_{AB}} \end{equation}where Z represents the nuclear charge, and \(R_{AB}\) is the distance between nuclei A and B. The remaining integral terms are given by the following

\begin{align} \hat{T}_e + \hat{V}_{eN} + \hat{V}_{ee} = &\int\phi_\mu^*(r)\big(-\frac{1}{2}\nabla_r^2\big)\phi_\nu(r)dr\\ + &\int\phi_\mu^*(r)\big(-\sum_A^N \frac{Z}{r_A}\big)\phi_\nu(r)dr + \int\phi_\mu^*(r_1)\phi_\nu(r_1)\frac{1}{r_{12}}\phi_\lambda^*(r_2)\phi_\sigma(r_2) \end{align}Of these terms, the first two are one-electron terms since the operators depend on the coordinates of a single electron. As such, these are relatively cheap to compute. On the other hand, the third term represents a two-electron integral because the operator \(\frac{1}{r_{12}}\) depends on the coordinates of electrons 1 and 2. This introduces a total of four subscripts into the equation, \(\mu\), \(\nu\), \(\lambda\), and \(\sigma\), in contrast to the two subscripts in the one-electron integrals. In turn, this means that the computational scaling of these integrals will be \(\mathcal{O}(N^4)\), again compared to the \(\mathcal{O}(N^2)\) of the one-electron integrals. While this scaling is not that bad compared to parts of higher levels of theory like MP2 and CCSD, it is much more expensive than the one-electron integrals, making the two-electron integral computations the most expensive portion of the HF procedure.

As touched on above, more important than the number of electrons involved is the number of centers, which is directly tied to the number of subscripts. The kinetic energy term will always be constrained to either one or two centers/subscripts because only two orbitals are involved in the calculation. The nuclear attraction term can involve up to three centers, making the integral somewhat more difficult, because of the presence of two orbitals, \(\phi_\mu\) and \(\phi_\nu\), and a nucleus. Finally, the electron repulsion integrals can involve up to four centers, all of which are orbitals.

Again, this was the original problem that DF sought to solve. Rather than computing these three- and four-centered integrals directly, DF methods approximate them by generating a function of some density and then optimizing, or fitting, the function to minimize the error with respect to some error measurement. This reduces three- and four-centered problems to linear combinations of one- and two-centered problems, which are easier to compute and now reusable, reducing the overall computational cost.