Code covered by the BSD License  

Highlights from
QUBIT4MATLAB V4.0

from QUBIT4MATLAB V4.0 by Geza Toth
MATLAB package for quantum information science and quantum mechanics.

gs=grstate(H)
% grstate   Normalized ground state of a Hamiltonian

function gs=grstate(H)
   [V,D]=eig(H);
   [junk,index]=min(real(diag(D)));
   gs=V(:,index(1));
   gs=gs/sqrt(gs'*gs);

Contact us at files@mathworks.com