groundstate
Joe Hope
Calculate the ground state of the non-linear Schrodinger equation in a harmonic magnetic trap. This is done by evolving it in imaginary time while re-normalising each timestep.
const real Uint = 2.0; const real Nparticles = 5.0;
t
V1
V1 = 0.5*y*y;
phi
if (fabs(y) < 3.0) { phi = 1.0; // This will be automatically normalised later } else { phi = 0.0; }
Ncalc
wavefunction
// Calculate the current normalisation of the wave function. Ncalc = mod2(phi);
printf("Hello world from a filter segment!\n");
normalisation wavefunction
phi *= sqrt(Nparticles/Ncalc);
25 4000
wavefunction normalisation
// Correct normalisation of the wavefunction phi *= sqrt(Nparticles/Ncalc);
T
T = -0.5*ky*ky;
wavefunction
potential
dphi_dt = T[phi] - (V1 + Uint*mod2(phi))*phi;
wavefunction
norm_dens
wavefunction normalisation
norm_dens = mod2(phi);
norm
normalisation
norm = Ncalc;