Implementation strategy: ``dft.m''

In principle, we need now only modify getE(), getgrad() and H() to perform density functional calculations. In order not to destroy your Schrödinger solver, copy each of the ``.m'' files and ``fftw3.oct'' in your current directory to a new directory where we shall now work. Once this is done, go to your new directory, rename ``sch.m'' to ``dft.m'', and run ``dft.m'' from within octave to confirm that it behaves just as does ``sch.m''. (Don't forget to run ``setup.m'' first!)

Next, we shall make the appropriate changes to getE(), getgrad() and getH(). Because the minimization algorithms are already debugged, we need first only confirm we have an appropriate energy and gradient with the finite difference test, and then we are ready for full density-functional calculations!

To prevent proliferation of output as we run these tests, you may wish to put a ``pause;'' statement immediately after the call to fdtest() in ``dft.m''. Again, you should run ``dft.m'' one last time to confirm all is well.



Tomas Arias 2005-04-15