Latest commit
This commit is contained in:
parent
9d187540ad
commit
a1e0ad544e
@ -7,15 +7,15 @@ classdef PhysicsConstants < handle
|
|||||||
ElectronMass=9.10938291E-31;
|
ElectronMass=9.10938291E-31;
|
||||||
GravitationalConstant=6.67384E-11;
|
GravitationalConstant=6.67384E-11;
|
||||||
ProtonMass=1.672621777E-27;
|
ProtonMass=1.672621777E-27;
|
||||||
AtomicMassUnit=1.66053878283E-27;
|
AtomicMassUnit=1.660539066E-27;
|
||||||
BohrRadius=0.52917721092E-10;
|
BohrRadius=5.2917721067E-11;
|
||||||
BohrMagneton=927.400968E-26;
|
BohrMagneton=9.274009994E-24;
|
||||||
BoltzmannConstant=1.380649E-23;
|
BoltzmannConstant=1.38064852E-23;
|
||||||
StandardGravityAcceleration=9.80665;
|
StandardGravityAcceleration=9.80665;
|
||||||
SpeedOfLight=299792458;
|
SpeedOfLight=299792458;
|
||||||
StefanBoltzmannConstant=5.670373E-8;
|
StefanBoltzmannConstant=5.670373E-8;
|
||||||
ElectronCharge=1.602176634E-19;
|
ElectronCharge=1.602176634E-19;
|
||||||
VacuumPermeability=1.25663706212E-6;
|
VacuumPermeability=1.25663706212E-6;
|
||||||
DielectricConstant=8.8541878128E-12;
|
DielectricConstant=8.8541878128E-12;
|
||||||
ElectronGyromagneticFactor=-2.00231930436153;
|
ElectronGyromagneticFactor=-2.00231930436153;
|
||||||
AvogadroConstant=6.02214076E23;
|
AvogadroConstant=6.02214076E23;
|
||||||
@ -23,19 +23,8 @@ classdef PhysicsConstants < handle
|
|||||||
GravitationalAcceleration = 9.80553;
|
GravitationalAcceleration = 9.80553;
|
||||||
|
|
||||||
% Dy specific constants
|
% Dy specific constants
|
||||||
Dy164Mass = 163.929174751*1.66053878283E-27;
|
Dy164Mass = 163.929174751*1.660539066E-27;
|
||||||
Dy164IsotopicAbundance = 0.2826;
|
Dy164IsotopicAbundance = 0.2826;
|
||||||
BlueWavelength = 421.291e-9;
|
|
||||||
BlueLandegFactor = 1.22;
|
|
||||||
BlueLifetime = 4.94e-9;
|
|
||||||
BlueLinewidth = 1/4.94e-9;
|
|
||||||
RedWavelength = 626.086e-9;
|
|
||||||
RedLandegFactor = 1.29;
|
|
||||||
RedLifetime = 1.2e-6;
|
|
||||||
RedLinewidth = 1/1.2e-6;
|
|
||||||
PushBeamWaveLength = 626.086e-9;
|
|
||||||
PushBeamLifetime = 1.2e-6;
|
|
||||||
PushBeamLinewidth = 1/1.2e-6;
|
|
||||||
end
|
end
|
||||||
|
|
||||||
methods
|
methods
|
||||||
|
@ -6,11 +6,10 @@
|
|||||||
|
|
||||||
OptionsStruct = struct;
|
OptionsStruct = struct;
|
||||||
OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution'
|
OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution'
|
||||||
OptionsStruct.ErrorEstimationMethod = 'bootstrap'; % 'jackknife' | 'bootstrap'
|
OptionsStruct.CutoffType = 'Cylindrical';
|
||||||
OptionsStruct.NumberOfAtoms = 5000;
|
OptionsStruct.PotentialType = 'Harmonic';
|
||||||
OptionsStruct.TimeStep = 50e-06; % in s
|
OptionsStruct.TimeStep = 50e-06; % in s
|
||||||
OptionsStruct.SimulationTime = 4e-03; % in s
|
OptionsStruct.SimulationTime = 4e-03; % in s
|
||||||
OptionsStruct.CutoffType = true;
|
|
||||||
OptionsStruct.SaveData = true;
|
OptionsStruct.SaveData = true;
|
||||||
OptionsStruct.SaveDirectory = './Data';
|
OptionsStruct.SaveDirectory = './Data';
|
||||||
options = Helper.convertstruct2cell(OptionsStruct);
|
options = Helper.convertstruct2cell(OptionsStruct);
|
||||||
@ -18,6 +17,7 @@ clear OptionsStruct
|
|||||||
|
|
||||||
sim = Simulator.DipolarGas(options{:});
|
sim = Simulator.DipolarGas(options{:});
|
||||||
calc = Simulator.Calculator(options{:});
|
calc = Simulator.Calculator(options{:});
|
||||||
|
pot = Simulator.Potentials(options{:});
|
||||||
|
|
||||||
%-% Run Simulation %-%
|
%-% Run Simulation %-%
|
||||||
[Params, Transf, psi, V, VDk] = sim.runSimulation(calc);
|
[Params, Transf, psi, V, VDk] = sim.runSimulation(calc);
|
||||||
|
@ -5,8 +5,13 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
|||||||
TimeStep;
|
TimeStep;
|
||||||
SimulationTime;
|
SimulationTime;
|
||||||
NumberOfAtoms;
|
NumberOfAtoms;
|
||||||
ErrorEstimationMethod;
|
|
||||||
|
|
||||||
|
% Etol = 5e-10; % Tolerances
|
||||||
|
% rtol = 1e-5;
|
||||||
|
% cut_off = 2e6; % sometimes the imaginary time gets a little stuck
|
||||||
|
% even though the solution is good, this just stops it going on forever
|
||||||
|
% mindt = 1e-6; %Minimum size for a time step using adaptive dt
|
||||||
|
|
||||||
%Flags
|
%Flags
|
||||||
|
|
||||||
|
|
||||||
@ -25,11 +30,9 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
|||||||
p.KeepUnmatched = true;
|
p.KeepUnmatched = true;
|
||||||
addParameter(p, 'SimulationMode', 'ImaginaryTimeEvolution',...
|
addParameter(p, 'SimulationMode', 'ImaginaryTimeEvolution',...
|
||||||
@(x) any(strcmpi(x,{'ImaginaryTimeEvolution','RealTimeEvolution'})));
|
@(x) any(strcmpi(x,{'ImaginaryTimeEvolution','RealTimeEvolution'})));
|
||||||
addParameter(p, 'ErrorEstimationMethod', 'bootstrap',...
|
|
||||||
@(x) any(strcmpi(x,{'jackknife','bootstrap'})));
|
|
||||||
addParameter(p, 'NumberOfAtoms', 5000,...
|
addParameter(p, 'NumberOfAtoms', 5000,...
|
||||||
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
addParameter(p, 'TimeStep', 10e-06,...
|
addParameter(p, 'TimeStep', 0.0005,...
|
||||||
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
addParameter(p, 'SimulationTime', 3e-03,...
|
addParameter(p, 'SimulationTime', 3e-03,...
|
||||||
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
|
@ -1,27 +1,16 @@
|
|||||||
function [Params] = setupParameters(this)
|
function [Params] = setupParameters(this)
|
||||||
|
|
||||||
%%--%% Parameters %%--%%
|
|
||||||
|
|
||||||
%========= Simulation =========%
|
|
||||||
pert = 0; % 0 = no perturbation during real-time, 1=perturbation
|
|
||||||
%method=1; % 0 = normal dipolar potential, 1=spherical cut-off, 2=cylindrical cut-off
|
|
||||||
|
|
||||||
% Tolerances
|
|
||||||
Params.Etol = 5e-10;
|
|
||||||
Params.rtol = 1e-5;
|
|
||||||
Params.cut_off = 2e6; % sometimes the imaginary time gets a little stuck
|
|
||||||
% even though the solution is good, this just stops it going on forever
|
|
||||||
|
|
||||||
%========= Constants =========%
|
%========= Constants =========%
|
||||||
hbar = 1.0545718e-34; % Planck constant [J.s]
|
CONSTANTS = Helper.PhysicsConstants;
|
||||||
kbol = 1.38064852e-23; % Boltzmann Constant [J/K]
|
hbar = CONSTANTS.PlanckConstantReduced; % [J.s]
|
||||||
mu0 = 1.25663706212e-6; % Vacuum Permeability [N/A^2] --
|
kbol = CONSTANTS.BoltzmannConstant; % [J/K]
|
||||||
muB = 9.274009994e-24; % Bohr Magneton [J/T]
|
mu0 = CONSTANTS.VacuumPermeability; % [N/A^2]
|
||||||
a0 = 5.2917721067e-11; % Bohr radius [m]
|
muB = CONSTANTS.BohrMagneton; % [J/T]
|
||||||
m0 = 1.660539066e-27; % Atomic mass [kg]
|
a0 = CONSTANTS.BohrRadius; % [m]
|
||||||
w0 = 2*pi*100; % Angular frequency unit [s^-1]
|
m0 = CONSTANTS.AtomicMassUnit; % [kg]
|
||||||
mu0factor = 0.3049584233607396; % =(m0/me)*pi*alpha^2 -- me=mass of electron, alpha=fine struct. const.
|
w0 = 2*pi*100; % Angular frequency unit [s^-1]
|
||||||
% mu0=mu0factor *hbar^2*a0/(m0*muB^2)
|
mu0factor = 0.3049584233607396; % =(m0/me)*pi*alpha^2 -- me=mass of electron, alpha=fine struct. const.
|
||||||
|
% mu0=mu0factor *hbar^2*a0/(m0*muB^2)
|
||||||
%=============================%
|
%=============================%
|
||||||
|
|
||||||
% Number of points in each direction
|
% Number of points in each direction
|
||||||
@ -35,7 +24,7 @@ Params.Ly = 40;
|
|||||||
Params.Lz = 20;
|
Params.Lz = 20;
|
||||||
|
|
||||||
% Masses
|
% Masses
|
||||||
Params.m = 164*m0;
|
Params.m = CONSTANTS.Dy164Mass;
|
||||||
l0 = sqrt(hbar/(Params.m*w0)); % Defining a harmonic oscillator length
|
l0 = sqrt(hbar/(Params.m*w0)); % Defining a harmonic oscillator length
|
||||||
|
|
||||||
% Atom numbers
|
% Atom numbers
|
||||||
@ -57,10 +46,6 @@ Params.wx = 2*pi*125;
|
|||||||
Params.wy = 2*pi*125;
|
Params.wy = 2*pi*125;
|
||||||
Params.wz = 2*pi*250;
|
Params.wz = 2*pi*250;
|
||||||
|
|
||||||
% Time step
|
|
||||||
Params.dt = 0.0005;
|
|
||||||
Params.mindt = 1e-6; %Minimum size for a time step using adaptive dt
|
|
||||||
|
|
||||||
% Stochastic GPE
|
% Stochastic GPE
|
||||||
Params.gamma_S = 7.5*10^(-3); % gamma for the stochastic GPE
|
Params.gamma_S = 7.5*10^(-3); % gamma for the stochastic GPE
|
||||||
Params.muchem = 12.64*Params.wz/w0; % fixing the chemical potential for the stochastic GPE
|
Params.muchem = 12.64*Params.wz/w0; % fixing the chemical potential for the stochastic GPE
|
||||||
@ -81,7 +66,7 @@ Params.gx=(Params.wx/w0)^2;
|
|||||||
Params.gy=(Params.wy/w0)^2;
|
Params.gy=(Params.wy/w0)^2;
|
||||||
Params.gz=(Params.wz/w0)^2;
|
Params.gz=(Params.wz/w0)^2;
|
||||||
|
|
||||||
% == Calculating quantum fluctuations == %
|
% == Calculate LHY correction == %
|
||||||
eps_dd = Params.add/Params.as;
|
eps_dd = Params.add/Params.as;
|
||||||
if eps_dd == 0
|
if eps_dd == 0
|
||||||
Q5 = 1;
|
Q5 = 1;
|
||||||
|
@ -3,7 +3,7 @@ function [psi] = solver(this,psi,Params,Transf,VDk,V,njob,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');
|
||||||
|
|
||||||
dt=-1j*abs(Params.dt);
|
dt=-1j*abs(this.TimeStep);
|
||||||
|
|
||||||
KEop= 0.5*(Transf.KX.^2+Transf.KY.^2+Transf.KZ.^2);
|
KEop= 0.5*(Transf.KX.^2+Transf.KY.^2+Transf.KZ.^2);
|
||||||
Observ.residual = 1; Observ.res = 1;
|
Observ.residual = 1; Observ.res = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user