### 6.1 Background Theory

In Hartree–Fock theory, the energy has the form,

E_{HF } = h + J - K + V _{nuc}, | | (6.1) |

where h is the one-electron (kinetic plus potential) energy, J is the classical
Coulomb repulsion of the electrons, K is the exchange energy resulting from
the quantum (fermion) nature of electrons, and V _{nuc} is the nuclear repulsion
energy.
In density functional theory, the exact Hartree–Fock exchange for a single determinant is
replaced by a more general expression, the exchange-correlation functional, which can
include terms accounting for both exchange energy and the electron correlation which is
omitted from Hartree–Fock theory. The DFT energy is expressed as a functional of the
molecular electron density ρ(r),

E_{DFT }[ρ] = T[ρ] + V _{ne}[ρ] + J[ρ] + E_{x}[ρ] + E_{c}[ρ] + V _{nuc}, | | (6.2) |

where T[ρ] is the kinetic energy, V _{ne}[ρ] is the nuclei-electron interaction, E_{x}[ρ] and E_{c}[ρ]
are the exchange and correlation energy functionals.
The exchange and correlation functionals normally used in DFT are integrals of some
function of the density and possibly the density gradient. In addition to pure DFT
methods, dscf and grad modules support hybrid functionals in which the exchange
functional includes the Hartree–Fock exchange, e.g. B3-LYP.