hermitegauss_transform_2d
Graham Dennis
Solve the Schroedinger equation using the hermite-Gauss basis.
const real M = 9.1e-31; // Mass of an electron const real hbar = 1.05e-34; const real omega = 2*M_PI*1e3; const real offset = 1.0 * sqrt(hbar/(M*omega));

t
psi
psi = pow(M*omega/(hbar*M_PI), 0.25) * exp(-0.5*(M*omega/hbar)*(x - offset)*(x - offset)); psi *= pow(M*omega/(hbar*M_PI), 0.25) * exp(-0.25*(M*omega/hbar)*y*y);
N integral_y2
main
N = mod2(psi); integral_y2 = mod2(psi)*y*y;
10 1 100
L
L = -i*(nx + ny + 1.0)*omega;
main
dpsi_dt = L[psi];
dens
main
dens = mod2(psi);

dens
main
dens = mod2(psi);

mean_x mean_sigmay
main normalisation
mean_x = mod2(psi)*x/N; mean_sigmay = sqrt(integral_y2/N);