excitedstate_gaussian
Graham Dennis
Calculate the first excited state of a negative gaussian potential.

The idea here is to use the imaginary time algorithm but at each step to project out the ground state that was calculated with the groundstate_gaussian.xmds script.
t
V1
groundstate_gaussian_break.h5
phi1

// This will be automatically normalised later // The extra 'y' is there to make the wavefunction asymmetric phi1 = y*exp(-y*y);
phi
groundstate_gaussian_break.h5
Ncalc
wavefunction
// Calculate the current normalisation of the wave function. Ncalc = mod2(phi1);
overlap
groundstate wavefunction
overlap = phi1*conj(phi);
500 500
wavefunction groundstate_overlap groundstate
// Subtract out the projection of the groundstate phi1 -= overlap * phi;
wavefunction normalisation
// Correct normalisation of the wavefunction phi1 *= sqrt(1.0/Ncalc);
T
T = -0.5*ky*ky;
wavefunction
potential
dphi1_dt = T[phi1] - (i*V1)*phi1;
wavefunction
dens
wavefunction
dens = mod2(phi1);
N
normalisation
N = Ncalc;