Additions to ``setup.m''

The script ``setup.m'' is an appropriate place to put the locations of the ionic cores, which we shall store in an $n\times3$ matrix X, and their charges, which we shall call Z. In ``setup.m'', immediately after your statements defining the FFT box size S and the lattice vectors R, place the statements

%# Define atomic locations and nuclear charge
X=[0 0 0; 1.75 0 0]; Z=1;
which specifies two protons ($Z=1$) at a distance of 1.75 bohr, an example we will consider shortly when we compute the bond length of $H_2$ within density-functional theory.

Finally, the information about the atomic locations is best conveyed to the other parts of our program through the ``structure factor'' derived above

\begin{displaymath}
S_f(\vec G) \equiv \sum_{I} e^{-i \vec G \cdot \vec X_I},
\end{displaymath} (8)

where $I$ ranges over the atomic cores and $\vec X_I$ is the location of the $I^{\mbox{th}}$ core. To evaluate this quantity for the remainder of the program, place the statements
%# Computation of structure factor
Sf=sum( exp(-i*G*X'), 2);
immediately after the computation of the matrix G and the vector G2.

Debugging: Confirm that ``setup.m'' continues to run without error.

Tomas Arias 2006-04-05