NAG Library Routine Document F08FPF (ZHEEVX)

Similar documents
NAG Library Routine Document F08JDF (DSTEVR)

NAG Library Routine Document F08FAF (DSYEV)

NAG Library Routine Document F08UBF (DSBGVX)

NAG Library Routine Document F08FNF (ZHEEV).1

NAG Library Routine Document F08PNF (ZGEES)

NAG Library Routine Document F07HAF (DPBSV)

NAG Library Routine Document F08QUF (ZTRSEN)

NAG Library Routine Document F08VAF (DGGSVD)

NAG Library Routine Document F08YUF (ZTGSEN).1

NAG Library Routine Document F02HDF.1

NAG Fortran Library Routine Document F04CFF.1

NAG Library Routine Document F08QVF (ZTRSYL)

NAG Library Routine Document F08ZFF (DGGRQF).1

F08BEF (SGEQPF/DGEQPF) NAG Fortran Library Routine Document

NAG Toolbox for Matlab nag_lapack_dggev (f08wa)

F04JGF NAG Fortran Library Routine Document

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

NAG Library Routine Document C02AGF.1

G03ACF NAG Fortran Library Routine Document

NAG Fortran Library Routine Document D02JAF.1

G01NBF NAG Fortran Library Routine Document

NAG Library Routine Document D02JAF.1

G13DSF NAG Fortran Library Routine Document

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

G13CCF NAG Fortran Library Routine Document

G13CGF NAG Fortran Library Routine Document

G13DCF NAG Fortran Library Routine Document

NAG C Library Function Document nag_dtrevc (f08qkc)

G13BHF NAG Fortran Library Routine Document

Exponentials of Symmetric Matrices through Tridiagonal Reductions

NAG Library Routine Document D02KDF.1

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

D02TYF NAG Fortran Library Routine Document

G13BAF NAG Fortran Library Routine Document

NAG Toolbox for MATLAB Chapter Introduction. F02 Eigenvalues and Eigenvectors

NAG Toolbox for Matlab. g03aa.1

Aasen s Symmetric Indefinite Linear Solvers in LAPACK

LAPACK-Style Codes for Pivoted Cholesky and QR Updating

Using Godunov s Two-Sided Sturm Sequences to Accurately Compute Singular Vectors of Bidiagonal Matrices.

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

D03PEF NAG Fortran Library Routine Document

Generalized interval arithmetic on compact matrix Lie groups

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

G13DJF NAG Fortran Library Routine Document

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

Module 10.1: nag polynom eqn Roots of Polynomials. Contents

Computing least squares condition numbers on hybrid multicore/gpu systems

Matrix Eigensystem Tutorial For Parallel Computation

A note on eigenvalue computation for a tridiagonal matrix with real eigenvalues Akiko Fukuda

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

Unsupervised Data Discretization of Mixed Data Types

NAG Fortran Library Routine Document D02KDF.1

Eigenvalue problems. Eigenvalue problems

Implementation for LAPACK of a Block Algorithm for Matrix 1-Norm Estimation

Computation of a canonical form for linear differential-algebraic equations

D. Gimenez, M. T. Camara, P. Montilla. Aptdo Murcia. Spain. ABSTRACT

Module 10.2: nag nlin eqn Roots of a Single Nonlinear Equation. Contents

A hybrid Hermitian general eigenvalue solver

A New Block Algorithm for Full-Rank Solution of the Sylvester-observer Equation.

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

Section 4.5 Eigenvalues of Symmetric Tridiagonal Matrices

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

Stability of a method for multiplying complex matrices with three real matrix multiplications. Higham, Nicholas J. MIMS EPrint: 2006.

2 MULTIPLYING COMPLEX MATRICES It is rare in matrix computations to be able to produce such a clear-cut computational saving over a standard technique

The QR Algorithm. Chapter The basic QR algorithm

NAG Toolbox for Matlab. g08cd.1

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

NAG Fortran Library Routine Document D01BBF.1

1. Introduction. Applying the QR algorithm to a real square matrix A yields a decomposition of the form

The Godunov Inverse Iteration: A Fast and Accurate Solution to the Symmetric Tridiagonal Eigenvalue Problem

Intel Math Kernel Library (Intel MKL) LAPACK

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

Bidiagonal SVD Computation via an Associated Tridiagonal Eigenproblem

Chapter f Linear Algebra

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

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

A.l INTRODUCTORY CONCEPTS AND OPERATIONS umnx, = b, az3z3 = b, i = 1,... m (A.l-2)

COMPUTING THE CONDITION NUMBER OF TRIDIAGONAL AND DIAGONAL-PLUS-SEMISEPARABLE MATRICES IN LINEAR TIME

Beresford N. Parlett Λ. April 22, Early History of Eigenvalue Computations 1. 2 The LU and QR Algorithms 3. 3 The Symmetric Case 8

