NAG Library Routine Document F02HDF.1

Similar documents
NAG Library Routine Document F08FNF (ZHEEV).1

NAG Fortran Library Routine Document F04CFF.1

NAG Library Routine Document F08FAF (DSYEV)

NAG Library Routine Document F08FPF (ZHEEVX)

NAG Library Routine Document F08YUF (ZTGSEN).1

NAG Library Routine Document F08PNF (ZGEES)

NAG Library Routine Document F08UBF (DSBGVX)

NAG Library Routine Document F08QVF (ZTRSYL)

NAG Library Routine Document F08QUF (ZTRSEN)

NAG Library Routine Document F07HAF (DPBSV)

F08BEF (SGEQPF/DGEQPF) NAG Fortran Library Routine Document

NAG Library Routine Document F08JDF (DSTEVR)

NAG Library Routine Document F08VAF (DGGSVD)

F04JGF NAG Fortran Library Routine Document

NAG Library Routine Document F08ZFF (DGGRQF).1

NAG Library Routine Document D02JAF.1

G01NBF NAG Fortran Library Routine Document

NAG Fortran Library Routine Document D02JAF.1

G03ACF NAG Fortran Library Routine Document

G13DSF NAG Fortran Library Routine Document

NAG Library Routine Document C02AGF.1

NAG Toolbox for Matlab nag_lapack_dggev (f08wa)

G13DCF NAG Fortran Library Routine Document

G13CCF NAG Fortran Library Routine Document

G13CGF NAG Fortran Library Routine Document

G13BAF NAG Fortran Library Routine Document

Matrix Eigensystem Tutorial For Parallel Computation

G13BHF NAG Fortran Library Routine Document

NAG C Library Function Document nag_dtrevc (f08qkc)

G13DJF NAG Fortran Library Routine Document

NAG Toolbox for MATLAB Chapter Introduction. F02 Eigenvalues and Eigenvectors

Module 5.2: nag sym lin sys Symmetric Systems of Linear Equations. Contents

Module 6.6: nag nsym gen eig Nonsymmetric Generalized Eigenvalue Problems. Contents

D02TYF NAG Fortran Library Routine Document

NAG Library Chapter Introduction. f08 Least-squares and Eigenvalue Problems (LAPACK)

Chapter f Linear Algebra

NAG Toolbox for Matlab. g03aa.1

D03PEF NAG Fortran Library Routine Document

NAG Fortran Library Routine Document D01BBF.1

NAG Fortran Library Routine Document D02KDF.1

Section 4.5 Eigenvalues of Symmetric Tridiagonal Matrices

LAPACK Introduction. Zhaojun Bai University of California/Davis. James Demmel University of California/Berkeley

Exponentials of Symmetric Matrices through Tridiagonal Reductions

11.0 Introduction. An N N matrix A is said to have an eigenvector x and corresponding eigenvalue λ if. A x = λx (11.0.1)

Eigenvalue problems. Eigenvalue problems

NAG Library Routine Document D02KDF.1

Numerical Linear Algebra

LAPACK-Style Codes for Level 2 and 3 Pivoted Cholesky Factorizations. C. Lucas. Numerical Analysis Report No February 2004

Intel Math Kernel Library (Intel MKL) LAPACK

Lecture 10: Eigenvectors and eigenvalues (Numerical Recipes, Chapter 11)

Solving large scale eigenvalue problems

LAPACK-Style Codes for Pivoted Cholesky and QR Updating

LAPACK-Style Codes for Pivoted Cholesky and QR Updating. Hammarling, Sven and Higham, Nicholas J. and Lucas, Craig. MIMS EPrint: 2006.

NAG Toolbox for Matlab. g08cd.1

Homework 1 Elena Davidson (B) (C) (D) (E) (F) (G) (H) (I)

THE RELATION BETWEEN THE QR AND LR ALGORITHMS

11.2 Reduction of a Symmetric Matrix to Tridiagonal Form: Givens and Householder Reductions

