Calculations/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/setupWavefunction.m

23 lines
666 B
Mathematica
Raw Normal View History

function [psi] = setupWavefunction(~,Params,Transf)
2024-11-22 00:04:27 +01:00
format long
X = Transf.X;
Y = Transf.Y;
ellx = sqrt(Params.hbar/(Params.m*Params.wx))/Params.l0;
2024-11-18 18:06:14 +01:00
elly = sqrt(Params.hbar/(Params.m*Params.wy))/Params.l0;
2024-11-18 18:06:14 +01:00
Rx = 6*sqrt(2)*ellx;
Ry = 6*sqrt(2)*elly;
X0 = 0.0*Transf.Xmax;
Y0 = 0.0*Transf.Ymax;
2024-11-18 18:06:14 +01:00
psi = exp(-(X-X0).^2/Rx^2-(Y-Y0).^2/Ry^2);
cur_norm = trapz(abs(psi(:)).^2)*Transf.dx*Transf.dy;
2024-11-18 18:06:14 +01:00
psi = psi/sqrt(cur_norm);
Norm = trapz(abs(psi(:)).^2)*Transf.dx*Transf.dy;
psi = sqrt(Params.N)*psi/sqrt(Norm);
end