# gqz: Generalized Schur decomposition In geigen: Calculate Generalized Eigenvalues, the Generalized Schur Decomposition and the Generalized Singular Value Decomposition of a Matrix Pair with Lapack

## Description

Computes the generalized eigenvalues and Schur form of a pair of matrices.

## Usage

 `1` ```gqz(A, B, sort=c("N","-","+","S","B","R")) ```

## Arguments

 `A` left hand side matrix. `B` right hand side matrix. `sort` how to sort the generalized eigenvalues. See ‘Details’.

## Details

Both matrices must be square. This function provides the solution to the generalized eigenvalue problem defined by

A*x = lambda B*x

If either one of the matrices is complex the other matrix is coerced to be complex.

The `sort` argument specifies how to order the eigenvalues on the diagonal of the generalized Schur form, where it is noted that non-finite eigenvalues never satisfy any ordering condition (even in the case of a complex infinity). Eigenvalues that are placed in the leading block of the Schur form satisfy

`N`

unordered.

`-`

negative real part.

`+`

positive real part.

`S`

absolute value < 1.

`B`

absolute value > 1.

`R`

imaginary part identical to 0 with a tolerance of 100*machine_precision as determined by Lapack.

## Value

The generalized Schur form for numeric matrices is

(A,B) = (Q*S*Z^T, Q*T*Z^T)

The matrices Q and Z are orthogonal. The matrix S is quasi-upper triangular and the matrix T is upper triangular. The return value is a list containing the following components

`S`

generalized Schur form of A.

`T`

generalized Schur form of B.

`sdim`

the number of eigenvalues (after sorting) for which the sorting condition is true.

`alphar`

numerator of the real parts of the eigenvalues (numeric).

`alphai`

numerator of the imaginary parts of the eigenvalues (numeric).

`beta`

denominator of the expression for the eigenvalues (numeric).

`Q`

matrix of left Schur vectors (matrix Q).

`Z`

matrix of right Schur vectors (matrix Z).

The generalized Schur form for complex matrices is

(A,B) = (Q*S*Z^H, Q*T*Z^H)

The matrices Q and Z are unitary and the matrices S and T are upper triangular. The return value is a list containing the following components

`S`

generalized Schur form of A.

`T`

generalized Schur form of B.

`sdim`

the number of eigenvalues. (after sorting) for which the sorting condition is true.

`alpha`

numerator of the eigenvalues (complex).

`beta`

denominator of the eigenvalues (complex).

`Q`

matrix of left Schur vectors (matrix Q).

`Z`

matrix of right Schur vectors (matrix Z).

The generalized eigenvalues can be computed by calling function `gevalues`.

## Source

`gqz` uses the LAPACK routines `DGGES` and `ZGGES`. LAPACK is from http://www.netlib.org/lapack. The complex routines used by the package come from LAPACK 3.8.0.

## References

Anderson. E. and ten others (1999) LAPACK Users' Guide. Third Edition. SIAM.
Available on-line at http://www.netlib.org/lapack/lug/lapack_lug.html. See the section Eigenvalues, Eigenvectors and Generalized Schur Decomposition (http://www.netlib.org/lapack/lug/node56.html).

`geigen`, `gevalues`

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22``` ```# Real matrices # example from NAG: http://www.nag.com/lapack-ex/node116.html # Find the generalized Schur decomposition with the real eigenvalues ordered to come first A <- matrix(c( 3.9, 12.5,-34.5,-0.5, 4.3, 21.5,-47.5, 7.5, 4.3, 21.5,-43.5, 3.5, 4.4, 26.0,-46.0, 6.0), nrow=4, byrow=TRUE) B <- matrix(c( 1.0, 2.0, -3.0, 1.0, 1.0, 3.0, -5.0, 4.0, 1.0, 3.0, -4.0, 3.0, 1.0, 3.0, -4.0, 4.0), nrow=4, byrow=TRUE) z <- gqz(A, B,"R") z # complexify A <- A+0i B <- B+0i z <- gqz(A, B,"R") z ```

### Example output