SHHEIG Users Guide. Peter Benner, Vasile Sima, and Matthias Voigt June 10, 2015

Solving large scale eigenvalue problems

MATH 423 Linear Algebra II Lecture 33: Diagonalization of normal operators.

Linear Algebra and Matrices

Algebraic Equations. 2.0 Introduction. Nonsingular versus Singular Sets of Equations. A set of linear algebraic equations looks like this:

Lecture 11. Linear systems: Cholesky method. Eigensystems: Terminology. Jacobi transformations QR transformation

Aasen s Symmetric Indefinite Linear Solvers in LAPACK

Algorithm 853: an Efficient Algorithm for Solving Rank-Deficient Least Squares Problems

Eigenvalues and Eigenvectors

Numerical Linear Algebra

Module 10.1: nag polynom eqn Roots of Polynomials. Contents

Numerical Linear Algebra Homework Assignment - Week 2

Orthogonal iteration to QR

Package geigen. August 22, 2017

On the Iwasawa decomposition of a symplectic matrix

Inverses. Stephen Boyd. EE103 Stanford University. October 28, 2017

D01BBF NAG Fortran Library Routine Document

A Method for Constructing Diagonally Dominant Preconditioners based on Jacobi Rotations

(Linear equations) Applied Linear Algebra in Geoscience Using MATLAB

Eigenvalue Problems and Singular Value Decomposition

Linear Algebra. PHY 604: Computational Methods in Physics and Astrophysics II

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for

Eigenvalues and Eigenvectors

Accelerating computation of eigenvectors in the nonsymmetric eigenvalue problem

11.5 Reduction of a General Matrix to Hessenberg Form

Is there a Small Skew Cayley Transform with Zero Diagonal?

A Backward Stable Hyperbolic QR Factorization Method for Solving Indefinite Least Squares Problem

MATH 425-Spring 2010 HOMEWORK ASSIGNMENTS

Accelerating computation of eigenvectors in the dense nonsymmetric eigenvalue problem

Computation of eigenvalues and singular values Recall that your solutions to these questions will not be collected or evaluated.

Computing Eigenvalues and/or Eigenvectors;Part 2, The Power method and QR-algorithm

Performance Evaluation of Some Inverse Iteration Algorithms on PowerXCell T M 8i Processor

Remark By definition, an eigenvector must be a nonzero vector, but eigenvalue could be zero.

Theoretical Computer Science

Positive Denite Matrix. Ya Yan Lu 1. Department of Mathematics. City University of Hong Kong. Kowloon, Hong Kong. Abstract

Math 489AB Exercises for Chapter 2 Fall Section 2.3

EIGIFP: A MATLAB Program for Solving Large Symmetric Generalized Eigenvalue Problems

632 CHAP. 11 EIGENVALUES AND EIGENVECTORS. QR Method

Matrix Algebra: Summary

Linear algebra & Numerical Analysis

3.5 Finite Differences and Fast Poisson Solvers

Math 502 Fall 2005 Solutions to Homework 4

A Divide-and-Conquer Algorithm for Functions of Triangular Matrices

Transcription:

F02 Eigenvalues and Eigenvectors NAG Library Routine Document 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. 1 Purpose computes all the eigenvalues, and optionally all the eigenvectors, of a complex Hermitian-definite generalized eigenproblem. 2 Specification SUBROUTINE (ITYPE, JOB, UPLO, N, A, LDA, B, LDB, W, RWORK, WORK, 1 LWORK, IFAIL) INTEGER ITYPE, N, LDA, LDB, LWORK, IFAIL double precision W(N), RWORK(3N) complex16 A(LDA,), B(LDB,), WORK(LWORK) CHARACTER1 JOB, UPLO 3 Description computes all the eigenvalues, and optionally all the eigenvectors, of a complex Hermitian-definite generalized eigenproblem of one of the following types: 1. Az ¼ Bz 2. ABz ¼ z 3. BAz ¼ z Here A and B are Hermitian, and B must be positive-definite. The method involves implicitly inverting B; hence if B is ill-conditioned with respect to inversion, the results may be inaccurate (see Section 7). Note that the matrix Z of eigenvectors is not unitary, but satisfies the following relationships for the three types of problem above: 1. Z H BZ ¼ I 2. Z H BZ ¼ I 3. Z H B 1 Z ¼ I 4 References Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore Parlett B N (1998) The Symmetric Eigenvalue Problem SIAM, Philadelphia 5 Parameters 1: ITYPE INTEGER Input On entry: indicates the type of problem. ITYPE ¼ 1 The problem is Az ¼ Bz;.1

