next up previous contents
Next: ``test_atomsC.c'': Carbon Up: ``test_atoms.c'' Previous: ``test_atoms.c''

Debugging

 

Run your test_atoms.c for hydrogen (which has 1 1s electron) with (a) the VWN form for the exchange-correlation functional, (b) N=4000 intervals, (c) the change of variables tex2html_wrap_inline448 , and (d) tex2html_wrap_inline446 . After about about 50 iterations, you should converge to a value of about -0.445671. Compare your result with the ``official'' result at

http://math.nist.gov/DFTdata/atomdata/tables/01H.html
(Note that we are using the local density approximation (LDA) to density functional theory.)

Hint: The following code fragment gives an example of a suitable initialization of our arrays for hydrogen:

  Z=1.; /* Charge on nucleus */
  lmax=0; /* Only s states are filled in H */

  nmax=ivector(0,lmax); /* Make space for nmax[] */
  nmax[0]=0; /* For s states, we only need the first, 1s, with zero nodes */

  /* Find nmaxmax=max{nmax} */
  nmaxmax=0;
  for (l=0; l<=lmax; l++)
    if (nmax[l]>nmaxmax) nmaxmax=nmax[l];

  F=dmatrix(0,lmax,0,nmaxmax);
  F[0][0]=1.; /* There is only one electron in the 1s for H */


Tomas Arias
Wed Mar 8 14:29:40 EST 2000