2024-06-18 19:01:35 +02:00
|
|
|
function visualizeGSWavefunction(run_index)
|
|
|
|
set(0,'defaulttextInterpreter','latex')
|
|
|
|
set(groot, 'defaultAxesTickLabelInterpreter','latex'); set(groot, 'defaultLegendInterpreter','latex');
|
|
|
|
|
|
|
|
folder_path = './Data';
|
|
|
|
|
|
|
|
Data = load(sprintf(horzcat(folder_path, '/Run_%03i/psi_gs.mat'),run_index),'psi','Params','Transf','Observ');
|
|
|
|
|
|
|
|
Params = Data.Params;
|
|
|
|
Transf = Data.Transf;
|
|
|
|
Observ = Data.Observ;
|
2024-06-20 12:16:42 +02:00
|
|
|
if isgpuarray(Data.psi)
|
|
|
|
psi = gather(Data.psi);
|
|
|
|
else
|
|
|
|
psi = Data.psi;
|
|
|
|
end
|
2024-06-18 19:01:35 +02:00
|
|
|
|
2024-06-20 12:16:42 +02:00
|
|
|
if isgpuarray(Data.Observ.residual)
|
|
|
|
Observ.residual = gather(Data.Observ.residual);
|
|
|
|
else
|
|
|
|
Observ.residual = Data.Observ.residual;
|
|
|
|
end
|
|
|
|
|
2024-06-18 19:01:35 +02:00
|
|
|
format long
|
|
|
|
x = Transf.x*Params.l0*1e6;
|
|
|
|
y = Transf.y*Params.l0*1e6;
|
|
|
|
z = Transf.z*Params.l0*1e6;
|
|
|
|
dx = x(2)-x(1); dy = y(2)-y(1); dz = z(2)-z(1);
|
|
|
|
|
|
|
|
%Plotting
|
2024-06-20 12:16:42 +02:00
|
|
|
figure('Position', [100, 100, 1600, 900]);
|
|
|
|
clf
|
|
|
|
|
|
|
|
% Subplot 1
|
|
|
|
% subplot(2,3,1)
|
|
|
|
subplot('Position', [0.05, 0.55, 0.28, 0.4])
|
2024-06-18 19:01:35 +02:00
|
|
|
n = abs(psi).^2;
|
|
|
|
nxz = squeeze(trapz(n*dy,2));
|
|
|
|
nyz = squeeze(trapz(n*dx,1));
|
|
|
|
nxy = squeeze(trapz(n*dz,3));
|
|
|
|
|
|
|
|
plotxz = pcolor(x,z,nxz');
|
|
|
|
set(plotxz, 'EdgeColor', 'none');
|
2024-06-20 12:16:42 +02:00
|
|
|
colorbar
|
|
|
|
xlabel('$x$ [$\mu$m]', 'FontSize', 14); ylabel('$z$ [$\mu$m]', 'FontSize', 14);
|
|
|
|
title('$|\Psi_{zx}|^2$', 'FontSize', 14);
|
|
|
|
|
|
|
|
% Subplot 2
|
|
|
|
% subplot(2,3,2)
|
|
|
|
subplot('Position', [0.36, 0.55, 0.28, 0.4])
|
2024-06-18 19:01:35 +02:00
|
|
|
plotyz = pcolor(y,z,nyz');
|
|
|
|
set(plotyz, 'EdgeColor', 'none');
|
2024-06-20 12:16:42 +02:00
|
|
|
colorbar
|
|
|
|
xlabel('$y$ [$\mu$m]', 'FontSize', 14); ylabel('$z$ [$\mu$m]', 'FontSize', 14);
|
|
|
|
title('$|\Psi_{zy}|^2$', 'FontSize', 14);
|
|
|
|
|
|
|
|
% Subplot 3
|
|
|
|
% subplot(2,3,3)
|
|
|
|
subplot('Position', [0.67, 0.55, 0.28, 0.4]);
|
2024-06-18 19:01:35 +02:00
|
|
|
plotxy = pcolor(x,y,nxy');
|
|
|
|
set(plotxy, 'EdgeColor', 'none');
|
2024-06-20 12:16:42 +02:00
|
|
|
colorbar
|
|
|
|
xlabel('$x$ [$\mu$m]', 'FontSize', 14); ylabel('$y$ [$\mu$m]', 'FontSize', 14);
|
|
|
|
title('$ |\Psi_{xy}|^2$', 'FontSize', 14);
|
2024-06-18 19:01:35 +02:00
|
|
|
|
2024-06-20 12:16:42 +02:00
|
|
|
% Subplot 4
|
|
|
|
% subplot(2,3,4)
|
|
|
|
subplot('Position', [0.05, 0.05, 0.26, 0.4]);
|
2024-06-18 19:01:35 +02:00
|
|
|
plot(-log10(Observ.residual),'-b')
|
2024-06-20 12:16:42 +02:00
|
|
|
ylabel('$-\mathrm{log}_{10}(r)$', 'FontSize', 14); xlabel('Time steps', 'FontSize', 14);
|
|
|
|
title('Residual', 'FontSize', 14);
|
2024-06-18 19:01:35 +02:00
|
|
|
|
2024-06-20 12:16:42 +02:00
|
|
|
% Subplot 5
|
|
|
|
% subplot(2, 3, 5);
|
|
|
|
subplot('Position', [0.36, 0.05, 0.26, 0.4]);
|
2024-06-18 19:01:35 +02:00
|
|
|
plot(Observ.EVec,'-b')
|
2024-06-20 12:16:42 +02:00
|
|
|
ylabel('$E$', 'FontSize', 14); xlabel('Time steps', 'FontSize', 14);
|
|
|
|
title('Total Energy', 'FontSize', 14);
|
2024-06-18 19:01:35 +02:00
|
|
|
|
2024-06-20 12:16:42 +02:00
|
|
|
% Subplot 6
|
|
|
|
% subplot(2, 3, 6);
|
|
|
|
subplot('Position', [0.67, 0.05, 0.26, 0.4]);
|
2024-06-18 19:01:35 +02:00
|
|
|
plot(Observ.mucVec,'-b')
|
2024-06-20 12:16:42 +02:00
|
|
|
ylabel('$\mu$', 'FontSize', 14); xlabel('Time steps', 'FontSize', 14);
|
|
|
|
title('Chemical Potential', 'FontSize', 14);
|
2024-06-18 19:01:35 +02:00
|
|
|
end
|