function w = hameig_basic(H) % w=HAMEIG_BASIC(H) computes the eigenvalues of a Hamiltonian matrix % using Van Loan's method % H: Hamiltonian matrix % w: eigenvalues of H n = length(H)/2; T = pvlform(H^2); v = eig(T(1:n,1:n)); w = [sqrt(v);-sqrt(v)];