F08XSF (ZHGEQZ) (PDF version)
F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

F08XSF (ZHGEQZ)

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

F08XSF (ZHGEQZ) implements the QZ method for finding generalized eigenvalues of the complex matrix pair A,B of order n, which is in the generalized upper Hessenberg form.

2  Specification

SUBROUTINE F08XSF ( JOB, COMPQ, COMPZ, N, ILO, IHI, A, LDA, B, LDB, ALPHA, BETA, Q, LDQ, Z, LDZ, WORK, LWORK, RWORK, INFO)
INTEGER  N, ILO, IHI, LDA, LDB, LDQ, LDZ, LWORK, INFO
REAL (KIND=nag_wp)  RWORK(N)
COMPLEX (KIND=nag_wp)  A(LDA,*), B(LDB,*), ALPHA(N), BETA(N), Q(LDQ,*), Z(LDZ,*), WORK(max(1,LWORK))
CHARACTER(1)  JOB, COMPQ, COMPZ
The routine may be called by its LAPACK name zhgeqz.

3  Description

F08XSF (ZHGEQZ) implements a single-shift version of the QZ method for finding the generalized eigenvalues of the complex matrix pair A,B which is in the generalized upper Hessenberg form. If the matrix pair A,B is not in the generalized upper Hessenberg form, then the routine F08WSF (ZGGHRD) should be called before invoking F08XSF (ZHGEQZ).
This problem is mathematically equivalent to solving the matrix equation
detA-λB=0.  
Note that, to avoid underflow, overflow and other arithmetic problems, the generalized eigenvalues λj are never computed explicitly by this routine but defined as ratios between two computed values, αj and βj:
λj=αj/βj.  
The arguments αj, in general, are finite complex values and βj are finite real non-negative values.
If desired, the matrix pair A,B may be reduced to generalized Schur form. That is, the transformed matrices A and B are upper triangular and the diagonal values of A and B provide α and β.
The argument JOB specifies two options. If JOB='S' then the matrix pair A,B is simultaneously reduced to Schur form by applying one unitary transformation (usually called Q) on the left and another (usually called Z) on the right. That is,
AQHAZ BQHBZ  
If JOB='E', then at each iteration the same transformations are computed but they are only applied to those parts of A and B which are needed to compute α and β. This option could be used if generalized eigenvalues are required but not generalized eigenvectors.
If JOB='S' and COMPQ='V' or 'I', and COMPZ='V' or 'I', then the unitary transformations used to reduce the pair A,B are accumulated into the input arrays Q and Z. If generalized eigenvectors are required then JOB must be set to JOB='S' and if left (right) generalized eigenvectors are to be computed then COMPQ (COMPZ) must be set to COMPQ='V' or 'I' rather than COMPQ='N'.
If COMPQ='I', then eigenvectors are accumulated on the identity matrix and on exit the array Q contains the left eigenvector matrix Q. However, if COMPQ='V' then the transformations are accumulated in the user-supplied matrix Q0 in array Q on entry and thus on exit Q contains the matrix product QQ0. A similar convention is used for COMPZ.

4  References

Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999) LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Moler C B and Stewart G W (1973) An algorithm for generalized matrix eigenproblems SIAM J. Numer. Anal. 10 241–256
Stewart G W and Sun J-G (1990) Matrix Perturbation Theory Academic Press, London

5  Arguments

1:     JOB – CHARACTER(1)Input
On entry: specifies the operations to be performed on A,B.
JOB='E'
The matrix pair A,B on exit might not be in the generalized Schur form.
JOB='S'
The matrix pair A,B on exit will be in the generalized Schur form.
Constraint: JOB='E' or 'S'.
2:     COMPQ – CHARACTER(1)Input
On entry: specifies the operations to be performed on Q:
COMPQ='N'
The array Q is unchanged.
COMPQ='V'
The left transformation Q is accumulated on the array Q.
COMPQ='I'
The array Q is initialized to the identity matrix before the left transformation Q is accumulated in Q.
Constraint: COMPQ='N', 'V' or 'I'.
3:     COMPZ – CHARACTER(1)Input
On entry: specifies the operations to be performed on Z.
COMPZ='N'
The array Z is unchanged.
COMPZ='V'
The right transformation Z is accumulated on the array Z.
COMPZ='I'
The array Z is initialized to the identity matrix before the right transformation Z is accumulated in Z.
Constraint: COMPZ='N', 'V' or 'I'.
4:     N – INTEGERInput
On entry: n, the order of the matrices A, B, Q and Z.
Constraint: N0.
5:     ILO – INTEGERInput
6:     IHI – INTEGERInput
On entry: the indices ilo and ihi, respectively which define the upper triangular parts of A. The submatrices A1:ilo-1,1:ilo-1 and Aihi+1:n,ihi+1:n are then upper triangular. These arguments are provided by F08WVF (ZGGBAL) if the matrix pair was previously balanced; otherwise, ILO=1 and IHI=N.
Constraints:
  • if N>0, 1 ILO IHI N ;
  • if N=0, ILO=1 and IHI=0.
