From: Brian on
I am looking for is a program that will return the eigenvectors and eigenvalues for a given potential. The way i usually calculate the eigenvalues and eigenvectors of a one-dimensional potential is using an orthogonal basis such as hermite polynomials. I calculate:

\int_-\infty^\infty \psi_a \hat{H} \phi_b dx

to get an NxN matrix (H is schrodinger).
The matlab function eigs can be then used to get the eigenvalues and eigenvectors of the potential V.
Alternatively here is some code that runs this quite quick,

*******************************************************************

V(1,:)=1/2*m*(omega)^2*(x+d/2).^2;
V(2,:)=1/2*m*(omega+domega)^2*(x-d/2).^2;

V=squeeze(min(V));

%Making a matrix with the potential V along the diagonal.
diagV=spdiags(V',0:0,Ngx,Ngx);

% HOO is the second derivative operator with the minus sign
e=ones(Ngx,1);
H00=spdiags([e -2*e e],-1:1,Ngx,Ngx);
H00=-(1/2)*H00/dx^2;

% find sp eigenstates
OPTS1.disp=0;

%The hamiltonian operator H and the associated eigenvalues.
H=H00+diagV;

%Fiinding the eigenstates
[u1,g]=eigs(H,Nstates,'SM',OPTS1);
[G,Ind]=sort(diag(g));

%Normalizing the eigenstates
eigenst=zeros(length(x),Nparticles);
for ii=1:Nstates
eigenst(:,ii)=u1(:,Ind(ii))/sqrt(sum(abs(u1(:,Ind(ii))).^2)*dx);
end

*******************************************************************

This works fine for one dimensional potentials. Is there an easy way to do this for a two dimensional potential ??
As far as I can gather, you can apply the above method for both the x and y axes as if they are separate potentials at each interval. Taking their normalized product should give you the two dimensional potential. It seems to me to be a tough program to write and I'd find it difficult to not make it slow. Do you guys have a program that can do the above in 2D?