29 lines
1022 B
Mathematica
29 lines
1022 B
Mathematica
|
function VDk = calculateVDkWithCutoff(~, rcut, Transf, Params, VParams)
|
||
|
% == Calculating the DDI potential in Fourier space with appropriate cutoff == %
|
||
|
|
||
|
% Interaction in K space
|
||
|
QX = Transf.KX*VParams.ell_eff/sqrt(2);
|
||
|
QY = Transf.KY*VParams.ell_eff/sqrt(2);
|
||
|
|
||
|
Qsq = QX.^2 + QY.^2;
|
||
|
absQ = sqrt(Qsq);
|
||
|
QDsq = QX.^2*cos(Params.eta)^2 + QY.^2*sin(Params.eta)^2;
|
||
|
|
||
|
%Bare interaction
|
||
|
Fpar = -1 + 3*sqrt(pi)*QDsq.*erfcx(absQ)./absQ;
|
||
|
Fperp = 2 - 3*sqrt(pi).*absQ.*erfcx(absQ);
|
||
|
Fpar(absQ == 0) = -1; %Fpar(isinf(Fpar)) = -1;
|
||
|
|
||
|
%Full DDI
|
||
|
VDk = (Fpar*sin(Params.alpha)^2 + Fperp*cos(Params.alpha)^2);
|
||
|
|
||
|
%Implementing a cutoff:
|
||
|
VDr = ifftn(VDk);
|
||
|
VDr = fftshift(VDr);
|
||
|
|
||
|
R = sqrt(Transf.X.^2+Transf.Y.^2) < 0.9*rcut;
|
||
|
VDr = VDr.*double(R);
|
||
|
VDr = ifftshift(VDr);
|
||
|
VDk = fftn(VDr);
|
||
|
|
||
|
end
|