To calculate the electronic structure of the eight atom cell of germanium, make a copy of ``Hatoms.m'' called ``Geatoms.m''. The eight atom cell of germanium has 32 electrons distributed among 16 states; thus, modify ``Geatoms.m'' so that gbl_f=2 and Ns=16.
Next, we need a Fourier-transformed ionic potential for Vps. The
Starkloff-Joannopoulos local pseudopotential for germanium is
Vps=-4*pi*Z./G2; Vps(1)=0.;by cutting and pasting the octave form for the resulting formula below directly into ``Geatoms.m'',
%# Ge pseudopotential
Z=4;
lambda=18.5;
rc=1.052;
Gm=sqrt(G2);
Vps=-2*pi*exp(-pi*Gm/lambda).*cos(Gm*rc).*(Gm/lambda)./(1-exp(-2*pi*Gm/lambda));
for n=0:4
Vps=Vps+(-1)^n*exp(-lambda*rc*n)./(1+(n*lambda./Gm).^2);
end
Vps=Vps.*4*pi*Z./Gm.^2*(1+exp(-lambda*rc))-4*pi*Z./Gm.^2;
n=[1:4];
Vps(1)=4*pi*Z*(1+exp(-lambda*rc))*(rc^2/2+1/lambda^2* ...
(pi^2/6+sum((-1).^n.*exp(-lambda*rc*n)./n.^2)));
Finally, to allow for viewing of the total charge density, add the code block below to the very end of ``Geatoms.m'' (deleting any ``pause'' statements that may remain in your code or statements for viewing individual wave functions).
%# Compute density for final viewing
Y=W*inv(sqrtm(W'*O(W))); %# Orthonormal wave functions
n=getn(Y,gbl_f); %# Charge density
%# Basic slice from ``100'' edge of cell
sl=reshape(n(1:S(1)*S(2)),S(1),S(2));
%# Make and view image
ppm("100.ppm",sl*0.3,sl,sl); system("display 100.ppm &");
%# 110 slice cutting bonds (assumes cube)
sl=reshape(n(find(M(:,2)==M(:,3))),S(1),S(2));
%# Expand by 2, drop data to restore (approximate) aspect ratio
li=find(rem([1:size(sl,1)],3)!=0); sl=sl(li,:);
%# Make and view image
ppm("110.ppm",sl,sl,sl*0.3); system("display 110.ppm &");