Modified script to create and visualize phase diagram
This commit is contained in:
parent
1856a26e92
commit
05bffb768b
@ -1,9 +1,12 @@
|
||||
function createPhaseDiagram()
|
||||
% Define axis values
|
||||
SCATTERING_LENGTH_RANGE = [79.0 80.0 81.0 82.0 83.0 84.0 85.0 86.0 87.0 88.0 89.0 90.0];
|
||||
NUM_ATOMS_LIST = [50000 60000 70000 80000];
|
||||
NUM_ATOMS_LIST = 50000:5000:105000;
|
||||
|
||||
M = zeros(12, 4); % Phase diagram matrix
|
||||
xlen = length(NUM_ATOMS_LIST);
|
||||
ylen = length(SCATTERING_LENGTH_RANGE);
|
||||
|
||||
M = zeros(xlen,ylen); % Phase diagram matrix
|
||||
|
||||
fig = figure('Name', 'Manual Phase Diagram Input', ...
|
||||
'NumberTitle', 'off', ...
|
||||
@ -14,14 +17,14 @@ function createPhaseDiagram()
|
||||
colormap(parula);
|
||||
colorbar;
|
||||
axis equal tight;
|
||||
xticks(1:4);
|
||||
yticks(1:12);
|
||||
xticks(1:xlen);
|
||||
yticks(1:ylen);
|
||||
xticklabels(string(NUM_ATOMS_LIST));
|
||||
yticklabels(string(SCATTERING_LENGTH_RANGE));
|
||||
xlabel('Number of Atoms');
|
||||
ylabel('Scattering Length (a0)');
|
||||
grid on;
|
||||
title('Click a cell to label it. Press "q" to quit.');
|
||||
title('Click a cell to label it. Press "q" to quit.'); % Zero-temperature Phase Diagram
|
||||
|
||||
set(fig, 'WindowButtonDownFcn', @clickCallback);
|
||||
uiwait(fig); % Wait until user quits
|
||||
@ -36,7 +39,7 @@ function createPhaseDiagram()
|
||||
C = get(gca, 'CurrentPoint');
|
||||
col = round(C(1,1));
|
||||
row = round(C(1,2));
|
||||
if row >= 1 && row <= 12 && col >= 1 && col <= 4
|
||||
if row >= 1 && row <= ylen && col >= 1 && col <= xlen
|
||||
prompt = sprintf('Enter label for scattering length %.1f and N = %d:', ...
|
||||
SCATTERING_LENGTH_RANGE(row), NUM_ATOMS_LIST(col));
|
||||
answer = inputdlg(prompt, 'Input Label', 1);
|
||||
|
@ -600,3 +600,27 @@ Plotter.visualizeGSWavefunction(SaveDirectory, JobNumber)
|
||||
SaveDirectory = './Results/Data_3D/GradientDescent/';
|
||||
JobNumber = 1;
|
||||
Plotter.visualizeGSWavefunction(SaveDirectory, JobNumber)
|
||||
%% Visualize phase diagram
|
||||
load('phase_diagram_matrix.mat')
|
||||
PhaseDiagramMatrix = M;
|
||||
ScatteringLengths = SCATTERING_LENGTH_RANGE;
|
||||
NumberOfAtoms = NUM_ATOMS_LIST * 1E-5;
|
||||
xlen = length(ScatteringLengths);
|
||||
ylen = length(NumberOfAtoms);
|
||||
|
||||
figure(1);
|
||||
set(gcf,'Position',[100 100 950 750])
|
||||
set(gca,'FontSize',16,'Box','On','Linewidth',2);
|
||||
hImg = imagesc(M);
|
||||
set(gca, 'YDir', 'normal');
|
||||
colormap(parula);
|
||||
% colorbar;
|
||||
axis equal tight;
|
||||
xticks(1:xlen);
|
||||
yticks(1:ylen);
|
||||
xticklabels(string(NumberOfAtoms));
|
||||
yticklabels(string(ScatteringLengths));
|
||||
xlabel('Number of Atoms (x 10^5)', FontSize=16);
|
||||
ylabel('Scattering Length (a0)', FontSize=16);
|
||||
title('Zero-temperature Phase Diagram for \theta = 0', 'Interpreter', 'tex', FontSize=16);
|
||||
grid on;
|
Loading…
Reference in New Issue
Block a user