The final form used for the potential in the code is the vector of
dual coefficients, Vdual=cJdag(O(cJ(V))), where V is the vector of
sample values of the potential. For the pseudopotential, our strategy
will be to compute the expansion coefficients
=cJ(V) directly by
analytically Fourier transforming the pseudopotential in
Eq. (1).
Keeping in mind that we have a periodic copy of the atom at all
positions
, where
is any vector of three
integers, the actual total pseudopotential is
. Thus, the relation between the expansion coefficients
Vps and the pseudopotential is
Combining Eqs. (2-4) gives
, from which we then get the final result needed by the code
Vdual=cJdag(O(
)). To avoid needless heartache, feel free
to cut and past the octave form for the resulting formula,
%# 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)));
Vps=Vps/det(R);
Vdual=cJdag(O(Vps)); %# Dual coefficients
gbl_Vdual=Vdual; %# Export value of global variable