Density functional theory is a computational method used in statistical mechanics to calculate the energy of a system of interacting particles. It is based on the idea that the energy of a system can be determined by the density of the particles in the system.