2024-11-13 18:37:35 +01:00
|
|
|
function [evals, modes] = solveBogoliubovdeGennesIn2D(psi, Params, VDk, VParams, Transf, muchem)
|
2024-11-12 18:50:42 +01:00
|
|
|
|
|
|
|
gs = Params.gs;
|
|
|
|
gdd = Params.gdd;
|
|
|
|
gammaQF = Params.gammaQF;
|
|
|
|
|
2024-11-13 18:37:35 +01:00
|
|
|
KEop = 0.5*(Transf.KX.^2+Transf.KY.^2);
|
2024-11-15 14:33:46 +01:00
|
|
|
Ez = (0.25*VParams.ell^2) + (0.25*Params.gz*VParams.ell^2);
|
2024-11-12 18:50:42 +01:00
|
|
|
muchem_tilde = muchem - Ez;
|
|
|
|
|
2024-11-15 14:33:46 +01:00
|
|
|
g_pf_2D = 1/(sqrt(2*pi)*VParams.ell);
|
|
|
|
gQF_pf_2D = sqrt(2/5)/(pi^(3/4)*VParams.ell^(3/2));
|
2024-11-12 18:50:42 +01:00
|
|
|
|
|
|
|
% eigs only works with column vectors
|
|
|
|
psi = psi.';
|
|
|
|
KEop = KEop.';
|
|
|
|
VDk = VDk.';
|
|
|
|
|
|
|
|
% Interaction Potential
|
|
|
|
frho = fftn(abs(psi).^2);
|
|
|
|
Phi = real(ifftn(frho.*VDk));
|
|
|
|
|
2024-11-12 20:16:09 +01:00
|
|
|
% Operators
|
2024-11-12 18:50:42 +01:00
|
|
|
H = @(w) real(ifft(KEop.*fft(w)));
|
2024-11-13 14:06:07 +01:00
|
|
|
C = @(w) (((g_pf_2D*gs*abs(psi).^2) + (g_pf_2D*gdd*Phi)).*w) + (gQF_pf_2D*gammaQF*abs(psi).^3.*w);
|
|
|
|
muHC = @(w) (-muchem_tilde * w) + H(w) + C(w);
|
|
|
|
X = @(w,psi) (psi.*real(ifft(VDk.*fft(psi.*w)))) + (3/2)*(gQF_pf_2D*gammaQF*abs(psi).^3).*w;
|
2024-11-12 18:50:42 +01:00
|
|
|
|
2024-11-13 14:06:07 +01:00
|
|
|
% Operate in order on g
|
2024-11-12 18:50:42 +01:00
|
|
|
BdG = @(g) muHC(muHC(g) + (2.*X(g)));
|
|
|
|
|
|
|
|
syssize = size(psi);
|
2024-11-13 18:37:35 +01:00
|
|
|
opts.v0 = psi(:);
|
2024-11-12 18:50:42 +01:00
|
|
|
opts.tol = 1e-16;
|
|
|
|
opts.disp = 1;
|
|
|
|
opts.issym = 0;
|
|
|
|
opts.isreal = 1;
|
|
|
|
opts.maxit = 1e4;
|
|
|
|
Neigs = syssize;
|
|
|
|
|
|
|
|
[g,D] = eigs(BdG,syssize,Neigs,'sr',opts);
|
|
|
|
evals = diag(D);
|
|
|
|
clear D;
|
|
|
|
|
|
|
|
% Eigenvalues
|
|
|
|
evals = sqrt(evals);
|
|
|
|
|
2024-11-12 20:16:09 +01:00
|
|
|
% Obtain f from g
|
|
|
|
f = zeros(size(g));
|
|
|
|
for ii = 1:Neigs
|
2024-11-13 14:06:07 +01:00
|
|
|
f(:,:,ii) = (1/evals(ii)) * (muHC(g(:,:,ii)) + (2.*X(g(:,:,ii))));
|
2024-11-12 20:16:09 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
% Obtain u and v from f and g
|
|
|
|
u = (f + g)/2;
|
|
|
|
v = (f - g)/2;
|
|
|
|
|
|
|
|
% Renormalize to \int |u|^2 - |v|^2 = 1
|
|
|
|
for ii=1:Neigs
|
2024-11-13 14:06:07 +01:00
|
|
|
normalization = sum(abs(u(:,:,ii)).^2 - abs(v(:,:,ii)).^2);
|
|
|
|
u(:,:,ii) = u(:,:,ii)/sqrt(normalization);
|
|
|
|
v(:,:,ii) = v(:,:,ii)/sqrt(normalization);
|
2024-11-12 20:16:09 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
modes.u = u'; modes.v = v';
|
|
|
|
modes.g = g'; modes.f = f';
|
|
|
|
|
2024-11-12 18:50:42 +01:00
|
|
|
end
|
|
|
|
|