NAG Library Manual ITYPE ¼ 2 The problem is ABz ¼ z; ITYPE ¼ 3 The problem is BAz ¼ z. Constraint: ITYPE ¼ 1, 2 or 3. 2: JOB CHARACTER1 Input On entry: indicates whether eigenvectors are to be computed. JOB ¼ N Only eigenvalues are computed. JOB ¼ V Eigenvalues and eigenvectors are computed. Constraint: JOB ¼ N or V. 3: UPLO CHARACTER1 Input On entry: indicates whether the upper or lower triangular parts of A and B are stored. UPLO ¼ U The upper triangular parts of A and B are stored. UPLO ¼ L The lower triangular parts of A and B are stored. Constraint: UPLO ¼ U or L. 4: N INTEGER Input On entry: the dimension of the array W as declared in the (sub)program from which is called.n, the order of the matrices A and B. Constraint: N 0. 5: AðLDA,Þ complex16 array Input/Output Note: the second dimension of the array A must be at least maxð1; NÞ. On entry: the n by n Hermitian matrix A. If UPLO ¼ U, the upper triangle of A must be stored and the elements of the array below the diagonal need not be set. If UPLO ¼ L, the lower triangle of A must be stored and the elements of the array above the diagonal need not be set. On exit: if JOB ¼ V, A contains the matrix Z of eigenvectors, with the ith column holding the eigenvector z i associated with the eigenvalue i (stored in WðiÞ). If JOB ¼ N, the original contents of A are overwritten. 6: LDA INTEGER Input On entry: the first dimension of the array A as declared in the (sub)program from which is called. Constraint: LDA maxð1; NÞ. 7: BðLDB,Þ complex16 array Input/Output Note: the second dimension of the array B must be at least maxð1; NÞ. On entry: the n by n Hermitian positive-definite matrix B..2

F02 Eigenvalues and Eigenvectors If UPLO ¼ U, the upper triangle of B must be stored and the elements of the array below the diagonal are not referenced. If UPLO ¼ L, the lower triangle of B must be stored and the elements of the array above the diagonal are not referenced. On exit: the upper or lower triangle of B (as specified by UPLO) is overwritten by the triangular factor U or L from the Cholesky factorization of B as U H U or LL H. 8: LDB INTEGER Input On entry: the first dimension of the array B as declared in the (sub)program from which is called. Constraint: LDB maxð1; NÞ. 9: WðNÞ double precision array Output On exit: the eigenvalues in ascending order. 10: RWORKð3 NÞ double precision array Workspace 11: WORKðLWORKÞ complex16 array Workspace 12: LWORK INTEGER Input On entry: the dimension of the array WORK as declared in the (sub)program from which is called. On some high-performance computers, increasing the dimension of WORK will enable the routine to run faster; a value of 64 N should allow near-optimal performance on almost all machines. Constraint: LWORK maxð1; 2 NÞ. 13: IFAIL INTEGER Input/Output On entry: IFAIL must be set to 0, 1 or 1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details. On exit: IFAIL ¼ 0 unless the routine detects an error (see Section 6). For environments where it might be inappropriate to halt program execution when an error is detected, the value 1 or 1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value 1 or 1 is used it is essential to test the value of IFAIL on exit. 6 Error Indicators and Warnings If on entry IFAIL ¼ 0or 1, explanatory error messages are output on the current error message unit (as defined by X04AAF). Errors or warnings detected by the routine: IFAIL ¼ 1 On entry, ITYPE 6¼ 1, 2 or 3, or JOB 6¼ N or V, or UPLO 6¼ U or L, or N < 0, or LDA < maxð1; NÞ, or LDB < maxð1; NÞ, or LWORK < maxð1; 2 NÞ. IFAIL ¼ 2 The QR algorithm failed to compute all the eigenvalues..3

