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