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

20 lines
566 B
Matlab

function [psi] = setupWavefunction(~,Params,Transf)
format long
X = Transf.X;
Y = Transf.Y;
ellx = sqrt(Params.hbar/(Params.m*Params.wx))/Params.l0;
elly = sqrt(Params.hbar/(Params.m*Params.wy))/Params.l0;
Rx = 8*sqrt(2)*ellx;
Ry = 8*sqrt(2)*elly;
X0 = 0.0*Transf.Xmax;
Y0 = 0.0*Transf.Ymax;
psi = exp(-(X-X0).^2/Rx^2-(Y-Y0).^2/Ry^2);
Norm = sum(abs(psi(:)).^2)*Transf.dx*Transf.dy;
psi = sqrt(Params.N)*psi/sqrt(Norm);
end