NAG Library Manual IFAIL ¼ 3 The matrix B is not positive-definite. IFAIL ¼ 4 For some i, Aði; iþ has a nonzero imaginary part (thus A is not Hermitian). IFAIL ¼ 5 For some i, Bði; iþ has a nonzero imaginary part (thus B is not Hermitian). 7 Accuracy If i is an exact eigenvalue, and ~ i is the corresponding computed value, then for problems of the form Az ¼ Bz, ~ i i cn ð ÞkAk2 B 1 2 ; and for problems of the form ABz ¼ z or BAz ¼ z, ~ i i cn ð ÞA k k2 kbk 2. Here cn ð Þ is a modestly increasing function of n, and is the machine precision. If z i is the corresponding exact eigenvector, and ~z i is the corresponding computed eigenvector, then the angle ð~z i ;z i Þ between them is bounded as follows: for problems of the form Az ¼ Bz, ð~z i ;z i Þ cn ð ÞA k k 2 B 1 2 ð 2 ðbþþ 1=2 min i j ; and for problems of the form ABz ¼ z or BAz ¼ z, ð~z i ;z i Þ cn ð ÞkAk 2 kbk 2ð 2ðBÞÞ 1=2 min i j. i6¼j i6¼j Here 2 ðbþ is the condition number of B with respect to inversion defined by: 2 ðbþ ¼ kbk: B 1. Thus the accuracy of a computed eigenvector depends on the gap between its eigenvalue and all the other eigenvalues, and also on the condition of B. 8 Further Comments calls routines from LAPACK in Chapter F08. It first reduces the problem to an equivalent standard eigenproblem Cy ¼ y. It then reduces C to real tridiagonal form T, using a unitary similarity transformation: C ¼ QT Q H. To compute eigenvalues only, the routine uses a root-free variant of the symmetric tridiagonal QR algorithm to reduce T to a diagonal matrix. If eigenvectors are required, the routine first forms the unitary matrix Q that was used in the reduction to tridiagonal form; it then uses the symmetric tridiagonal QR algorithm to reduce T to, using a real orthogonal transformation: T ¼ SS T ; and at the same time accumulates the matrix Y ¼ QS, which is the matrix of eigenvectors of C. Finally it transforms the eigenvectors of C back to those of the original generalized problem. Each eigenvector z is normalized so that: for problems of the form Az ¼ Bz or ABz ¼ z, z H Bz ¼ 1; for problems of the form BAz ¼ z, z H B 1 z ¼ 1. The time taken by the routine is approximately proportional to n 3..4

