Calculations/Dipolar-Gas-Simulator/+Variational2D/@DipolarGas/initialize.m

26 lines
837 B
Matlab

function [psi,V,VDk] = initialize(this,Params,VParams,Transf)
format long
X = Transf.X; Y = Transf.Y;
rcut = min(Transf.Xmax,Transf.Ymax);
% == Potential == %
V = 0.5*(Params.gx.*X.^2+Params.gy.*Y.^2);
% == Calculating the DDIs == %
if isfile(strcat(this.SaveDirectory, '/VDk_M.mat'))
VDk = load(sprintf(strcat(this.SaveDirectory, '/VDk_M.mat')));
VDk = VDk.VDk;
else
VDk = this.Calculator.calculateVDkWithCutoff(rcut, Transf, Params, VParams);
save(sprintf(strcat(this.SaveDirectory, '/VDk_M.mat')),'VDk');
end
fprintf('Computed and saved DDI potential in Fourier space with cutoff.\n')
% == Setting up the initial wavefunction == %
psi = this.setupWavefunction(Params,Transf);
if this.RunOnGPU
psi = gpuArray(psi);
end
end