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.

w=ket(v)
% ket  Transforms a vector into normalized column vector.

function w=ket(v)
   [y,x]=size(v);
   if x>1,
     w=v.';
   else
     w=v;
   end %if
   % normalisation
   w=w/sqrt(w'*w);
   
   

Contact us at files@mathworks.com