F02 Eigenvalues and Eigenvectors 9 Example This example computes all the eigenvalues and eigenvectors of the problem Az ¼ Bz, where 0 1 7:36 þ 0:00i 0:77 0:43i 0:64 0:92i 3:01 6:97i 0:77 þ 0:43i 3:49 þ 0:00i 2:19 þ 4:45i 1:90 þ 3:73i A ¼ B C @ 0:64 þ 0:92i 2:19 4:45i 0:12 þ 0:00i 2:88 3:17i A 3:01 þ 6:97i 1:90 3:73i 2:88 þ 3:17i 2:54 þ 0:00i and 9.1 Program Text 0 1 3:23 þ 0:00i 1:51 1:92i 1:90 þ 0:84i 0:42 þ 2:50i 1:51 þ 1:92i 3:58 þ 0:00i 0:23 þ 1:11i 1:18 þ 1:37i B ¼ B C @ 1:90 0:84i 0:23 1:11i 4:09 þ 0:00i 2:33 0:14i A. 0:42 2:50i 1:18 1:37i 2:33 þ 0:14i 4:29 þ 0:00i Example Program Text Mark 16 Release. NAG Copyright 1992... Parameters.. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER NMAX, LDA, LDB, LWORK PARAMETER (NMAX=8,LDA=NMAX,LDB=NMAX,LWORK=64NMAX).. Local Scalars.. INTEGER I, IFAIL, ITYPE, J, N CHARACTER UPLO.. Local Arrays.. COMPLEX 16 A(LDA,NMAX), B(LDB,NMAX), WORK(LWORK) DOUBLE PRECISION RWORK(3NMAX), W(NMAX) CHARACTER CLABS(1), RLABS(1).. External Subroutines.. EXTERNAL, X04DBF.. Executable Statements.. WRITE (NOUT,) Example Program Results Skip heading in data file READ (NIN,) READ (NIN,) N IF (N.LE.NMAX) THEN Read A and B from data file READ (NIN,) UPLO IF (UPLO.EQ. U ) THEN READ (NIN,) ((A(I,J),J=I,N),I=1,N) READ (NIN,) ((B(I,J),J=I,N),I=1,N) ELSE IF (UPLO.EQ. L ) THEN READ (NIN,) ((A(I,J),J=1,I),I=1,N) READ (NIN,) ((B(I,J),J=1,I),I=1,N) END IF Compute eigenvalues and eigenvectors ITYPE = 1 IFAIL = 1 CALL (ITYPE, Vectors,UPLO,N,A,LDA,B,LDB,W,RWORK,WORK, + LWORK,IFAIL) IF (IFAIL.EQ.0) THEN WRITE (NOUT,) WRITE (NOUT,) Eigenvalues WRITE (NOUT,99999) (W(I),I=1,N) WRITE (NOUT,) IFAIL = 0 CALL X04DBF( General,,N,N,A,LDA, Bracketed, F7.4, + Eigenvectors, Integer,RLABS, Integer,CLABS,.5

NAG Library Manual + 80,0,IFAIL) ELSE WRITE (NOUT,99998) IFAIL END IF END IF 99999 FORMAT (3X,4(F12.4,6X)) 99998 FORMAT (1X,/1X, returned with IFAIL =,I5) END 9.2 Program Data Example Program Data 4 :Value of N L :Value of UPLO (-7.36, 0.00) ( 0.77, 0.43) ( 3.49, 0.00) (-0.64, 0.92) ( 2.19,-4.45) ( 0.12, 0.00) ( 3.01, 6.97) ( 1.90,-3.73) ( 2.88, 3.17) (-2.54, 0.00) :End of matrix A ( 3.23, 0.00) ( 1.51, 1.92) ( 3.58, 0.00) ( 1.90,-0.84) (-0.23,-1.11) ( 4.09, 0.00) ( 0.42,-2.50) (-1.18,-1.37) ( 2.33, 0.14) ( 4.29, 0.00) :End of matrix B 9.3 Program Results Example Program Results Eigenvalues -5.9990-2.9936 0.5047 3.9990 Eigenvectors 1 2 3 4 1 ( 1.7372, 0.1062) ( 0.4889,-0.5010) ( 0.6164, 0.1937) ( 0.2310,-1.2161) 2 (-0.3843,-0.4933) ( 0.1118,-0.0367) ( 0.2596,-0.4203) (-0.4710, 0.4814) 3 (-0.8237,-0.2991) (-0.8115, 0.4114) (-0.0365,-0.3321) (-0.2242, 0.6335) 4 ( 0.2643, 0.6276) ( 0.7877, 0.2002) ( 0.0994, 0.6588) ( 0.8515, 0.0000).6 (last)