The density functional theory by Hohenberg, Kohn, and Sham^{384, 481} stems from earlier work by
Dirac,^{225} who showed that the exchange energy of a uniform electron gas can be computed exactly from
the charge density along. However, while this traditional *density* functional approach, nowadays called
“orbital-free” DFT, makes a direct connection to the density alone, in practice it is
constitutes a direct approach where the necessary equations contain only the electron density,
difficult to obtain decent approximations for the kinetic energy functional.
Kohn and Sham sidestepped this difficulty via an indirect approach in which the kinetic energy is computed exactly
for a noninteracting reference system, namely, the Kohn-Sham determinant.^{481}
It is the Kohn-Sham approach that first made DFT into a practical tool for calculations.

Within the Kohn-Sham formalism,^{481} the ground state
electronic energy, $E$, can be written as

$$E={E}_{\text{T}}+{E}_{\text{V}}+{E}_{\text{J}}+{E}_{\text{XC}}$$ | (5.1) |

where ${E}_{\text{T}}$ is the kinetic energy, ${E}_{\mathrm{V}}$ is the electron–nuclear interaction energy, ${E}_{\text{J}}$ is the Coulomb self-interaction of the electron density, $\rho (\mathbf{r})$ and ${E}_{\text{XC}}$ is the exchange-correlation energy. Adopting an unrestricted format, the $\alpha $ and $\beta $ total electron densities can be written as

$\begin{array}{cc}\hfill {\rho}_{\alpha}(\mathbf{r})& ={\displaystyle \sum _{i=1}^{{n}_{\alpha}}}{|{\psi}_{i}^{\alpha}|}^{2}\hfill \\ \hfill {\rho}_{\beta}(\mathbf{r})& ={\displaystyle \sum _{i=1}^{{n}_{\beta}}}{|{\psi}_{i}^{\beta}|}^{2}\hfill \end{array}$ | (5.2) |

where ${n}_{\alpha}$ and ${n}_{\beta}$ are the number of alpha and beta electron respectively, and ${\psi}_{i}$ are the Kohn-Sham orbitals. Thus, the total electron density is

$$\rho (\mathbf{r})={\rho}_{\alpha}(\mathbf{r})+{\rho}_{\beta}(\mathbf{r})$$ | (5.3) |

Within a finite basis set, the density is represented by^{738}

$$\rho (\mathbf{r})=\sum _{\mu \nu}{P}_{\mu \nu}{\varphi}_{\mu}(\mathbf{r}){\varphi}_{\nu}(\mathbf{r}),$$ | (5.4) |

where the ${P}_{\mu \nu}$ are the elements of the one-electron density matrix; see Eq. (4.24) in the discussion of Hartree-Fock theory. The various energy components in Eq. (5.1) can now be written

${E}_{\mathrm{T}}$ | $=$ | $\sum _{i=1}^{{n}_{\alpha}}}\u27e8{\psi}_{i}^{\alpha}\left|-{\displaystyle \frac{1}{2}}{\widehat{\nabla}}^{2}\right|{\psi}_{i}^{\alpha}\u27e9+{\displaystyle \sum _{i=1}^{{n}_{\beta}}}\u27e8{\psi}_{i}^{\beta}\left|-{\displaystyle \frac{1}{2}}{\widehat{\nabla}}^{2}\right|{\psi}_{i}^{\beta}\u27e9$ | (5.5) | ||

$=$ | $\sum _{\mu \nu}}{P}_{\mu \nu}\u27e8{\varphi}_{\mu}(\mathbf{r})\left|-{\displaystyle \frac{1}{2}}{\widehat{\nabla}}^{2}\right|{\varphi}_{\nu}(\mathbf{r})\u27e9$ | ||||

${E}_{\mathrm{V}}$ | $=$ | $-{\displaystyle \sum _{A=1}^{M}}{Z}_{A}{\displaystyle \int \frac{\rho (\mathbf{r})}{|\mathbf{r}-{\mathbf{R}}_{A}|}\mathit{d}\mathbf{r}}$ | (5.6) | ||

$=$ | $-{\displaystyle \sum _{\mu \nu}}{P}_{\mu \nu}{\displaystyle \sum _{A}}\u27e8{\varphi}_{\mu}(\mathbf{r})\left|{\displaystyle \frac{{Z}_{A}}{|\mathbf{r}-{\mathbf{R}}_{A}|}}\right|{\varphi}_{\nu}(\mathbf{r})\u27e9$ | ||||

${E}_{\mathrm{J}}$ | $=$ | $\frac{1}{2}}\u27e8\rho ({\mathbf{r}}_{1})\left|{\displaystyle \frac{1}{|{\mathbf{r}}_{1}-{\mathbf{r}}_{2}|}}\right|\rho ({\mathbf{r}}_{2})\u27e9$ | (5.7) | ||

$=$ | $\frac{1}{2}}{\displaystyle \sum _{\mu \nu}}{\displaystyle \sum _{\lambda \sigma}}{P}_{\mu \nu}{P}_{\lambda \sigma}\left(\mu \nu |\lambda \sigma \right)$ | ||||

${E}_{\mathrm{XC}}$ | $=$ | $\int f[\rho (\mathbf{r}),\widehat{\mathbf{\nabla}}\rho (\mathbf{r}),\mathrm{\dots}]\rho (\mathbf{r})\mathit{d}\mathbf{r}}.$ | (5.8) |

Minimizing $E$ with respect to the unknown Kohn-Sham orbital coefficients
yields a set of matrix equations exactly analogous to Pople-Nesbet equations of the UHF case,
Eq. (4.13),
but with modified Fock matrix elements [*cf*. Eq. (4.27)]

$\begin{array}{cc}\hfill {F}_{\mu \nu}^{\alpha}& ={H}_{\mu \nu}^{\mathrm{core}}+{J}_{\mu \nu}-{F}_{\mu \nu}^{\mathrm{XC}\alpha}\hfill \\ \hfill {F}_{\mu \nu}^{\beta}& ={H}_{\mu \nu}^{\mathrm{core}}+{J}_{\mu \nu}-{F}_{\mu \nu}^{\mathrm{XC}\beta}.\hfill \end{array}$ | (5.9) |

Here, ${\mathbf{F}}^{\mathrm{XC}\alpha}$ and ${\mathbf{F}}^{\mathrm{XC}\beta}$ are the exchange-correlation parts of the Fock matrices and depend on the exchange-correlation functional used. UHF theory is recovered as a special case simply by taking ${F}_{\mu \nu}^{\mathrm{XC}\alpha}={K}_{\mu \nu}^{\alpha}$, and similarly for $\beta $. Thus, the density and energy are obtained in a manner analogous to that for the HF method. Initial guesses are made for the MO coefficients and an iterative process is applied until self-consistency is achieved.