function out=c2g(psi0, NN, N) %converts column vector into grided array
%NN is the y dimension and N is the x dimension
out=reshape(psi0,N,NN)';
