2024-11-13 18:36:50 +01:00
|
|
|
function [psi,V,VDk] = initialize(this,Params,VParams,Transf)
|
|
|
|
|
2024-11-15 22:09:15 +01:00
|
|
|
% == User-defined potential == %
|
|
|
|
V = this.Potential;
|
|
|
|
assert(~anynan(V), 'Potential not defined! Specify as <SimulatorObject>.Potential = <PotentialsObject>.trap() + <AdditionalTerms>.');
|
2024-11-13 18:36:50 +01:00
|
|
|
|
|
|
|
% == Calculating the DDIs == %
|
|
|
|
if isfile(strcat(this.SaveDirectory, '/VDk_M.mat'))
|
|
|
|
VDk = load(sprintf(strcat(this.SaveDirectory, '/VDk_M.mat')));
|
|
|
|
VDk = VDk.VDk;
|
|
|
|
else
|
2024-11-15 22:09:15 +01:00
|
|
|
VDk = this.Calculator.calculateVDkWithCutoff(Transf, Params, VParams);
|
2024-11-13 18:36:50 +01:00
|
|
|
save(sprintf(strcat(this.SaveDirectory, '/VDk_M.mat')),'VDk');
|
2024-11-14 15:03:38 +01:00
|
|
|
fprintf('Computed and saved DDI potential in Fourier space with cutoff.\n')
|
2024-11-13 18:36:50 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
% == Setting up the initial wavefunction == %
|
|
|
|
psi = this.setupWavefunction(Params,Transf);
|
|
|
|
|
|
|
|
if this.RunOnGPU
|
|
|
|
psi = gpuArray(psi);
|
|
|
|
end
|
|
|
|
end
|