DFT Notes
These are notes.
Algorithmically, DFT will differ from Hartee-Fock primarily in the fact that we need to compute two additional quantities:
the exchange-correlation (XC) energy, \(E^{XC}\left[\rho\left(\vec{r}\right)\right]\), and
the XC potential, \(V^{XC}\left[\rho\left(\vec{r}\right)\right]\),
both of which are functionals of the electron density of the system, \(\rho\left(\vec{r}\right)\). By definition, \(V^{XC}\left[\rho\left(\vec{r}\right)\right]\) is:
or rearranging for \(E^{XC}\left[\rho\left(\vec{r}\right)\right]\):
Conceptually, \(E^{XC}\left[\rho\left(\vec{r}\right)\right]\) is the XC contribution to the electronic energy and \(V^{XC}\left[\rho\left(\vec{r}\right)\right]\) is the potential needed to make the non-interacting system have the same density as the real system. Unfortunately, we do not know the analytic form of \(E^{XC}\left[\rho\left(\vec{r}\right)\right]\) (or equivalently \(V^{XC}\left[\rho\left(\vec{r}\right)\right]\)) and likely never will.
To make progress, we need to introduce an ansantze for either \(E^{XC}\left[\rho\left(\vec{r}\right)\right]\) or \(V^{XC}\left[\rho\left(\vec{r}\right)\right]\). To do this we define a quantity \(f\left[\rho\left(\vec{r}\right), \cdots\right]\) called the XC energy density which is the XC energy per infinitesimal volume \(d\vec{r}\). In terms of \(f\left[\rho\left(\vec{r}\right), \cdots\right]\), \(E^{XC}\left[\rho\left(\vec{r}\right)\right]\) is written as:
Related to \(f\left[\rho\left(\vec{r}\right), \cdots\right]\) is a quantity \(\epsilon\left[\rho\left(\vec{r}\right), \cdots\right]\) which is the XC energy per unit particle. The exact relationship between the two is:
It should be noted that, unlike \(V^{XC}\left[\rho\left(\vec{r}\right)\right]\) and \(E^{XC}\left[\rho\left(\vec{r}\right)\right]\), \(f\left[\rho\left(\vec{r}\right), \cdots\right]\) and \(\epsilon\left[\rho\left(\vec{r}\right), \cdots\right]\) will in general depend on additional functionals beyond the density.
Warning
Colloquially speaking, “a DFT functional” (e.g., when someone says they used “the BLYP DFT functional”) can refer to the analytic form of \(f\left[\rho\left(\vec{r}\right), \cdots\right]\) or \(\epsilon\left[\rho\left(\vec{r}\right), \cdots\right]\). Making matters worse, \(\epsilon\) is commonly used to denote both quantities. When comparing equations it is critical to distinguish between these two quantities.
XC functionals are typically classified by the parameters that \(f\left[\rho\left(\vec{r}\right), \cdots\right]\) or \(\epsilon\left[\rho\left(\vec{r}\right), \cdots\right]\) depend on. More specifically dependence on:
only \(\rho\left(\vec{r}\right)\) defines the local density approximation (LDA),
\(\rho\left(\vec{r}\right)\) and \(\left|\bigtriangledown\rho\left(\vec{r}\right)\right|^2\) (the square of the gradient of \(\rho\left(\vec{r}\right)\)) defines the generalized gradient approximation (GGA), and
\(\rho\left(\vec{r}\right)\), \(\left|\bigtriangledown\rho\left(\vec{r}\right)\right|^2\), the Laplacian of \(\rho\left(\vec{r}\right)\), and the kinetic energy density defines a meta GGA.
For an LDA we have:
Introduction of AOs
In Kohn-Sham DFT we solve the Kohn-Sham equations in an orbital basis that is obtained as a linear combination of atomic orbitals (AOs). Assume that there are \(N_b\) AOs and let \(\phi_\mu\left(\vec{r}\right)\) be the \(\mu\)-th AO. The equation for \(E^{XC}\left[\rho\left(\vec{r}\right)\right]\) remains unchanged other than \(\rho\left(\vec{r}\right)\) is now:
where \(P_{\mu\nu}\) is the \(\mu\nu\)-th element of the atomic density matrix. In the AO basis set the \(\mu\nu\)-th element of \(V^{XC}\left[\rho\left(\vec{r}\right)\right]\) is:
In the LDA this becomes:
For most DFT functionals, analytic solutions for the above integrals are not known and \(E^{XC}\left[\rho\left(\vec{r}\right)\right]\) and \(V^{XC}\left[\rho\left(\vec{r}\right)\right]\) must be evaluated by quadrature.
Introduction of Quadrature
In solving an integral by quadrature, we make the following approximation:
That is we define a quadrature rule \(\mathcal{Q}\) which is a set of \(N_g\) pairs of the form \(\lbrace w_i, \vec{r}_i\rbrace\). Here, \(w_i\) and \(\vec{r_i}\) are respectively the quadrature weight and real-space location of the \(i\)-th grid point.
At this point it is helpful to define:
which respectively are the values of the density and the \(\mu\)-th AO evaluated at the \(i\)-th grid point. Similarly, we define:
which are the energy density, and the “derivative of the energy density with respect to the density” evaluated at \(\rho_i\).
Using these quantities, \(\rho_i\) is then given by:
where in the second line we defined the common intermediate (the collocation matrix):
Using \(\mathcal{Q}\), \(E^{XC}\left[\rho\left(\vec{r}\right)\right]\) becomes:
and \(V^{XC}\left[\rho\left(\vec{r}\right)\right]\) becomes:
where we defined the intermediate:
As a Sparse Map Problem
While the last sections have described DFT as a tensor problem it’s usually not solved as one. DFT is not usually treated as a tensor problem because:
Large tensors. Grids minimally use about 1000 grid points per atom (higher- quality grids tend to be order 10,000) and most AO basis sets have order 10 basis functions per atom. Tensors like \(\phi_{\mu i}\) then have minimally “10,000 times number of atoms squared” elements, meaning the tensor for 100 atoms already requires gigabytes of memory.
Sparsity. Most DFT quantities are local. So if basis functions for a tensor element are spatially far a part, the element is usually close to zero.
To describe the sparsity we introduce sparse maps. Given two basis sets, \(A\) and \(B\), the sparse map \(L\) maps each basis function in \(A\) to a subset of the basis functions in \(B\). Assume we have some tensor with elements \(T_{ab}\) where \(a\) indexes basis functions in \(A\) and \(b\) indexes basis functions in \(B\). For a given value of \(a\), the non-zero elements of \(T_{ab}\) are those such that \(b\) is in \(L(a)\).
In DFT, we use atom-centered grids and AOs. It is therefore common to define sparse maps \(L(A\rightarrow i)\) and \(L(A\rightarrow \mu)\) which respectively map atom indices to grid points and atom indices to AOs. Using these maps the equation for the density becomes:
where an index like \(i_A\) is shorthand for restricting the value of \(i\) to those afforded by the sparse map \(L(A\rightarrow i)\). Applying the same logic to the other DFT quantities:
Finally, the equation for \(E^{XC}\left[\rho\left(\vec{r}\right)\right]\) becomes:
Of note, for a given grid we expect the number of grid points associated with an atom to be roughly constant. Similarly, for a given AO basis set we expect the number of AOs associated with an atom to also be roughly constant. This means that cost to form all quantities will scale linearly with the number of atoms.