naginterfaces.library.lapackeig.zhseqr

naginterfaces.library.lapackeig.zhseqr(job, compz, ilo, ihi, h, z=None)[source]

zhseqr computes all the eigenvalues and, optionally, the Schur factorization of a complex Hessenberg matrix or a complex general matrix which has been reduced to Hessenberg form.

For full information please refer to the NAG Library document for f08ps

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f08/f08psf.html

Parameters
jobstr, length 1

Indicates whether eigenvalues only or the Schur form is required.

Eigenvalues only are required.

The Schur form is required.

compzstr, length 1

Indicates whether the Schur vectors are to be computed.

No Schur vectors are computed (and the array is not referenced).

The Schur vectors of are computed (and the array must contain the matrix on entry).

The Schur vectors of are computed (and the array is initialized by the function).

iloint

If the matrix has been balanced by zgebal(), and must contain the values returned by that function. Otherwise, must be set to and to .

ihiint

If the matrix has been balanced by zgebal(), and must contain the values returned by that function. Otherwise, must be set to and to .

hcomplex, array-like, shape

The upper Hessenberg matrix , as returned by zgehrd().

zNone or complex, array-like, shape , optional

Note: the required extent for this argument in dimension 1 is determined as follows: if : ; if : ; otherwise: .

Note: the required extent for this argument in dimension 2 is determined as follows: if : ; if : ; otherwise: .

If , must contain the unitary matrix from the reduction to Hessenberg form.

If , need not be set.

Returns
hcomplex, ndarray, shape

If , the array contains no useful information.

If , is overwritten by the upper triangular matrix from the Schur decomposition (the Schur form) unless > 0.

wcomplex, ndarray, shape

The computed eigenvalues, unless > 0 (in which case see Exceptions). The eigenvalues are stored in the same order as on the diagonal of the Schur form (if computed).

zNone or complex, ndarray, shape

If or , contains the unitary matrix of the required Schur vectors, unless > 0.

If , is not referenced.

Raises
NagValueError
(errno )

On entry, error in parameter .

Constraint: or .

(errno )

On entry, error in parameter .

Constraint: , or .

(errno )

On entry, error in parameter .

Constraint: .

(errno )

On entry, error in parameter .

(errno )

On entry, error in parameter .

(errno )

The algorithm has failed to find all the eigenvalues after a total of iterations.

Notes

zhseqr computes all the eigenvalues and, optionally, the Schur factorization of a complex upper Hessenberg matrix :

where is an upper triangular matrix (the Schur form of ), and is the unitary matrix whose columns are the Schur vectors . The diagonal elements of are the eigenvalues of .

The function may also be used to compute the Schur factorization of a complex general matrix which has been reduced to upper Hessenberg form :

In this case, after zgehrd() has been called to reduce to Hessenberg form, zunghr() must be called to form explicitly; is then passed to zhseqr, which must be called with .

The function can also take advantage of a previous call to zgebal() which may have balanced the original matrix before reducing it to Hessenberg form, so that the Hessenberg matrix has the structure:

where and are upper triangular. If so, only the central diagonal block (in rows and columns to ) needs to be further reduced to Schur form (the blocks and are also affected). Therefore, the values of and can be supplied to zhseqr directly. Also, zgebak() must be called after this function to permute the Schur vectors of the balanced matrix to those of the original matrix. If zgebal() has not been called however, then must be set to and to . Note that if the Schur factorization of is required, zgebal() must not be called with or , because the balancing transformation is not unitary.

zhseqr uses a multishift form of the upper Hessenberg algorithm, due to Bai and Demmel (1989). The Schur vectors are normalized so that , but are determined only to within a complex factor of absolute value .

References

Bai, Z and Demmel, J W, 1989, On a block implementation of Hessenberg multishift iteration, Internat. J. High Speed Comput. (1), 97–112

Golub, G H and Van Loan, C F, 1996, Matrix Computations, (3rd Edition), Johns Hopkins University Press, Baltimore