Latest version of solver with additions to initialize with modulated states to bias the solver.
This commit is contained in:
parent
10ed5472af
commit
684f419cdd
@ -18,6 +18,9 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
||||
ResidualTolerance;
|
||||
NoiseScaleFactor;
|
||||
|
||||
BiasWithAnsatz;
|
||||
Ansatz;
|
||||
|
||||
MaxIterations;
|
||||
VariationalWidth;
|
||||
WidthLowerBound;
|
||||
@ -85,6 +88,10 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
||||
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||
addParameter(p, 'JobNumber', 0,...
|
||||
@(x) assert(isnumeric(x) && isscalar(x) && (x >= 0)));
|
||||
addParameter(p, 'BiasWithAnsatz', false,...
|
||||
@islogical);
|
||||
addParameter(p, 'Ansatz', 'None',...
|
||||
@ischar);
|
||||
addParameter(p, 'IncludeDDICutOff', true,...
|
||||
@islogical);
|
||||
addParameter(p, 'PlotLive', false,...
|
||||
@ -115,6 +122,9 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
||||
this.ResidualTolerance = p.Results.ResidualTolerance;
|
||||
this.NoiseScaleFactor = p.Results.NoiseScaleFactor;
|
||||
|
||||
this.BiasWithAnsatz = p.Results.BiasWithAnsatz;
|
||||
this.Ansatz = p.Results.Ansatz;
|
||||
|
||||
this.MaxIterations = p.Results.MaxIterations;
|
||||
this.VariationalWidth = p.Results.VariationalWidth;
|
||||
this.WidthLowerBound = p.Results.WidthLowerBound;
|
||||
|
@ -1,5 +1,8 @@
|
||||
function [psi] = setupWavefunction(~,Params,Transf)
|
||||
function [psi] = setupWavefunction(this, Params, Transf)
|
||||
|
||||
if this.BiasWithAnsatz
|
||||
psi = this.setupCosineModulatedAnsatz(Params, Transf);
|
||||
else
|
||||
format long
|
||||
|
||||
X = Transf.X;
|
||||
@ -16,5 +19,5 @@ function [psi] = setupWavefunction(~,Params,Transf)
|
||||
psi = exp(-(X-X0).^2/Rx^2-(Y-Y0).^2/Ry^2);
|
||||
Norm = sum(abs(psi(:)).^2)*Transf.dx*Transf.dy;
|
||||
psi = sqrt(Params.N)*psi/sqrt(Norm);
|
||||
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user