% 3D Diamond Lattice
% Shangping Guo
% Reference data: K M Ho et al, PRL,65-25
% Also see S G Johnson's webpage on his software
% The k0 along the 1BZ is obtained from his website.
% This program yields accurate results,
clear
warning off
%epsa=11.56;
epsa=3.6^2;
epsb=1; %
a=1.0;
tic;
R=sqrt(3)/8*a;%a is the length of the cubic unit cell
i=sqrt(-1);
%define the lattice vectors
a1=[0 1 1]*a/2;
a2=[1 0 1]*a/2;
a3=[1 1 0]*a/2;
%calculate the reciprocal lattice vectors
volcell=dot(a1,cross(a2,a3));
b1=2*pi*cross(a2,a3)/volcell;
b2=2*pi*cross(a3,a1)/volcell;
b3=2*pi*cross(a1,a2)/volcell;
%n=input('please input n: ');
f=2*(4*pi*R^3/3)/volcell;
n=input('Input n:');
%n=3;
NumberofPW=(2*n+1)^3;
display('Forming G vectors...');
count=1;
for x=-n:n,
for y=-n:n,
for z=-n:n,
G(count,:)=x*b1+y*b2+z*b3;
count=count+1;
end
end
end
display('Calculating eps(G-G)...');
r0=[0.125 0.125 0.125];%*[a1;a2;a3]/modulus(a1);
for x=1:NumberofPW,