Here is a quick and dirty work around for the user who wants PZGEEV,
or indeed any missing complex version of any code.
We exploit the homomorphism between the complex number x = Rx + i*Ix where Rx is the real part of x and Ix is the imaginary part,
and the real 2-by-2 matrix
- Code: Select all
[ Rx -Ix ]
[ Ix Rx ]
It is easy to confirm that adding, multiplying and taking reciprocals of
complex numbers corresponds to adding, multiplying and taking inverses
of their corresponding 2-by-2 matrices.
In the case of the complex non-Hermitian eigenproblem A*x = x*lambda,
we rewrite it as
- Code: Select all
[ RA -IA ] * [ Rx -Ix ] = [ Rx -Ix ] * [ Rlambda -Ilambda ]
[ IA RA ] [ Ix Rx ] [ Ix Rx ] [ Ilambda Rlambda ]
Since
- Code: Select all
inv(S)* [ Rlambda -Ilambda ] * S = diag( Rlambda -i* Ilambda, Rlambda + i*Ilambda )
[ Ilambda Rlambda ]
with S = [[1 i];[i,1]], we get
- Code: Select all
[ RA -IA ] * [ Rx -Ix ] * S = [ Rx -Ix ] * S * [ conj(lambda) 0 ]
[ IA RA ] [ Ix Rx ] [ Ix Rx ] [ 0 lambda ]
or
- Code: Select all
[ RA -IA ] * [ conj(x) i*x ] = [ conj(x) i*x ] * [ conj(lambda) 0 ]
[ IA RA ] [ i*conj(x) x ] [ i*conj(x) x ] [ 0 lambda ]
In other words, the real matrix Ahat = [[ RA, -IA];[IA, RA]] has a pair
of eigenvalues lambda and conj(lambda) corresponding to the single
eigenvalue lambda of A, with eigenvectors constructed easily from
the eigenvector x of A. So given the eigenvalues and eigenvectors
of Ahat, the eigenvalues and eigenvectors of
A can be reconstructed.
Roundoff makes all this tricky, since, for example, a real eigenvalue
of A is supposed to turn into an exact double eigenvalue of Ahat,
but roundoff may make it hard to pair them up this way.
Still, for the user this may be better than nothing.
Needless to say, this general technique can change many
complex problems into real problems, albeit by increasing
the storage and work by constant factors.
Jim