To specify the periodicity vectors (generally called lattice vectors), add the following statement immediately following the statement specifying S and before the statements computing M and N,
R=diag([6; 6; 6])Note that this means that we'll be working with a cubic unit cell of side length 6 bohr.
Next, add a code block to the bottom of your ``setup.m'' file to form
the lists of real-space sample points r and reciprocal lattice
vectors G from the formulae derived in lecture,
| (2) | |||
| (3) |
Finally, add a statement to create a column vector G2 containing
the square-magnitude of each G-vector.
Hint: For this final part, note that
G.^2produces the squares of each element of G and that
sum(A,d)sums the matrix A along its d-th dimension.
To check your final results from ``setup.m'', you should copy the two
files ``slice.m'' and ``view.m'' from Appendix A and
Appendix B, respectively, into your octave directory.
(To understand more how the view() and slice() functions work, you may
enter ``help slice'' and ``help view'' at the octave prompt after you
have copied the files.) Once you have these functions in your
directory, change the size specification at the top of ``setup.m'' to
that of a
problem (``
''), rerun
``setup.m'', and then enter ``view(G2,S)'' at the octave prompt. This
will then generate plots of slices of
in the n1=0 plane, n2=0,
and n3=0 planes, respectively. In each case, you should see parabolic
surfaces centered on the origin.
Finally, check your result for r by running ``view(r(:,k),S)'' for k=1,2,3 and verifying that you see the correct behavior.
Tomas Arias 2005-04-03