function sf2=sisf(h,k,l)
% The structure factor2 of silicon crystal for a given h,k,l is calculated.
% Note that the structure factor is normalized by the Si atomic factor


% Si atomic positions
Si1=[0.00000   0.00000   0.00000];
Si2=[0.00000   0.50000   0.50000];
Si3=[0.50000   0.00000   0.50000];
Si4=[0.50000   0.50000   0.00000];
Si5=[0.75000   0.25000   0.75000];
Si6=[0.25000   0.25000   0.25000];
Si7=[0.25000   0.75000   0.75000];
Si8=[0.75000   0.75000   0.25000];


Hc=[ h; k ; l];
sfr=cos(2*pi*(Si1*Hc))+cos(2*pi*(Si2*Hc))+cos(2*pi*(Si3*Hc))+cos(2*pi*(Si4*Hc))+cos(2*pi*(Si5*Hc))+cos(2*pi*(Si6*Hc))+cos(2*pi*(Si7*Hc))+cos(2*pi*(Si8*Hc));
sfi=sin(2*pi*(Si1*Hc))+sin(2*pi*(Si2*Hc))+sin(2*pi*(Si3*Hc))+sin(2*pi*(Si4*Hc))+sin(2*pi*(Si5*Hc))+sin(2*pi*(Si6*Hc))+sin(2*pi*(Si7*Hc))+sin(2*pi*(Si8*Hc));
sf2=sfr*sfr+sfi*sfi;
end;