

Construct the real space representation of the density, n(r) :
 Use 3DFFTs to convert gspace representation of each state to its rspace representation on a discrete grid of points.
 Modulus square each state in real space and sum to obtain n(r).
Construct the gspace representation of the density, n(g):
 Use a 3DFFT of n(r) to compute n(g). This procedure is exact for a finite plane wave basis.
Using n(r) :
 Compute the exchange correlation energy using trapezoidal rule integration (not exact).
 Compute the exchange correlation potential to the rspace representation of the KS potential.
Using n(g) :
 Compute the local electronion interaction (exact).
 Compute the Hartree energy (exact).
 Add the eatom and Hartree contributions to the gspace representation of the exchange correlation potential.


