53 lines
1.5 KiB
Mathematica
53 lines
1.5 KiB
Mathematica
|
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');
|
||
|
|
||
|
psi = Data.psi;
|
||
|
Params = Data.Params;
|
||
|
Transf = Data.Transf;
|
||
|
Observ = Data.Observ;
|
||
|
|
||
|
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
|
||
|
|
||
|
subplot(2,3,1)
|
||
|
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');
|
||
|
xlabel('$x$ [$\mu$m]'); ylabel('$z$ [$\mu$m]');
|
||
|
|
||
|
subplot(2,3,2)
|
||
|
plotyz = pcolor(y,z,nyz');
|
||
|
set(plotyz, 'EdgeColor', 'none');
|
||
|
xlabel('$y$ [$\mu$m]'); ylabel('$z$ [$\mu$m]');
|
||
|
|
||
|
subplot(2,3,3)
|
||
|
plotxy = pcolor(x,y,nxy');
|
||
|
set(plotxy, 'EdgeColor', 'none');
|
||
|
xlabel('$x$ [$\mu$m]'); ylabel('$y$ [$\mu$m]');
|
||
|
|
||
|
subplot(2,3,4)
|
||
|
plot(-log10(Observ.residual),'-b')
|
||
|
ylabel('$-\mathrm{log}_{10}(r)$'); xlabel('steps');
|
||
|
|
||
|
subplot(2,3,5)
|
||
|
plot(Observ.EVec,'-b')
|
||
|
ylabel('$E$'); xlabel('steps');
|
||
|
|
||
|
subplot(2,3,6)
|
||
|
plot(Observ.mucVec,'-b')
|
||
|
ylabel('$\mu$'); xlabel('steps');
|
||
|
end
|