Compute the total KS potential in real space.
Compute the derivative of the three terms with respect to the Fourier coefficients of the states:
- Use a 3D-FFT to put the reciprocal portion (from Hartree and local external) into real space on the discrete grid.
- Add the two contributions to the KS potential.
Compute the non-local energy and kinetic energy of non-interacting electrons and the derivatives.
- Use 3D-FFTs to compute the real space rep. of each state.
- Multiply the state by the KS potential
- 3D-FFT the product back to real space to produce the exact derivative of the energy expression evaluated.
Evolve the Fourier coefficients of states towards the minima using a solver (e.g. constrained conjugate gradient).
Enforce Orthonormality : Fix finite step size errors in the solver.