Eigenvalue Problems and Singular Value Decomposition

Accelerating computation of eigenvectors in the nonsymmetric eigenvalue problem

Numerical Solution of Generalized Lyapunov Equations. Thilo Penzl. March 13, Abstract

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

Accelerating computation of eigenvectors in the dense nonsymmetric eigenvalue problem

Solving Orthogonal Matrix Differential Systems in Mathematica

Jacobian conditioning analysis for model validation

Testing Linear Algebra Software

problem Au = u by constructing an orthonormal basis V k = [v 1 ; : : : ; v k ], at each k th iteration step, and then nding an approximation for the e

OUTLINE 1. Introduction 1.1 Notation 1.2 Special matrices 2. Gaussian Elimination 2.1 Vector and matrix norms 2.2 Finite precision arithmetic 2.3 Fact

arxiv: v1 [math.na] 7 May 2009

SRRIT A FORTRAN Subroutine to Calculate the Dominant Invariant Subspace of a Nonsymmetric Matrix Z. Bai y G. W. Stewart z Abstract SRRIT is a FORTRAN

Package geigen. August 22, 2017

CVXOPT Documentation. Release 1.2. Martin S. Andersen, Joachim Dahl, and Lieven Vandenberghe

Symmetric Pivoting in ScaLAPACK Craig Lucas University of Manchester Cray User Group 8 May 2006, Lugano

Porting a Sphere Optimization Program from lapack to scalapack

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)

Block-Partitioned Algorithms for. Solving the Linear Least Squares. Problem. Gregorio Quintana-Orti, Enrique S. Quintana-Orti, and Antoine Petitet

Week6. Gaussian Elimination. 6.1 Opening Remarks Solving Linear Systems. View at edx

Preconditioned Parallel Block Jacobi SVD Algorithm

Lecture notes on Quantum Computing. Chapter 1 Mathematical Background

Transcription:

NAG Library Routine Document (ZHEEVX) 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 (ZHEEVX) computes selected eigenvalues and, optionally, eigenvectors of a complex n by n Hermitian matrix A. Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues. 2 Specification SUBROUTINE (JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, LWORK, RWORK, IWORK, JFAIL, INFO) INTEGER N, LDA, IL, IU, M, LDZ, LWORK, IWORK(*), JFAIL(*), INFO REAL (KIND=nag_wp) VL, VU, ABSTOL, W(*), RWORK(*) COMPLEX (KIND=nag_wp) A(LDA,*), Z(LDZ,*), WORK(max(1,LWORK)) CHARACTER(1) JOBZ, RANGE, UPLO & & The routine may be called by its LAPACK name zheevx. 3 Description The Hermitian matrix A is first reduced to real tridiagonal form, using unitary similarity transformations. The required eigenvalues and eigenvectors are then computed from the tridiagonal matrix; the method used depends upon whether all, or selected, eigenvalues and eigenvectors are required. 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 http://www.netlib.org/lapack/lug Demmel J W and Kahan W (1990) Accurate singular values of bidiagonal matrices SIAM J. Sci. Statist. Comput. 11 873 912 Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore 5 Parameters 1: JOBZ CHARACTER(1) Input On entry: indicates whether eigenvectors are computed. JOBZ ¼ N Only eigenvalues are computed. JOBZ ¼ V Eigenvalues and eigenvectors are computed. Constraint: JOBZ ¼ N or V. 2: RANGE CHARACTER(1) Input On entry: if RANGE ¼ A, all eigenvalues will be found..1

NAG Library Manual If RANGE ¼ V, all eigenvalues in the half-open interval ðvl; VUŠ will be found. If RANGE ¼ I, the ILth to IUth eigenvalues will be found. Constraint: RANGE ¼ A, V or I. 3: UPLO CHARACTER(1) Input On entry: if UPLO ¼ U, the upper triangular part of A is stored. If UPLO ¼ L, the lower triangular part of A is stored. Constraint: UPLO ¼ U or L. 4: N INTEGER Input On entry: n, the order of the matrix A. Constraint: N 0. 5: AðLDA,Þ COMPLEX (KIND=nag_wp) 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 triangular part of A must be stored and the elements of the array below the diagonal are not referenced. If UPLO ¼ L, the lower triangular part of A must be stored and the elements of the array above the diagonal are not referenced. On exit: the lower triangle (if UPLO ¼ L ) or the upper triangle (if UPLO ¼ U ) of A, including the diagonal, is overwritten. 6: LDA INTEGER Input On entry: the first dimension of the array A as declared in the (sub)program from which (ZHEEVX) is called. Constraint: LDA maxð1; NÞ. 7: VL REAL (KIND=nag_wp) Input 8: VU REAL (KIND=nag_wp) Input On entry: if RANGE ¼ V, the lower and upper bounds of the interval to be searched for eigenvalues. If RANGE ¼ A or I, VL and VU are not referenced. Constraint: if RANGE ¼ V, VL< VU. 9: IL INTEGER Input 10: IU INTEGER Input On entry: if RANGE ¼ I, the indices (in ascending order) of the smallest and largest eigenvalues to be returned. If RANGE ¼ A or V, IL and IU are not referenced. Constraints: if RANGE ¼ I and N ¼ 0, IL ¼ 1 and IU ¼ 0; if RANGE ¼ I and N > 0, 1 IL IU N. 11: ABSTOL REAL (KIND=nag_wp) Input On entry: the absolute error tolerance for the eigenvalues. An approximate eigenvalue is accepted as converged when it is determined to lie in an interval ½a; bš of width less than or equal to.2

