Cosmetic changes, minor parameter tweaks for faster convergence.

This commit is contained in:
Karthik 2024-11-20 15:05:47 +01:00
parent 72c2b17d36
commit 34a11f0c6a
5 changed files with 8 additions and 9 deletions

View File

@ -24,7 +24,7 @@ OptionsStruct.TrapPotentialType = 'None';
OptionsStruct.NumberOfGridPoints = [256, 256];
OptionsStruct.Dimensions = [100, 100];
OptionsStruct.TimeStepSize = 100E-6; % in s
OptionsStruct.TimeStepSize = 500E-6; % in s
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
OptionsStruct.TimeCutOff = 2E6; % in s
OptionsStruct.EnergyTolerance = 5E-10;
@ -35,7 +35,7 @@ OptionsStruct.MaxIterations = 20;
OptionsStruct.VariationalWidth = 5.7;
OptionsStruct.WidthLowerBound = 0.2;
OptionsStruct.WidthUpperBound = 12;
OptionsStruct.WidthCutoff = 1e-3;
OptionsStruct.WidthCutoff = 1e-2;
OptionsStruct.PlotLive = false;
OptionsStruct.JobNumber = 1;

View File

@ -1,9 +1,9 @@
function VDk = calculateVDkWithCutoff(~, Transf, Params, VParams)
function VDk = calculateVDkWithCutoff(~, Transf, Params, ell)
% == Calculating the DDI potential in Fourier space with appropriate cutoff == %
% Interaction in K space
QX = Transf.KX*VParams.ell/sqrt(2);
QY = Transf.KY*VParams.ell/sqrt(2);
QX = Transf.KX*ell/sqrt(2);
QY = Transf.KY*ell/sqrt(2);
Qsq = QX.^2 + QY.^2;
absQ = sqrt(Qsq);

View File

@ -9,8 +9,7 @@ function E = calculateVariationalEnergy(this, psi, Params, ell, Transf, V)
normfac = Params.Lx*Params.Ly/numel(psi);
% DDIs
VParams.ell = ell;
VDk = this.calculateVDkWithCutoff(Transf, Params, VParams); % VDk depends on the variational parameters. THIS HAS TO BE RECALCULATED HERE FOR THE CONSTRAINED OPTIMIZATION TO WORK!
VDk = this.calculateVDkWithCutoff(Transf, Params, ell); % VDk depends on the variational parameters. THIS HAS TO BE RECALCULATED HERE FOR THE CONSTRAINED OPTIMIZATION TO WORK!
frho = fftn(abs(psi).^2);
Phi = real(ifftn(frho.*VDk));
Eddi = 0.5*Params.gdd*Phi.*abs(psi).^2/(sqrt(2*pi)*ell);%

View File

@ -4,7 +4,7 @@ function [psi,V,VDk] = initialize(this,Params,VParams,Transf)
assert(~anynan(V), 'Potential not defined! Specify as <SimulatorObject>.Potential = <PotentialsObject>.trap() + <AdditionalTerms>.');
% == Calculating the DDIs == %
VDk = this.Calculator.calculateVDkWithCutoff(Transf, Params, VParams);
VDk = this.Calculator.calculateVDkWithCutoff(Transf, Params, VParams.ell);
% == Setting up the initial wavefunction == %
psi = this.setupWavefunction(Params,Transf);

View File

@ -5,7 +5,7 @@
# Request number of nodes and GPU for job
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --gres=gpu:A40:1
#SBATCH --gres=gpu:A40:2
#SBATCH --mem=8G
# Estimated wallclock time for job
#SBATCH --time=4:00:00