Modification to be able to pass new values to variational parameters via the options struct.
This commit is contained in:
parent
e3f9c7b352
commit
7bdfb6af51
@ -60,13 +60,19 @@ OptionsStruct.ScatteringLength = 98.0676; % Critical point: 102.515;
|
|||||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
||||||
OptionsStruct.TrapPotentialType = 'None';
|
OptionsStruct.TrapPotentialType = 'None';
|
||||||
|
|
||||||
OptionsStruct.NumberOfGridPoints = [128, 128];
|
OptionsStruct.NumberOfGridPoints = [256, 256];
|
||||||
OptionsStruct.Dimensions = [7.5, 7.5]; % Critical point: 6.996; Triangular phase: 7.5; Stripe phase: 6.972; Honeycomb phase: 6.239 for both for Atom Number fixed to 1E5
|
OptionsStruct.Dimensions = [7.5, 7.5]; % Critical point: 6.996; Triangular phase: 7.5; Stripe phase: 6.972; Honeycomb phase: 6.239 for both for Atom Number fixed to 1E5
|
||||||
OptionsStruct.TimeStepSize = 200E-6; % in s
|
OptionsStruct.TimeStepSize = 200E-6; % in s
|
||||||
OptionsStruct.TimeCutOff = 100; % in s
|
OptionsStruct.TimeCutOff = 100; % in s
|
||||||
OptionsStruct.EnergyTolerance = 5E-10;
|
OptionsStruct.EnergyTolerance = 5E-10;
|
||||||
OptionsStruct.ResidualTolerance = 1E-05;
|
OptionsStruct.ResidualTolerance = 1E-05;
|
||||||
|
|
||||||
|
OptionsStruct.MaxIterations = 20;
|
||||||
|
OptionsStruct.VariationalWidth = 4;
|
||||||
|
OptionsStruct.WidthLowerBound = 5;
|
||||||
|
OptionsStruct.WidthUpperBound = 8;
|
||||||
|
OptionsStruct.WidthCutoff = 1e-3;
|
||||||
|
|
||||||
OptionsStruct.JobNumber = 1;
|
OptionsStruct.JobNumber = 1;
|
||||||
OptionsStruct.RunOnGPU = false;
|
OptionsStruct.RunOnGPU = false;
|
||||||
OptionsStruct.SaveData = true;
|
OptionsStruct.SaveData = true;
|
||||||
|
@ -17,6 +17,12 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
|||||||
EnergyTolerance;
|
EnergyTolerance;
|
||||||
ResidualTolerance;
|
ResidualTolerance;
|
||||||
|
|
||||||
|
MaxIterations;
|
||||||
|
VariationalWidth;
|
||||||
|
WidthLowerBound;
|
||||||
|
WidthUpperBound;
|
||||||
|
WidthCutoff;
|
||||||
|
|
||||||
Calculator;
|
Calculator;
|
||||||
|
|
||||||
SimulationParameters;
|
SimulationParameters;
|
||||||
@ -60,6 +66,16 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
|||||||
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
addParameter(p, 'ResidualTolerance', 1e-10,...
|
addParameter(p, 'ResidualTolerance', 1e-10,...
|
||||||
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
|
addParameter(p, 'MaxIterations', 20,...
|
||||||
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
|
addParameter(p, 'VariationalWidth', 4,...
|
||||||
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
|
addParameter(p, 'WidthLowerBound', 2,...
|
||||||
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
|
addParameter(p, 'WidthUpperBound', 12,...
|
||||||
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
|
addParameter(p, 'WidthCutoff', 1e-2,...
|
||||||
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
addParameter(p, 'JobNumber', 1,...
|
addParameter(p, 'JobNumber', 1,...
|
||||||
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
addParameter(p, 'RunOnGPU', false,...
|
addParameter(p, 'RunOnGPU', false,...
|
||||||
@ -86,6 +102,13 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
|||||||
this.TimeCutOff = p.Results.TimeCutOff;
|
this.TimeCutOff = p.Results.TimeCutOff;
|
||||||
this.EnergyTolerance = p.Results.EnergyTolerance;
|
this.EnergyTolerance = p.Results.EnergyTolerance;
|
||||||
this.ResidualTolerance = p.Results.ResidualTolerance;
|
this.ResidualTolerance = p.Results.ResidualTolerance;
|
||||||
|
|
||||||
|
this.MaxIterations = p.Results.MaxIterations;
|
||||||
|
this.VariationalWidth = p.Results.VariationalWidth;
|
||||||
|
this.WidthLowerBound = p.Results.WidthUpperBound;
|
||||||
|
this.WidthUpperBound = p.Results.WidthUpperBound;
|
||||||
|
this.WidthCutoff = p.Results.WidthCutoff;
|
||||||
|
|
||||||
this.JobNumber = p.Results.JobNumber;
|
this.JobNumber = p.Results.JobNumber;
|
||||||
this.RunOnGPU = p.Results.RunOnGPU;
|
this.RunOnGPU = p.Results.RunOnGPU;
|
||||||
this.DebugMode = p.Results.DebugMode;
|
this.DebugMode = p.Results.DebugMode;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function [psi] = propagateWavefunction(this, psi, Params, VParams, Transf, VDk, V, t_idx, Observ)
|
function [psi, Observ] = propagateWavefunction(this, psi, Params, VParams, Transf, VDk, V, t_idx, Observ)
|
||||||
set(0,'defaulttextInterpreter','latex')
|
set(0,'defaulttextInterpreter','latex')
|
||||||
set(groot, 'defaultAxesTickLabelInterpreter','latex'); set(groot, 'defaultLegendInterpreter','latex');
|
set(groot, 'defaultAxesTickLabelInterpreter','latex'); set(groot, 'defaultLegendInterpreter','latex');
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ function [Params, Transf, psi, V, VDk] = run(this)
|
|||||||
mkdir(sprintf(this.SaveDirectory))
|
mkdir(sprintf(this.SaveDirectory))
|
||||||
mkdir(sprintf('./Data/Run_%03i',Params.njob))
|
mkdir(sprintf('./Data/Run_%03i',Params.njob))
|
||||||
fminconoptions = optimoptions('fmincon','Display','off','StepTolerance',1e-8);
|
fminconoptions = optimoptions('fmincon','Display','off','StepTolerance',1e-8);
|
||||||
|
|
||||||
|
|
||||||
[psi,V,VDk] = this.initialize(Params,VParams,Transf);
|
[psi,V,VDk] = this.initialize(Params,VParams,Transf);
|
||||||
ells(1) = VParams.ell;
|
ells(1) = VParams.ell;
|
||||||
@ -49,7 +48,7 @@ function [Params, Transf, psi, V, VDk] = run(this)
|
|||||||
psi = psi + 0.25*noise;
|
psi = psi + 0.25*noise;
|
||||||
|
|
||||||
% --- Run ---
|
% --- Run ---
|
||||||
[psi] = this.propagateWavefunction(psi, Params, VParams, Transf, VDk, V, t_idx, Observ);
|
[psi, Observ] = this.propagateWavefunction(psi, Params, VParams, Transf, VDk, V, t_idx, Observ);
|
||||||
psi = gather(psi);
|
psi = gather(psi);
|
||||||
|
|
||||||
% --- Constrained minimization ---
|
% --- Constrained minimization ---
|
||||||
|
@ -51,15 +51,15 @@ function [Params] = setupParameters(this)
|
|||||||
|
|
||||||
% ================ Variational method parameters ================ %
|
% ================ Variational method parameters ================ %
|
||||||
% FMinCon Settings
|
% FMinCon Settings
|
||||||
Params.SelfConIter = 20; % Max number of iterations to perform self-consistent calculation
|
Params.SelfConIter = this.MaxIterations; % Max number of iterations to perform self-consistent calculation
|
||||||
Params.ell = 4; % initial [ell], ell is the "width" - psi ~ e^(z^2/ell^2)
|
Params.ell = this.VariationalWidth; % initial [ell], ell is the "width" - psi ~ e^(z^2/ell^2)
|
||||||
|
|
||||||
% Window of optimization
|
% Window of optimization
|
||||||
Params.ell_lower = 0.2;
|
Params.ell_lower = this.WidthLowerBound;
|
||||||
Params.ell_upper = 12;
|
Params.ell_upper = this.WidthUpperBound;
|
||||||
|
|
||||||
% Relative cutoffs
|
% Relative cutoffs
|
||||||
Params.ellcutoff = 1e-2;
|
Params.ellcutoff = this.WidthCutoff;
|
||||||
|
|
||||||
% ================ Parameters defined by those above ================ %
|
% ================ Parameters defined by those above ================ %
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user