ABSTOL þ maxðjaj;b jjþ, where is the machine precision. If ABSTOL is less than or equal to zero, then T k k 1 will be used in its place, where T is the tridiagonal matrix obtained by reducing A to tridiagonal form. Eigenvalues will be computed most accurately when ABSTOL is set to twice the underflow threshold 2 X02AMFð Þ, not zero. If this routine returns with INFO > 0, indicating that some eigenvectors did not converge, try setting ABSTOL to 2 X02AMFð Þ. See Demmel and Kahan (1990). 12: M INTEGER Output On exit: the total number of eigenvalues found. 0 M N. If RANGE ¼ A, M¼ N. If RANGE ¼ I, M¼ IU IL þ 1. 13: WðÞ REAL (KIND=nag_wp) array Output Note: the dimension of the array W must be at least maxð1; NÞ. On exit: the first M elements contain the selected eigenvalues in ascending order. 14: ZðLDZ,Þ COMPLEX (KIND=nag_wp) array Output Note: the second dimension of the array Z must be at least maxð1; MÞ if JOBZ ¼ V, and at least 1 otherwise. On exit: if JOBZ ¼ V, then if INFO ¼ 0, the first M columns of Z contain the orthonormal eigenvectors of the matrix A corresponding to the selected eigenvalues, with the ith column of Z holding the eigenvector associated with WðiÞ; if an eigenvector fails to converge (INFO > 0), then that column of Z contains the latest approximation to the eigenvector, and the index of the eigenvector is returned in JFAIL. If JOBZ ¼ N, Z is not referenced. Note: you must ensure that at least maxð1; MÞ columns are supplied in the array Z; if RANGE ¼ V, the exact value of M is not known in advance and an upper bound of at least N must be used. 15: LDZ INTEGER Input On entry: the first dimension of the array Z as declared in the (sub)program from which (ZHEEVX) is called. Constraints: if JOBZ ¼ V, LDZ maxð1; NÞ; otherwise LDZ 1. 16: WORKðmaxð1; LWORKÞÞ COMPLEX (KIND=nag_wp) array Workspace On exit: if INFO ¼ 0, the real part of WORKð1Þ contains the minimum value of LWORK required for optimal performance. 17: LWORK INTEGER Input On entry: the dimension of the array WORK as declared in the (sub)program from which (ZHEEVX) is called. If LWORK ¼ 1, a workspace query is assumed; the routine only calculates the optimal 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..3

NAG Library Manual Suggested value: for optimal performance, LWORK ðnb þ 1ÞN, where nb is the largest optimal block size for F08FSF (ZHETRD) and for F08FUF (ZUNMTR). Constraint: LWORK maxð1; 2 NÞ. 18: RWORKðÞ REAL (KIND=nag_wp) array Workspace Note: the dimension of the array RWORK must be at least maxð1; 7 NÞ. 19: IWORKðÞ INTEGER array Workspace Note: the dimension of the array IWORK must be at least maxð1; 5 NÞ. 20: JFAILðÞ INTEGER array Output Note: the dimension of the array JFAIL must be at least maxð1; NÞ. On exit: if JOBZ ¼ V, then if INFO ¼ 0, the first M elements of JFAIL are zero; if INFO > 0, JFAIL contains the indices of the eigenvectors that failed to converge. If JOBZ ¼ N, JFAIL is not referenced. 21: INFO INTEGER Output On exit: INFO ¼ 0 unless the routine detects an error (see Section 6). 6 Error Indicators and Warnings Errors or warnings detected by the routine: 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 INFO ¼ i, then i eigenvectors failed to converge. Their indices are stored in array JFAIL. Please see ABSTOL. 7 Accuracy The computed eigenvalues and eigenvectors are exact for a nearby matrix and is the machine precision. 8 Further Comments kek 2 ¼ OðÞA k k 2, ða þ EÞ, where See Section 4.7 of Anderson et al. (1999) for further details. The total number of floating point operations is proportional to n 3. The real analogue of this routine is F08FBF (DSYEVX). 9 Example This example finds the eigenvalues in the half-open interval ð 2; 2Š, and the corresponding eigenvectors, of the Hermitian matrix.4

