From 0f3eca67919d50c50c876fd51dace605d41d3002 Mon Sep 17 00:00:00 2001 From: Karthik Chandrashekara Date: Fri, 28 Mar 2025 14:44:38 +0100 Subject: [PATCH] Latest scripts - included choice between using full Q5 to the approximation for the LHY correction. --- Dipolar-Gas-Simulator/+Scripts/run_locally.m | 9 +++++++ .../run_on_cluster_vary_aspect_ratio.m | 4 ++-- .../+Simulator/@DipolarGas/DipolarGas.m | 24 +++++++++++-------- .../+Simulator/@DipolarGas/setupParameters.m | 23 +++++++++++------- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/Dipolar-Gas-Simulator/+Scripts/run_locally.m b/Dipolar-Gas-Simulator/+Scripts/run_locally.m index 1353782..11754b4 100644 --- a/Dipolar-Gas-Simulator/+Scripts/run_locally.m +++ b/Dipolar-Gas-Simulator/+Scripts/run_locally.m @@ -19,6 +19,7 @@ OptionsStruct.TrapPotentialType = 'Harmonic'; OptionsStruct.NumberOfGridPoints = [64, 64, 32]; OptionsStruct.Dimensions = [18, 18, 18]; +OptionsStruct.UseApproximationForLHY = true; OptionsStruct.IncludeDDICutOff = true; OptionsStruct.CutoffType = 'Cylindrical'; OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution' @@ -51,7 +52,15 @@ Plotter.visualizeTrapPotential(sim.Potential,Params,Transf) %% - Plot initial wavefunction Plotter.visualizeWavefunction(psi,Params,Transf) %% - Plot GS wavefunction +% SaveDirectory = './Results/Data_3D/AspectRatio2_8'; SaveDirectory = './Results/Data_3D/AspectRatio3_7'; +% SaveDirectory = './Results/Data_3D/AspectRatio3_8'; +JobNumber = 0; +Plotter.visualizeGSWavefunction(SaveDirectory, JobNumber) +%% +% SaveDirectory = './Results/Data_3D/BeyondSSD_SSD'; +SaveDirectory = './Results/Data_3D/BeyondSSD_Labyrinth'; +% SaveDirectory = './Results/Data_3D/BeyondSSD_Honeycomb'; JobNumber = 0; Plotter.visualizeGSWavefunction(SaveDirectory, JobNumber) diff --git a/Dipolar-Gas-Simulator/+Scripts/run_on_cluster_vary_aspect_ratio.m b/Dipolar-Gas-Simulator/+Scripts/run_on_cluster_vary_aspect_ratio.m index 356b3b6..56dc6b8 100644 --- a/Dipolar-Gas-Simulator/+Scripts/run_on_cluster_vary_aspect_ratio.m +++ b/Dipolar-Gas-Simulator/+Scripts/run_on_cluster_vary_aspect_ratio.m @@ -18,7 +18,7 @@ OptionsStruct.Dimensions = [18, 18, 18]; OptionsStruct.IncludeDDICutOff = true; OptionsStruct.CutoffType = 'Cylindrical'; OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution' -OptionsStruct.TimeStepSize = 0.002; % in s +OptionsStruct.TimeStepSize = 2E-3; % in s OptionsStruct.MinimumTimeStepSize = 1E-6; % in s OptionsStruct.TimeCutOff = 2E6; % in s OptionsStruct.EnergyTolerance = 5E-10; @@ -60,7 +60,7 @@ OptionsStruct.Dimensions = [18, 18, 18]; OptionsStruct.IncludeDDICutOff = true; OptionsStruct.CutoffType = 'Cylindrical'; OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution' -OptionsStruct.TimeStepSize = 0.002; % in s +OptionsStruct.TimeStepSize = 2E-3; % in s OptionsStruct.MinimumTimeStepSize = 1E-6; % in s OptionsStruct.TimeCutOff = 2E6; % in s OptionsStruct.EnergyTolerance = 5E-10; diff --git a/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/DipolarGas.m b/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/DipolarGas.m index 808829b..49a785f 100644 --- a/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/DipolarGas.m +++ b/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/DipolarGas.m @@ -22,6 +22,7 @@ classdef DipolarGas < handle & matlab.mixin.Copyable SimulationParameters; IncludeDDICutOff; + UseApproximationForLHY; PlotLive; JobNumber; RunOnGPU; @@ -69,7 +70,9 @@ classdef DipolarGas < handle & matlab.mixin.Copyable addParameter(p, 'NoiseScaleFactor', 4,... @(x) assert(isnumeric(x) && isscalar(x) && (x > 0))); - addParameter(p, 'IncludeDDICutOff', true,... + addParameter(p, 'IncludeDDICutOff', true,... + @islogical); + addParameter(p, 'UseApproximationForLHY', false,... @islogical); addParameter(p, 'PlotLive', false,... @islogical); @@ -102,17 +105,18 @@ classdef DipolarGas < handle & matlab.mixin.Copyable this.ResidualTolerance = p.Results.ResidualTolerance; this.NoiseScaleFactor = p.Results.NoiseScaleFactor; - this.IncludeDDICutOff = p.Results.IncludeDDICutOff; - this.PlotLive = p.Results.PlotLive; - this.JobNumber = p.Results.JobNumber; - this.RunOnGPU = p.Results.RunOnGPU; - this.DebugMode = p.Results.DebugMode; - this.DoSave = p.Results.SaveData; - this.SaveDirectory = p.Results.SaveDirectory; + this.IncludeDDICutOff = p.Results.IncludeDDICutOff; + this.UseApproximationForLHY = p.Results.UseApproximationForLHY; + this.PlotLive = p.Results.PlotLive; + this.JobNumber = p.Results.JobNumber; + this.RunOnGPU = p.Results.RunOnGPU; + this.DebugMode = p.Results.DebugMode; + this.DoSave = p.Results.SaveData; + this.SaveDirectory = p.Results.SaveDirectory; - this.Calculator = Simulator.Calculator('CutOffType', p.Results.CutOffType); + this.Calculator = Simulator.Calculator('CutOffType', p.Results.CutOffType); - this.SimulationParameters = this.setupParameters(); + this.SimulationParameters = this.setupParameters(); end end diff --git a/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/setupParameters.m b/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/setupParameters.m index e5f207f..6c3e49a 100644 --- a/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/setupParameters.m +++ b/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/setupParameters.m @@ -72,18 +72,23 @@ function [Params] = setupParameters(this) % == Calculate LHY correction == % eps_dd = Params.add/Params.as; - if eps_dd == 0 - Q5 = 1; - elseif eps_dd == 1 - Q5 = 3*sqrt(3)/2; + + if this.UseApproximationForLHY + Q5 = 1 + ((3*eps_dd^2)/2); else - yeps = (1-eps_dd)/(3*eps_dd); - Q5 = (3*eps_dd)^(5/2)*( (8+26*yeps+33*yeps^2)*sqrt(1+yeps) + 15*yeps^3*log((1+sqrt(1+yeps))/sqrt(yeps)) )/48; - Q5 = real(Q5); + if eps_dd == 0 + Q5 = 1; + elseif eps_dd == 1 + Q5 = 3*sqrt(3)/2; + else + yeps = (1-eps_dd)/(3*eps_dd); + Q5 = (3*eps_dd)^(5/2)*( (8+26*yeps+33*yeps^2)*sqrt(1+yeps) + 15*yeps^3*log((1+sqrt(1+yeps))/sqrt(yeps)) )/48; + Q5 = real(Q5); + end end - + Params.gammaQF = 128/3*sqrt(pi*(Params.as/l0)^5)*Q5; - + % Loading the rest into Params Params.hbar = hbar; Params.kbol = kbol;