``setup.m''

Make the following changes to ``setup.m'' to import the atomic locations and periodic cell size for solid Ge and to compute the structure factor.

  1. Copy ``atoms8.m'' from Appendix C into your current working directory. This program loads the locations of the atoms in crystalline Ge into the array X and the appropriate periodic boundary conditions into the array R. The basic supercell we shall use for the crystal is of cubic shape and contains 8 atoms.
  2. Place the statement
    atoms8;
    
    near the top of ``setup.m'', immediately after where you set S and R but before evaluation of any quantities such as N, M, r, G, etc. This will load the atomic locations and give the appropriate value to R to the result of ``setup.m''.
  3. At the very end of ``setup.m'', place a statement of the form
    Sf= ... G*X ...
    
    which will place the structure factors into the column vector Sf according to the definition in Eq. (5). Note that we do not need to export Sf as a global variable as the programs ``poissonGe.m'' and ``Ge.m'' can access it directly.
    Hint: In octave, for any matrix A, analogously to our previous hint regarding the octave statement ``any(...,2)'', ``sum(A,2)'' produces a column vector equal to the sum of all elements in each row of A.



Subsections
Tomas Arias 2005-05-04