7:     ALDA* – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array A must be at least max1,N.
On entry: the n by n upper Hessenberg matrix A. The elements below the first subdiagonal must be set to zero.
On exit: if JOB='S', the matrix pair A,B will be simultaneously reduced to generalized Schur form.
If JOB='E', the 1 by 1 and 2 by 2 diagonal blocks of the matrix pair A,B will give generalized eigenvalues but the remaining elements will be irrelevant.
8:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F08XSF (ZHGEQZ) is called.
Constraint: LDAmax1,N.
9:     BLDB* – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array B must be at least max1,N.
On entry: the n by n upper triangular matrix B. The elements below the diagonal must be zero.
On exit: if JOB='S', the matrix pair A,B will be simultaneously reduced to generalized Schur form.
If JOB='E', the 1 by 1 and 2 by 2 diagonal blocks of the matrix pair A,B will give generalized eigenvalues but the remaining elements will be irrelevant.
10:   LDB – INTEGERInput
On entry: the first dimension of the array B as declared in the (sub)program from which F08XSF (ZHGEQZ) is called.
Constraint: LDBmax1,N.
11:   ALPHAN – COMPLEX (KIND=nag_wp) arrayOutput
On exit: αj, for j=1,2,,n.
12:   BETAN – COMPLEX (KIND=nag_wp) arrayOutput
On exit: βj, for j=1,2,,n.
13:   QLDQ* – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array Q must be at least max1,N if COMPQ='V' or 'I' and at least 1 if COMPQ='N'.
On entry: if COMPQ='V', the matrix Q0. The matrix Q0 is usually the matrix Q returned by F08WSF (ZGGHRD).
If COMPQ='N', Q is not referenced.
On exit: if COMPQ='V', Q contains the matrix product QQ0.
If COMPQ='I', Q contains the transformation matrix Q.
14:   LDQ – INTEGERInput
On entry: the first dimension of the array Q as declared in the (sub)program from which F08XSF (ZHGEQZ) is called.
Constraints:
  • if COMPQ='V' or 'I', LDQN;
  • if COMPQ='N', LDQ1.
15:   ZLDZ* – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array Z must be at least max1,N if COMPZ='V' or 'I' and at least 1 if COMPZ='N'.
On entry: if COMPZ='V', the matrix Z0. The matrix Z0 is usually the matrix Z returned by F08WSF (ZGGHRD).
If COMPZ='N', Z is not referenced.
On exit: if COMPZ='V', Z contains the matrix product ZZ0.
If COMPZ='I', Z contains the transformation matrix Z.
16:   LDZ – INTEGERInput
On entry: the first dimension of the array Z as declared in the (sub)program from which F08XSF (ZHGEQZ) is called.
Constraints:
  • if COMPZ='V' or 'I', LDZN;
  • if COMPZ='N', LDZ1.
17:   WORKmax1,LWORK – COMPLEX (KIND=nag_wp) arrayWorkspace
On exit: if INFO=0, the real part of WORK1 contains the minimum value of LWORK required for optimal performance.
18:   LWORK – INTEGERInput
On entry: the dimension of the array WORK as declared in the (sub)program from which F08XSF (ZHGEQZ) is called.
If LWORK=-1, a workspace query is assumed; the routine only calculates the minimum size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued.
Constraint: LWORKmax1,N or LWORK=-1.
19:   RWORKN – REAL (KIND=nag_wp) arrayWorkspace
20:   INFO – INTEGEROutput
On exit: INFO=0 unless the routine detects an error (see Section 6).

6  Error Indicators and Warnings

INFO<0
If INFO=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.
INFO>0
If 1INFON, the QZ iteration did not converge and the matrix pair A,B is not in the generalized Schur form at exit. However, if INFO<N, then the computed αi and βi should be correct for i=INFO+1,,N.
If N+1INFO2×N, the computation of shifts failed and the matrix pair A,B is not in the generalized Schur form at exit. However, if INFO<2×N, then the computed αi and βi should be correct for i=INFO-N+1,,N.
If INFO>2×N, then an unexpected Library error has occurred. Please contact NAG with details of your program.

7  Accuracy

Please consult Section 4.11 of the LAPACK Users' Guide (see Anderson et al. (1999)) and Chapter 6 of Stewart and Sun (1990), for more information.

8  Parallelism and Performance

F08XSF (ZHGEQZ) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9  Further Comments

F08XSF (ZHGEQZ) is the fifth step in the solution of the complex generalized eigenvalue problem and is called after F08WSF (ZGGHRD).
The number of floating-point operations taken by this routine is proportional to n3.
The real analogue of this routine is F08XEF (DHGEQZ).

10  Example

This example computes the α and β arguments, which defines the generalized eigenvalues, of the matrix pair A,B given by
A = 1.0+3.0i 1.0+4.0i 1.0+5.0i 1.0+6.0i 2.0+2.0i 4.0+3.0i 8.0+4.0i 16.0+5.0i 3.0+1.0i 9.0+2.0i 27.0+3.0i 81.0+4.0i 4.0+0.0i 16.0+1.0i 64.0+2.0i 256.0+3.0i  
and
B = 1.0+0.0i 2.0+1.0i 3.0+2.0i 4.0+3.0i 1.0+1.0i 4.0+2.0i 9.0+3.0i 16.0+4.0i 1.0+2.0i 8.0+3.0i 27.0+4.0i 64.0+5.0i 1.0+3.0i 16.0+4.0i 81.0+5.0i 256.0+6.0i .  
This requires calls to five routines: F08WVF (ZGGBAL) to balance the matrix, F08ASF (ZGEQRF) to perform the QR factorization of B, F08AUF (ZUNMQR) to apply Q to A, F08WSF (ZGGHRD) to reduce the matrix pair to the generalized Hessenberg form and F08XSF (ZHGEQZ) to compute the eigenvalues using the QZ algorithm.

10.1  Program Text

Program Text (f08xsfe.f90)

10.2  Program Data

Program Data (f08xsfe.d)

10.3  Program Results

Program Results (f08xsfe.r)


F08XSF (ZHGEQZ) (PDF version)
F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2016