Place the following code block at the end of your ``sch.m'' and run.
The code should then start from random functions, perform a finite
difference test, orthonormalize, run 400 iterations of your sd(), and
compute the final results with your getPsi(). Finally, the code will
display the energy of each state along with mesh plots of the values
of
on planes cutting through the center of your
cell.
%# Converge using steepest descents
W=sd(W,400);
%# Extract and display final results
[Psi, epsilon]=getPsi(W);
for st=1:Ns
printf('=== State # %d, Energy = %f ===\n',st,epsilon(st));
viewmid(abs(cI(Psi(:,st))).^2,S)
end
For your reference, with an angular frequency of the oscillator of