Latest execution scripts, minor modification to analysis script for finding optimal system sizes.

This commit is contained in:
Karthik 2025-03-17 15:07:05 +01:00
parent 201e4a39c6
commit 4af0ce726a
3 changed files with 61 additions and 51 deletions

View File

@ -68,5 +68,5 @@ function MinEnergyDataArray = analyzeGSWavefunction_optimal_system_size(folder_p
ylabel(cbar1,'$E_{var}$','FontSize',16,'Rotation',270) ylabel(cbar1,'$E_{var}$','FontSize',16,'Rotation',270)
xlabel('$L_x$','fontsize',16,'interpreter','latex'); xlabel('$L_x$','fontsize',16,'interpreter','latex');
ylabel('$L_y$','fontsize',16,'interpreter','latex'); ylabel('$L_y$','fontsize',16,'interpreter','latex');
title('Minimum variational energy for different system sizes', 'FontSize', 16); title('Minimum variational energy for different unit cell sizes', 'FontSize', 16);
end end

View File

@ -326,18 +326,23 @@ JobNumber = 1;
[contrast, period_X, period_Y] = Scripts.analyzeGSWavefunction_in_plane_trap(SaveDirectory, JobNumber); [contrast, period_X, period_Y] = Scripts.analyzeGSWavefunction_in_plane_trap(SaveDirectory, JobNumber);
%% %%
SaveDirectory = './Results/Data_TiltingOfDipoles/TransitionAngle/OptimalSystemSize/Hz500/Degree0'; SaveDirectory = './Results/Data_TiltingOfDipoles/TransitionAngle/OptimalSystemSize/Hz500/Degree15';
% Define the desired range for Lx and Ly % Define the desired range for Lx and Ly
Lx_Range = 2:0.4:6; % Extend Lx from 5 to 10 Lx_Range = 4:0.4:11; % Extend Lx from 5 to 10
Ly_Range = 2:0.4:6; % Extend Ly from 5 to 10 Ly_Range = 4:0.4:11; % Extend Ly from 5 to 10
MinEnergyDataArray = Scripts.analyzeGSWavefunction_optimal_system_size(SaveDirectory, Lx_Range, Ly_Range); MinEnergyDataArray = Scripts.analyzeGSWavefunction_optimal_system_size(SaveDirectory, Lx_Range, Ly_Range);
%% - Analysis %% - Analysis
SaveDirectory = './Results/Data_TiltingOfDipoles/HarmonicTrap/AspectRatio/AR2_8'; SaveDirectory = './Results/Data_TiltingOfDipoles/HarmonicTrap/AspectRatio/AR2_8';
JobNumber = 0; JobNumber = 0; % 79
% JobNumber = 1; % 80
% JobNumber = 2; % 81
Plotter.visualizeGSWavefunction2D(SaveDirectory, JobNumber) Plotter.visualizeGSWavefunction2D(SaveDirectory, JobNumber)
[contrast, period_X, period_Y] = Scripts.analyzeGSWavefunction_in_plane_trap(SaveDirectory, JobNumber); [contrast, period_X, period_Y] = Scripts.analyzeGSWavefunction_in_plane_trap(SaveDirectory, JobNumber);
%% - Analysis %% - Analysis
SaveDirectory = './Results/Data_TiltingOfDipoles/HarmonicTrap/AspectRatio/AR4_0'; SaveDirectory = './Results/Data_TiltingOfDipoles/HarmonicTrap/AspectRatio/AR3_7';
JobNumber = 0; % JobNumber = 0; % 80
% JobNumber = 1; % 81
JobNumber = 2; % 82
% JobNumber = 3; % 83
Plotter.visualizeGSWavefunction2D(SaveDirectory, JobNumber) Plotter.visualizeGSWavefunction2D(SaveDirectory, JobNumber)
[contrast, period_X, period_Y] = Scripts.analyzeGSWavefunction_in_plane_trap(SaveDirectory, JobNumber); [contrast, period_X, period_Y] = Scripts.analyzeGSWavefunction_in_plane_trap(SaveDirectory, JobNumber);

View File

@ -5,56 +5,61 @@ ppum = 1250;
%% theta = 0 %% theta = 0
idx = 0; Lx = 8:0.4:11;
Ly = 4:0.4:11;
cluster = parcluster;
% Loop over Lx and Ly values % Create a combined index for all i, j pairs
for Lx = 2:0.4:6 [I, J] = ndgrid(1:numel(Lx), 1:numel(Ly));
for Ly = 2:0.4:6 totalIterations = numel(I);
% Initialize OptionsStruct % Parallel loop over all combinations of i, j
OptionsStruct = struct; parfor (k = 1:totalIterations, cluster)
i = I(k);
j = J(k);
lx = Lx(i);
ly = Ly(j);
% Assign values to OptionsStruct % Initialize OptionsStruct
OptionsStruct.NumberOfAtoms = ppum * (Lx*Ly); OptionsStruct = struct;
OptionsStruct.DipolarPolarAngle = 0;
OptionsStruct.DipolarAzimuthAngle = 0;
OptionsStruct.ScatteringLength = 75.00;
OptionsStruct.TrapFrequencies = [0, 0, 500]; % Assign values to OptionsStruct
OptionsStruct.TrapPotentialType = 'None'; OptionsStruct.NumberOfAtoms = ppum * (lx*ly);
OptionsStruct.DipolarPolarAngle = deg2rad(15);
OptionsStruct.DipolarAzimuthAngle = 0;
OptionsStruct.ScatteringLength = 75.00;
OptionsStruct.NumberOfGridPoints = [128, 128]; OptionsStruct.TrapFrequencies = [0, 0, 500];
OptionsStruct.Dimensions = [Lx, Ly]; OptionsStruct.TrapPotentialType = 'None';
OptionsStruct.TimeStepSize = 1E-4; % in s
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
OptionsStruct.TimeCutOff = 1E6; % in s
OptionsStruct.EnergyTolerance = 5E-10;
OptionsStruct.ResidualTolerance = 1E-05;
OptionsStruct.NoiseScaleFactor = 0.05;
OptionsStruct.IncludeDDICutOff = false;
OptionsStruct.MaxIterations = 10; OptionsStruct.NumberOfGridPoints = [128, 128];
OptionsStruct.VariationalWidth = 1.00; OptionsStruct.Dimensions = [lx, ly];
OptionsStruct.WidthLowerBound = 0.01; OptionsStruct.TimeStepSize = 1E-3; % in s
OptionsStruct.WidthUpperBound = 12; OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
OptionsStruct.WidthCutoff = 1e-2; OptionsStruct.TimeCutOff = 2E6; % in s
OptionsStruct.EnergyTolerance = 5E-10;
OptionsStruct.ResidualTolerance = 1E-05;
OptionsStruct.NoiseScaleFactor = 0.05;
OptionsStruct.IncludeDDICutOff = false;
OptionsStruct.PlotLive = false; OptionsStruct.MaxIterations = 10;
OptionsStruct.JobNumber = idx; OptionsStruct.VariationalWidth = 1.20;
OptionsStruct.RunOnGPU = true; OptionsStruct.WidthLowerBound = 0.01;
OptionsStruct.SaveData = true; OptionsStruct.WidthUpperBound = 12;
OptionsStruct.SaveDirectory = sprintf('./Results/Data_TiltingOfDipoles/TransitionAngle/OptimalSystemSize/Hz500/Degree%i', rad2deg(OptionsStruct.DipolarPolarAngle)); OptionsStruct.WidthCutoff = 1e-2;
options = Helper.convertstruct2cell(OptionsStruct); OptionsStruct.PlotLive = false;
clear OptionsStruct OptionsStruct.JobNumber = (i - 1) * num_inner + j;
OptionsStruct.RunOnGPU = true;
OptionsStruct.SaveData = true;
OptionsStruct.SaveDirectory = sprintf('./Results/Data_TiltingOfDipoles/TransitionAngle/OptimalSystemSize/Hz500/Degree%i', round(rad2deg(OptionsStruct.DipolarPolarAngle)));
solver = VariationalSolver2D.DipolarGas(options{:}); options = Helper.convertstruct2cell(OptionsStruct);
pot = VariationalSolver2D.Potentials(options{:});
solver.Potential = pot.trap();
% Run Solver solver = VariationalSolver2D.DipolarGas(options{:});
[Params, Transf, psi, V, VDk] = solver.run(); pot = VariationalSolver2D.Potentials(options{:});
solver.Potential = pot.trap();
idx = idx + 1; % Run Solver
end [Params, Transf, psi, V, VDk] = solver.run();
end end