```\$S
[,1]       [,2]       [,3]       [,4]
[1,] 3.800912 -69.450536 50.3134928 -43.288415
[2,] 0.000000   9.203303 -0.2001382   5.988071
[3,] 0.000000   0.000000  1.4278921   4.445296
[4,] 0.000000   0.000000  0.9019321  -1.196199

\$T
[,1]       [,2]      [,3]       [,4]
[1,] 1.900456 -10.228464 0.8658216 -5.2133694
[2,] 0.000000   2.300826 0.7915033  0.4261764
[3,] 0.000000   0.000000 0.8101464  0.0000000
[4,] 0.000000   0.000000 0.0000000 -0.2822896

\$sdim
 2

\$alphar
 3.8009124 9.2033029 0.8571429 0.8571429

\$alphai
  0.000000  0.000000  1.142857 -1.142857

\$beta
 1.9004562 2.3008257 0.2857143 0.2857143

\$Q
[,1]       [,2]        [,3]       [,4]
[1,] 0.4642154  0.7886199  0.29148041 -0.2786068
[2,] 0.5001547 -0.5986435  0.56379490 -0.2713053
[3,] 0.5001547  0.0154060 -0.01073843  0.8657324
[4,] 0.5330990 -0.1395249 -0.77269604 -0.3150858

\$Z
[,1]         [,2]        [,3]         [,4]
[1,] 0.996056108 -0.001400016  0.08867638 -0.002601947
[2,] 0.005691749 -0.040374311 -0.09375821 -0.994759728
[3,] 0.062609241  0.719382130 -0.69083549  0.036273380
[4,] 0.062609241 -0.693438754 -0.71140159  0.095553937

\$S
[,1]                 [,2]                 [,3]                 [,4]
[1,] 3.800912-0i -10.526945-68.64809i 23.568740-33.363185i 51.077080+11.308345i
[2,] 0.000000+0i   9.203303+ 0.00000i -1.276124+ 3.354217i  0.939029+ 4.704892i
[3,] 0.000000+0i   0.000000+ 0.00000i  1.999285- 2.665713i -1.464686- 2.802026i
[4,] 0.000000+0i   0.000000+ 0.00000i  0.000000+ 0.000000i  1.029500+ 1.372666i

\$T
[,1]                [,2]                  [,3]
[1,] 1.900456+0i -1.550376-10.11028i  3.0294927+0.1063502i
[2,] 0.000000+0i  2.300826+ 0.00000i -0.7277894+0.1710293i
[3,] 0.000000+0i  0.000000+ 0.00000i  0.6664283+0.0000000i
[4,] 0.000000+0i  0.000000+ 0.00000i  0.0000000+0.0000000i
[,4]
[1,]  4.1865850-1.1010167i
[2,]  0.4907230+0.0914670i
[3,] -0.3379006+0.2448629i
[4,]  0.3431666+0.0000000i

\$sdim
 2

\$alpha
 3.800912-0.000000i 9.203303+0.000000i 1.999285-2.665713i 1.029500+1.372666i

\$beta
 1.9004562+0i 2.3008257+0i 0.6664283+0i 0.3431666+0i

\$Q
[,1]                    [,2]                  [,3]
[1,] -0.4594808-0.0661317i -0.00726767-0.78858646i  0.0388454+0.3080388i
[2,] -0.4950535-0.0712516i  0.00551691+0.59861808i  0.0117161+0.5692560i
[3,] -0.4950535-0.0712516i -0.00014198-0.01540535i -0.2041832-0.0962817i
[4,] -0.5276618-0.0759448i  0.00128582+0.13951896i  0.1467471-0.7119816i
[,4]
[1,]  0.2242458-0.1260935i
[2,]  0.1819758-0.1848415i
[3,] -0.8131595+0.1934388i
[4,]  0.3969078+0.1017345i

\$Z
[,1]                      [,2]
[1,] -0.985897027-0.141897220i  1.2902e-05+1.399957e-03i
[2,] -0.005633697-0.000810841i  3.7208e-04+4.037260e-02i
[3,] -0.061970670-0.008919254i -6.6296e-03-7.193516e-01i
[4,] -0.061970670-0.008919254i  6.3905e-03+6.934093e-01i
[,3]                    [,4]
[1,] -0.00825948+0.06955706i -0.02922826-0.04593012i
[2,] -0.54940006-0.30734608i -0.74114512+0.22965060i
[3,]  0.07329972-0.53813510i  0.24008926+0.35491456i
[4,]  0.10804663-0.54051388i  0.29228258+0.35491456i
```

geigen documentation built on May 30, 2019, 5:03 p.m.