0 1 1 2 i 3 i 4 i 2 þ i 2 3 2i 4 2i A ¼ B C @ 3 þ i 3 þ 2i 3 4 3i A. 4 þ i 4 þ 2i 4 þ 3i 4 9.1 Program Text Program f08fpfe! Example Program Text! Release. NAG Copyright 2012.!.. Use Statements.. Use nag_library, Only: blas_zamax_val, nag_wp, x04daf, zheevx!.. Implicit None Statement.. Implicit None!.. Parameters.. Real (Kind=nag_wp), Parameter :: zero = 0.0E+0_nag_wp Integer, Parameter :: nb = 64, nin = 5, nout = 6!.. Local Scalars.. Real (Kind=nag_wp) :: abstol, r, vl, vu Integer :: i, ifail, il, info, iu, k, lda, ldz, & lwork, m, n!.. Local Arrays.. Complex (Kind=nag_wp), Allocatable :: a(:,:), work(:), z(:,:) Complex (Kind=nag_wp) :: dummy(1) Real (Kind=nag_wp), Allocatable :: rwork(:), w(:) Integer, Allocatable :: iwork(:), jfail(:)!.. Intrinsic Procedures.. Intrinsic :: abs, cmplx, conjg, max, nint, real!.. Executable Statements.. Write (nout,*) Example Program Results Write (nout,*)! Skip heading in data file Read (nin,*) Read (nin,*) n lda = n ldz = n m = n Allocate (a(lda,n),z(ldz,m),rwork(7*n),w(n),iwork(5*n),jfail(n))! Read the lower and upper bounds of the interval to be searched. Read (nin,*) vl, vu! Use routine workspace query to get optimal workspace. lwork = -1! The NAG name equivalent of zheevx is f08fpf Call zheevx( Vectors, Values in range, Upper,n,a,lda,vl,vu,il,iu, & abstol,m,w,z,ldz,dummy,lwork,rwork,iwork,jfail,info)! Make sure that there is enough workspace for blocksize nb. lwork = max((nb+1)*n,nint(real(dummy(1)))) Allocate (work(lwork))! Read the upper triangular part of the matrix A. Read (nin,*)(a(i,i:n),i=1,n)! Set the absolute error tolerance for eigenvalues. With ABSTOL! set to zero, the default value is used instead abstol = zero! Solve the Hermitian eigenvalue problem! The NAG name equivalent of zheevx is f08fpf.5

NAG Library Manual Call zheevx( Vectors, Values in range, Upper,n,a,lda,vl,vu,il,iu, & abstol,m,w,z,ldz,work,lwork,rwork,iwork,jfail,info) If (info>=0) Then! Print solution Write (nout,99999) Number of eigenvalues found =, m Write (nout,*) Write (nout,*) Eigenvalues Write (nout,99998) w(1:m) Flush (nout)! Normalize the eigenvectors so that the element of largest absolute! value is real. Do i = 1, m Call blas_zamax_val(n,z(1,i),1,k,r) z(1:n,i) = z(1:n,i)*(conjg(z(k,i))/cmplx(abs(z(k,i)),kind=nag_wp)) End Do! ifail: behaviour on error exit! =0 for hard exit, =1 for quiet-soft, =-1 for noisy-soft ifail = 0 Call x04daf( General,,n,m,z,ldz, Selected eigenvectors,ifail) If (info>0) Then Write (nout,99999) INFO eigenvectors failed to converge, INFO =, & info Write (nout,*) Indices of eigenvectors that did not converge Write (nout,99997) jfail(1:m) End If Else Write (nout,99999) Failure in ZHEEVX. INFO =, info End If 99999 Format (1X,A,I5) 99998 Format (3X,(8F8.4)) 99997 Format (3X,(8I8)) End Program f08fpfe 9.2 Program Data Example Program Data 4 :Value of N -2.0 2.0 :Values of VL and VU (1.0, 0.0) (2.0, -1.0) (3.0, -1.0) (4.0, -1.0) (2.0, 0.0) (3.0, -2.0) (4.0, -2.0) (3.0, 0.0) (4.0, -3.0) (4.0, 0.0) :End of matrix A 9.3 Program Results Example Program Results Number of eigenvalues found = 2 Eigenvalues -0.6886 1.1412 Selected eigenvectors 1 2 1 0.6470 0.0179 0.0000-0.4453 2-0.4984 0.5706-0.1130 0.0000.6

3 0.2949-0.1530 0.3165 0.5273 4-0.2241-0.2118-0.2878-0.3598.7 (last)