Eigenvalues (so far)

I suspect that for real symmetric matrices Jacobi can’t be beat. For general complex, non-hermitian matrices we proceed here as follows in this body of code which descends from this which is documented here.

First we seek the eigenvalues as the roots of the characteristic polynomial. The routine chrply computes the characteristic polynomial of an n by n matrix m by evaluating the determinant of m-λI for λ in a set of at n Gaussian integers clustered about 0. Since knowing the value of an nth degree polynomial for n+1 distinct arguments determines the polynomial, the polynomial coefficients can be had by solving a set of linear equations. In the routine the vector of determinant values is v which we multiply by matrix p. It is noteworthy that matrix p does not depend on m but it does depend on n. The non trivial calculation of p could be avoided if we wanted eigenvalues of several matrices of the same size.

As an exercise we compute some random orthogonal matrices and report their eigenvalues which should all lie in the unit circle in the complex plane. It looks good.

Some routines:

cm(c)
Crude magnitude of complex number c. Robust for extreme exponents.
cvm(v)
Crude magnitude of complex vector v.
m2(c)
Squared magnitude of complex number c.
inv(M)
Inverts a matrix M.
det(M)
Takes the determinant of a matrix M.
gs
Gram Schmidt with Σxiyi* serving as the inner product of x and y.
chrply(M)
Computes the coefficients of the characteristic polynomial of matrix M.
evals(M)
Computes all eigenvalues of a general square matrix M.
sh(M, λ)
determinant of matrix M−λI.
ish(M, λ)
inverse of matrix M−λI.
I want a routine to see how good some vector x is as an eigenvector of M. First I choose x so that |x|=1. I compute z = |Mx| as the tentative eigenvalue and compare vectors Mx and zx. x is a good eigenvector if they are near. Routine rev is an incomplete attempt. I must clarify what I mean as normal. qev(M, evec) is becoming such a routine.

Eigenvector logic is still in disarray.


Projection Theory