complex16HEeigen(3)

๐Ÿ“ฆ
version 3.11.0 ยท 2 versions
, in debian bookworm

complex16HEeigen โ€” the HE eigenvalue driver glow-up โœจ

okay bestie, welcome to complex16HEeigen(3) ๐Ÿ’– this is the LAPACK page for the whole little family of complex16 eigenvalue driver functions for HE matrices. yes it's long. yes it's giving very "final boss of linear algebra". but we're gonna get through it together, one subroutine at a time. grab a snack ๐Ÿ“


๐ŸŒธ NAME ๐ŸŒธ

complex16HEeigen โ€” literally the group of complex16 eigenvalue driver functions for HE matrices, and we're about to meet every single one ๐Ÿ’…


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

Functions

  • subroutine zheev (JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK, INFO) โ€” ZHEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices
  • subroutine zheev_2stage (JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK, INFO) โ€” ZHEEV_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices
  • subroutine zheevd (JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO) โ€” ZHEEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices
  • subroutine zheevd_2stage (JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO) โ€” ZHEEVD_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices
  • subroutine zheevr (JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO) โ€” ZHEEVR computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices
  • subroutine zheevr_2stage (JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, ISUPPZ, WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO) โ€” ZHEEVR_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices
  • subroutine zheevx (JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, LWORK, RWORK, IWORK, IFAIL, INFO) โ€” ZHEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices
  • subroutine zheevx_2stage (JOBZ, RANGE, UPLO, N, A, LDA, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, LWORK, RWORK, IWORK, IFAIL, INFO) โ€” ZHEEVX_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices
  • subroutine zhegv (ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK, LWORK, RWORK, INFO) โ€” ZHEGV
  • subroutine zhegv_2stage (ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK, LWORK, RWORK, INFO) โ€” ZHEGV_2STAGE
  • subroutine zhegvd (ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO) โ€” ZHEGVD
  • subroutine zhegvx (ITYPE, JOBZ, RANGE, UPLO, N, A, LDA, B, LDB, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, LWORK, RWORK, IWORK, IFAIL, INFO) โ€” ZHEGVX

๐Ÿฆ‹ Detailed Description ๐Ÿฆ‹

So likeโ€ฆ this is the group of complex16 eigenvalue driver functions for HE matrices. that's the whole vibe. they all hang out here together. periodt.


๐Ÿ‘‘ Function Documentation ๐Ÿ‘‘

subroutine zheev

subroutine zheev (character JOBZ, character UPLO, integer N, complex*16,
    dimension( lda, * ) A, integer LDA, double precision, dimension( * ) W,
    complex*16, dimension( * ) WORK, integer LWORK, double precision,
    dimension( * ) RWORK, integer INFO)

ZHEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices ๐Ÿซถ

โœจ Purpose:

ZHEEV computes all eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A. like, all of them. no crumbs left behind ๐Ÿ’…

โœจ Parameters

  • JOBZ โ€” JOBZ is CHARACTER*1
    • = 'N': Compute eigenvalues only;
    • = 'V': Compute eigenvalues and eigenvectors.
  • UPLO โ€” UPLO is CHARACTER*1
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N โ€” N is INTEGER. The order of the matrix A. N >= 0.
  • A โ€” A is COMPLEX*16 array, dimension (LDA, N).
    • On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A.
    • On exit, if JOBZ = 'V', then if INFO = 0, A contains the orthonormal eigenvectors of the matrix A.
    • If JOBZ = 'N', then on exit the lower triangle (if UPLO='L') or the upper triangle (if UPLO='U') of A, including the diagonal, is destroyed. ๐Ÿ˜ญ yeah she's gone bestie, no takebacks.
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • W โ€” W is DOUBLE PRECISION array, dimension (N). If INFO = 0, the eigenvalues in ascending order. so organized of her โญ
  • WORK โ€” WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK โ€” LWORK is INTEGER. The length of the array WORK. LWORK >= max(1,2*N-1). For optimal efficiency, LWORK >= (NB+1)*N, where NB is the blocksize for ZHETRD returned by ILAENV.
    • If LWORK = -1, then 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 by XERBLA.
  • RWORK โ€” RWORK is DOUBLE PRECISION array, dimension (max(1, 3*N-2))
  • INFO โ€” INFO is INTEGER
    • = 0: successful exit
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: if INFO = i, the algorithm failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero. ๐Ÿ’€ she tried her best.

โœจ Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

subroutine zheev_2stage

subroutine zheev_2stage (character JOBZ, character UPLO, integer N,
    complex*16, dimension( lda, * ) A, integer LDA, double precision,
    dimension( * ) W, complex*16, dimension( * ) WORK, integer LWORK, double
    precision, dimension( * ) RWORK, integer INFO)

ZHEEV_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices ๐ŸŒˆ

โœจ Purpose:

ZHEEV_2STAGE computes all eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A using the 2stage technique for the reduction to tridiagonal. two stages, twice the slay, allegedly faster ๐Ÿ’…

โœจ Parameters

  • JOBZ โ€” JOBZ is CHARACTER*1
    • = 'N': Compute eigenvalues only;
    • = 'V': Compute eigenvalues and eigenvectors. Not available in this release. ๐Ÿ˜ญ sorry bestie
  • UPLO โ€” UPLO is CHARACTER*1
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N โ€” N is INTEGER. The order of the matrix A. N >= 0.
  • A โ€” A is COMPLEX*16 array, dimension (LDA, N).
    • On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A.
    • On exit, if JOBZ = 'V', then if INFO = 0, A contains the orthonormal eigenvectors of the matrix A.
    • If JOBZ = 'N', then on exit the lower triangle (if UPLO='L') or the upper triangle (if UPLO='U') of A, including the diagonal, is destroyed.
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • W โ€” W is DOUBLE PRECISION array, dimension (N). If INFO = 0, the eigenvalues in ascending order.
  • WORK โ€” WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK โ€” LWORK is INTEGER. The length of the array WORK. LWORK >= 1, when N <= 1; otherwise
    • If JOBZ = 'N' and N > 1, LWORK must be queried.
LWORK = MAX(1, dimension) where
        dimension = max(stage1,stage2) + (KD+1)*N + N
                  = N*KD + N*max(KD+1,FACTOPTNB)
                    + max(2*KD*KD, KD*NTHREADS)
                    + (KD+1)*N + N
where KD is the blocking size of the reduction,
FACTOPTNB is the blocking used by the QR or LQ
algorithm, usually FACTOPTNB=128 is a good choice
NTHREADS is the number of threads used when
openMP compilation is enabled, otherwise =1.
  • If JOBZ = 'V' and N > 1, LWORK must be queried. Not yet available ๐Ÿ™ˆ
  • If LWORK = -1, then 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 by XERBLA.
  • RWORK โ€” RWORK is DOUBLE PRECISION array, dimension (max(1, 3*N-2))
  • INFO โ€” INFO is INTEGER
    • = 0: successful exit
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: if INFO = i, the algorithm failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero.

โœจ Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

โœจ Further Details:

All details about the 2stage techniques are available in:

Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8 , 11 pages. http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292

okay that's part 1 done bestie, and there's so much more coming โ€” don't go anywhere ๐Ÿงš

A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196

๐ŸŽ€ subroutine zheevd ๐ŸŽ€

subroutine zheevd (character JOBZ, character UPLO, integer N, complex*16,
    dimension( lda, * ) A, integer LDA, double precision, dimension( * ) W,
    complex*16, dimension( * ) WORK, integer LWORK, double precision,
    dimension( * ) RWORK, integer LRWORK, integer, dimension( * ) IWORK,
    integer LIWORK, integer INFO)

ZHEEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices

โœจ Purpose

ZHEEVD computes all eigenvalues and, if you want them, eigenvectors of a complex Hermitian matrix A. If eigenvectors are desired, it uses a divide and conquer algorithm. ๐Ÿ’…

And bestie, the divide and conquer algorithm makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none. ๐Ÿ˜ญ

๐ŸŒธ Parameters

  • JOBZ โ€” JOBZ is CHARACTER*1
    • = 'N': Compute eigenvalues only;
    • = 'V': Compute eigenvalues and eigenvectors.
  • UPLO โ€” UPLO is CHARACTER*1
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N โ€” N is INTEGER. The order of the matrix A. N >= 0.
  • A โ€” A is COMPLEX*16 array, dimension (LDA, N). On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A. On exit, if JOBZ = 'V', then if INFO = 0, A contains the orthonormal eigenvectors of the matrix A. If JOBZ = 'N', then on exit the lower triangle (if UPLO='L') or the upper triangle (if UPLO='U') of A, including the diagonal, is destroyed. ๐Ÿ’€
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • W โ€” W is DOUBLE PRECISION array, dimension (N). If INFO = 0, the eigenvalues in ascending order.
  • WORK โ€” WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK โ€” LWORK is INTEGER. The length of the array WORK.
If N <= 1,                LWORK must be at least 1.
If JOBZ  = 'N' and N > 1, LWORK must be at least N + 1.
If JOBZ  = 'V' and N > 1, LWORK must be at least 2*N + N**2.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA.

  • RWORK โ€” RWORK is DOUBLE PRECISION array, dimension (LRWORK). On exit, if INFO = 0, RWORK(1) returns the optimal LRWORK.
  • LRWORK โ€” LRWORK is INTEGER. The dimension of the array RWORK.
If N <= 1,                LRWORK must be at least 1.
If JOBZ  = 'N' and N > 1, LRWORK must be at least N.
If JOBZ  = 'V' and N > 1, LRWORK must be at least
                1 + 5*N + 2*N**2.

If LRWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA.

  • IWORK โ€” IWORK is INTEGER array, dimension (MAX(1,LIWORK)). On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
  • LIWORK โ€” LIWORK is INTEGER. The dimension of the array IWORK.
If N <= 1,                LIWORK must be at least 1.
If JOBZ  = 'N' and N > 1, LIWORK must be at least 1.
If JOBZ  = 'V' and N > 1, LIWORK must be at least 3 + 5*N.

If LIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA.

  • INFO โ€” INFO is INTEGER
= 0:  successful exit
< 0:  if INFO = -i, the i-th argument had an illegal value
> 0:  if INFO = i and JOBZ = 'N', then the algorithm failed
      to converge; i off-diagonal elements of an intermediate
      tridiagonal form did not converge to zero;
      if INFO = i and JOBZ = 'V', then the algorithm failed
      to compute an eigenvalue while working on the submatrix
      lying in rows and columns INFO/(N+1) through
      mod(INFO,N+1).

๐Ÿ‘‘ Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

๐Ÿฆ‹ Further Details

Modified description of INFO. Sven, 16 Feb 05.

๐Ÿ“ Contributors

Jeff Rutter, Computer Science Division, University of California at Berkeley, USA


๐Ÿ’œ subroutine zheevd_2stage ๐Ÿ’œ

subroutine zheevd_2stage (character JOBZ, character UPLO, integer N,
    complex*16, dimension( lda, * ) A, integer LDA, double precision,
    dimension( * ) W, complex*16, dimension( * ) WORK, integer LWORK, double
    precision, dimension( * ) RWORK, integer LRWORK, integer, dimension( * )
    IWORK, integer LIWORK, integer INFO)

ZHEEVD_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices

โœจ Purpose

ZHEEVD_2STAGE computes all eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A using the 2stage technique for the reduction to tridiagonal. If eigenvectors are desired, it uses a divide and conquer algorithm. ๐Ÿ’…

The divide and conquer algorithm makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none.

๐ŸŒธ Parameters

  • JOBZ โ€” JOBZ is CHARACTER*1
    • = 'N': Compute eigenvalues only;
    • = 'V': Compute eigenvalues and eigenvectors. Not available in this release.
  • UPLO โ€” UPLO is CHARACTER*1
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N โ€” N is INTEGER. The order of the matrix A. N >= 0.
  • A โ€” A is COMPLEX*16 array, dimension (LDA, N). On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A. On exit, if JOBZ = 'V', then if INFO = 0, A contains the orthonormal eigenvectors of the matrix A. If JOBZ = 'N', then on exit the lower triangle (if UPLO='L') or the upper triangle (if UPLO='U') of A, including the diagonal, is destroyed.
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • W โ€” W is DOUBLE PRECISION array, dimension (N). If INFO = 0, the eigenvalues in ascending order.
  • WORK โ€” WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK โ€” LWORK is INTEGER. The dimension of the array WORK.
If N <= 1,               LWORK must be at least 1.
If JOBZ = 'N' and N > 1, LWORK must be queried.
                         LWORK = MAX(1, dimension) where
                         dimension = max(stage1,stage2) + (KD+1)*N + N+1
                                   = N*KD + N*max(KD+1,FACTOPTNB)
                                     + max(2*KD*KD, KD*NTHREADS)
                                     + (KD+1)*N + N+1
                         where KD is the blocking size of the reduction,
                         FACTOPTNB is the blocking used by the QR or LQ
                         algorithm, usually FACTOPTNB=128 is a good choice
                         NTHREADS is the number of threads used when
                         openMP compilation is enabled, otherwise =1.
If JOBZ = 'V' and N > 1, LWORK must be at least 2*N + N**2

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA.

  • RWORK โ€” RWORK is DOUBLE PRECISION array, dimension (LRWORK). On exit, if INFO = 0, RWORK(1) returns the optimal LRWORK.
  • LRWORK
  • LRWORK โ€” INTEGER, aka the dimension of the array RWORK. She's got โœจrulesโœจ, bestie:
    • If N <= 1, LRWORK must be at least 1.
    • If JOBZ = 'N' and N > 1, LRWORK must be at least N.
    • If JOBZ = 'V' and N > 1, LRWORK must be at least
1 + 5*N + 2*N**2

And the iconic bit: if LRWORK = -1, then a workspace query is assumed. The routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. So it's like asking "how much room do I need" and getting the answer with zero side-eye ๐Ÿ’…

  • IWORK โ€” IWORK is INTEGER array, dimension (MAX(1,LIWORK)). On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK. It's the receipt, bestie ๐Ÿงพ
  • LIWORK โ€” LIWORK is INTEGER, the dimension of the array IWORK. The rules, again, because there are always rules:
    • If N <= 1, LIWORK must be at least 1.
    • If JOBZ = 'N' and N > 1, LIWORK must be at least 1.
    • If JOBZ = 'V' and N > 1, LIWORK must be at least 3 + 5*N.

If LIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. Same energy, different array ๐Ÿซถ

  • INFO โ€” INFO is INTEGER, and this is the vibe check at the end:
    • = 0: successful exit. Slay โœจ
    • < 0: if INFO = -i, the i-th argument had an illegal value.
    • > 0: if INFO = i and JOBZ = 'N', then the algorithm failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero; if INFO = i and JOBZ = 'V', then the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columns INFO/(N+1) through mod(INFO,N+1).
Not me reading INFO > 0 and feeling personally attacked ๐Ÿ˜ญ if it's nonzero, something did NOT go to plan, bestie.

Author ๐Ÿ‘‘

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Further Details: ๐ŸŽ€

Modified description of INFO. Sven, 16 Feb 05.

Contributors: ๐Ÿซถ

Jeff Rutter, Computer Science Division, University of California at Berkeley, USA

Further Details: ๐ŸŒˆ

All details about the 2stage techniques are available in:

Azzam Haidar, Hatem Ltaief, and Jack Dongarra.
Parallel reduction to condensed forms for symmetric eigenvalue problems
using aggregated fine-grained and memory-aware kernels. In Proceedings
of 2011 International Conference for High Performance Computing,
Networking, Storage and Analysis (SC '11), New York, NY, USA,
Article 8 , 11 pages.
http://doi.acm.org/10.1145/2063384.2063394

A. Haidar, J. Kurzak, P. Luszczek, 2013.
An improved parallel singular value algorithm and its implementation
for multicore hardware, In Proceedings of 2013 International Conference
for High Performance Computing, Networking, Storage and Analysis (SC '13).
Denver, Colorado, USA, 2013.
Article 90, 12 pages.
http://doi.acm.org/10.1145/2503210.2503292

A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra.
A novel hybrid CPU-GPU generalized eigensolver for electronic structure
calculations based on fine-grained memory aware tasks.
International Journal of High Performance Computing Applications.
Volume 28 Issue 2, Pages 196-209, May 2014.
http://hpc.sagepub.com/content/28/2/196

Like, they really said "cite us or it didn't happen" and honestly? Correct ๐Ÿ“š


subroutine zheevr ๐Ÿ’–

subroutine zheevr (character JOBZ, character RANGE, character UPLO, integer
    N, complex*16, dimension( lda, * ) A, integer LDA, double precision VL,
    double precision VU, integer IL, integer IU, double precision ABSTOL,
    integer M, double precision, dimension( * ) W, complex*16, dimension(
    ldz, * ) Z, integer LDZ, integer, dimension( * ) ISUPPZ, complex*16,
    dimension( * ) WORK, integer LWORK, double precision, dimension( * )
    RWORK, integer LRWORK, integer, dimension( * ) IWORK, integer LIWORK,
    integer INFO)

ZHEEVR computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices ๐Ÿ‘‘

Purpose: โœจ

ZHEEVR computes selected eigenvalues and, optionally, eigenvectors of a complex 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.

ZHEEVR first reduces the matrix A to tridiagonal form T with a call to ZHETRD. Then, whenever possible, ZHEEVR calls ZSTEMR to compute eigenspectrum using Relatively Robust Representations. ZSTEMR computes eigenvalues by the dqds algorithm, while orthogonal eigenvectors are computed from various 'good' L D L^T representations (also known as Relatively Robust Representations). Gram-Schmidt orthogonalization is avoided as far as possible. More specifically, the various steps of the algorithm are as follows.

For each unreduced block (submatrix) of T,

  • (a) Compute T - sigma I = L D L^T, so that L and D define all the wanted eigenvalues to high relative accuracy. This means that small relative changes in the entries of D and L cause only small relative changes in the eigenvalues and eigenvectors. The standard (unfactored) representation of the tridiagonal matrix T does not have this property in general.
  • (b) Compute the eigenvalues to suitable accuracy. If the eigenvectors are desired, the algorithm attains full accuracy of the computed eigenvalues only right before the corresponding vectors have to be computed, see steps c) and d).
  • (c) For each cluster of close eigenvalues, select a new shift close to the cluster, find a new factorization, and refine the shifted eigenvalues to suitable accuracy.
  • (d) For each eigenvalue with a large enough relative separation compute the corresponding eigenvector by forming a rank revealing twisted factorization. Go back to (c) for any clusters that remain.

The desired accuracy of the output can be specified by the input parameter ABSTOL.

For more details, see ZSTEMR's documentation and:

  • Inderjit S. Dhillon and Beresford N. Parlett: 'Multiple representations to compute orthogonal eigenvectors of symmetric tridiagonal matrices,' Linear Algebra and its Applications, 387(1), pp. 1-28, August 2004.
  • Inderjit Dhillon and Beresford Parlett: 'Orthogonal Eigenvectors and Relative Gaps,' SIAM Journal on Matrix Analysis and Applications, Vol. 25, 2004. Also LAPACK Working Note 154.
  • Inderjit Dhillon: 'A new O(n^2) algorithm for the symmetric tridiagonal eigenvalue/eigenvector problem', Computer Science Division Technical Report No. UCB/CSD-97-971, UC Berkeley, May 1997.
Note 1 : ZHEEVR calls ZSTEMR when the full spectrum is requested on machines which conform to the ieee-754 floating point standard. ZHEEVR calls DSTEBZ and ZSTEIN on non-ieee machines and when partial spectrum requests are made.
Normal execution of ZSTEMR may create NaNs and infinities and hence may abort due to a floating point exception in environments which do not handle NaNs and infinities in the ieee standard default manner. ๐Ÿ’€ so if your machine is weird about NaN, that's a you problem (affectionate).

Parameters ๐ŸŽ€

  • JOBZ โ€” JOBZ is CHARACTER*1
    • = 'N': Compute eigenvalues only;
    • = 'V': Compute eigenvalues and eigenvectors.
  • RANGE โ€” RANGE is CHARACTER*1
    • = 'A': all eigenvalues will be found.
    • = 'V': all eigenvalues in the half-open interval (VL,VU] will be found.
    • = 'I': the IL-th through IU-th eigenvalues will be found.

For RANGE = 'V' or 'I' and IU - IL < N - 1, DSTEBZ and ZSTEIN are called.

  • UPLO โ€” UPLO is CHARACTER*1
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N โ€” N is INTEGER. The order of the matrix A. N >= 0.
  • A โ€” A is COMPLEX*16 array, dimension (LDA, N). On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A.
On exit, the lower triangle (if UPLO='L') or the upper triangle (if UPLO='U') of A, including the diagonal, is destroyed. She's gone, bestie, she served her purpose ๐Ÿ’…
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • VL โ€” VL is DOUBLE PRECISION. If RANGE='V', the lower bound of the interval to be searched for eigenvalues. VL < VU. Not referenced if RANGE = 'A' or 'I'.
  • VU โ€” VU is DOUBLE PRECISION. If RANGE='V', the upper bound of the interval to be searched for eigenvalues. VL < VU. Not referenced if RANGE = 'A' or 'I'.
  • IL โ€” IL is INTEGER. If RANGE='I', the index of the smallest eigenvalue to be returned. 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'.
  • IU โ€” IU is INTEGER. If RANGE='I', the index of the largest eigenvalue to be returned. 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'.
  • ABSTOL โ€” ABSTOL is DOUBLE PRECISION. 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
ABSTOL + EPS *   max( |a|,|b| ) ,

where EPS is the machine precision. If ABSTOL is less than or equal to zero, then EPS*|T| will be used in its place, where |T| is the 1-norm of the tridiagonal matrix obtained by reducing A to tridiagonal form.

If high relative accuracy is important to you โ€” and bestie, sometimes it really is โ€” set ABSTOL to DLAMCH( 'Safe minimum' ). ๐Ÿ’… Do that and eigenvalues get computed to high relative accuracy whenever it's possible in future releases.

Okay but real talk, no cap: the current code makes no guarantees about high relative accuracy. None. Zip. Future releases will, though. ๐Ÿ™ˆ

If you wanna know which matrices even define their eigenvalues to high relative accuracy, go read J. Barlow and J. Demmel, 'Computing Accurate Eigensystems of Scaled Diagonally Dominant Matrices', LAPACK Working Note #7. It's giving context, it's giving lore. ๐Ÿ’œ

And for the bidiagonal-adjacent tea, see 'Computing Small Singular Values of Bidiagonal Matrices with Guaranteed High Relative Accuracy,' by Demmel and Kahan, LAPACK Working Note #3.


  • M โ€” INTEGER, the total number of eigenvalues found. 0 <= M <= N. If RANGE = 'A', then M = N, and if RANGE = 'I', then M = IU-IL+1.
  • W โ€” DOUBLE PRECISION array, dimension (N). The first M elements hold the selected eigenvalues, sorted in ascending order. โญ
  • Z โ€” COMPLEX*16 array, dimension (LDZ, max(1,M)). If JOBZ = 'V', then when INFO = 0, the first M columns of Z contain the orthonormal eigenvectors of the matrix A for the selected eigenvalues, with the i-th column of Z holding the eigenvector associated with W(i). If JOBZ = 'N', then Z is simply not referenced. ๐Ÿ‘‘
Note: you, the user, must make sure 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, so an upper bound has to be used. ๐Ÿ™ˆ
  • LDZ โ€” INTEGER, the leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= max(1,N).
  • ISUPPZ โ€” INTEGER array, dimension ( 2*max(1,M) ). The support of the eigenvectors in Z, i.e. the indices indicating the nonzero elements in Z. The i-th eigenvector is nonzero only in elements ISUPPZ( 2*i-1 ) through ISUPPZ( 2*i ). This is an output of ZSTEMR (tridiagonal matrix). The support of the eigenvectors of A is typically 1:N because of the unitary transformations applied by ZUNMTR. Implemented only for RANGE = 'A' or 'I' and IU - IL = N - 1.
  • WORK โ€” COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK โ€” INTEGER, the length of the array WORK. LWORK >= max(1,2*N). For optimal efficiency, LWORK >= (NB+1)*N, where NB is the max of the blocksize for ZHETRD and for ZUNMTR as returned by ILAENV. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. ๐Ÿซถ
  • RWORK โ€” DOUBLE PRECISION array, dimension (MAX(1,LRWORK)). On exit, if INFO = 0, RWORK(1) returns the optimal (and minimal) LRWORK.
  • LRWORK โ€” INTEGER, the length of the array RWORK. LRWORK >= max(1,24*N). If LRWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA.
  • IWORK โ€” INTEGER array, dimension (MAX(1,LIWORK)). On exit, if INFO = 0, IWORK(1) returns the optimal (and minimal) LIWORK.
  • LIWORK โ€” INTEGER, the dimension of the array IWORK. LIWORK >= max(1,10*N). If LIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA.
  • INFO โ€” INTEGER.
    • = 0: successful exit ๐ŸŒธ
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: Internal error ๐Ÿ’€

Author โœจ

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Contributors ๐Ÿซถ

Inderjit Dhillon, IBM Almaden, USA Osni Marques, LBNL/NERSC, USA Ken Stanley, Computer Science Division, University of California at Berkeley, USA Jason Riedy, Computer Science Division, University of California at Berkeley, USA


๐Ÿฆ‹ subroutine zheevr_2stage

subroutine zheevr_2stage (character JOBZ, character RANGE, character UPLO,
    integer N, complex*16, dimension( lda, * ) A, integer LDA, double
    precision VL, double precision VU, integer IL, integer IU, double
    precision ABSTOL, integer M, double precision, dimension( * ) W,
    complex*16, dimension( ldz, * ) Z, integer LDZ, integer, dimension( * )
    ISUPPZ, complex*16, dimension( * ) WORK, integer LWORK, double
    precision, dimension( * ) RWORK, integer LRWORK, integer, dimension( * )
    IWORK, integer LIWORK, integer INFO)

ZHEEVR_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices ๐Ÿ”ฅ

Purpose ๐Ÿ’–

ZHEEVR_2STAGE computes selected eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A using the 2stage technique for the reduction to tridiagonal. Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues. โœจ

ZHEEVR_2STAGE first reduces the matrix A to tridiagonal form T with a call to ZHETRD. Then, whenever possible, ZHEEVR_2STAGE calls ZSTEMR to compute eigenspectrum using Relatively Robust Representations. ZSTEMR computes eigenvalues by the dqds algorithm, while orthogonal eigenvectors are computed from various 'good' L D L^T representations (also known as Relatively Robust Representations). Gram-Schmidt orthogonalization is avoided as far as possible. More specifically, the various steps of the algorithm are as follows. ๐Ÿ‘‘

For each unreduced block (submatrix) of T,

  1. Compute T - sigma I = L D L^T, so that L and D define all the wanted eigenvalues to high relative accuracy. This means that small relative changes in the entries of D and L cause only small relative changes in the eigenvalues and eigenvectors. The standard (unfactored) representation of the tridiagonal matrix T does not have this property in general.
  2. Compute the eigenvalues to suitable accuracy. If the eigenvectors are desired, the algorithm attains full accuracy of the computed eigenvalues only right before the corresponding vectors have to be computed, see steps c) and d).
  3. For each cluster of close eigenvalues, select a new shift close to the cluster, find a new factorization, and refine the shifted eigenvalues to suitable accuracy.
  4. For each eigenvalue with a large enough relative separation compute the corresponding eigenvector by forming a rank revealing twisted factorization. Go back to (c) for any clusters that remain.

The desired accuracy of the output can be specified by the input parameter ABSTOL.

For more details, see ZSTEMR's documentation and:

  • Inderjit S. Dhillon and Beresford N. Parlett: 'Multiple representations to compute orthogonal eigenvectors of symmetric tridiagonal matrices,' Linear Algebra and its Applications, 387(1), pp. 1-28, August 2004.
  • Inderjit Dhillon and Beresford Parlett: 'Orthogonal Eigenvectors and Relative Gaps,' SIAM Journal on Matrix Analysis and Applications, Vol. 25, 2004. Also LAPACK Working Note 154.
  • Inderjit Dhillon: 'A new O(n^2) algorithm for the symmetric tridiagonal eigenvalue/eigenvector problem', Computer Science Division Technical Report No. UCB/CSD-97-971, UC Berkeley, May 1997.
Note 1 : ZHEEVR_2STAGE calls ZSTEMR when the full spectrum is requested on machines which conform to the ieee-754 floating point standard. ZHEEVR_2STAGE calls DSTEBZ and ZSTEIN on non-ieee machines and when partial spectrum requests are made.
Normal execution of ZSTEMR may create NaNs and infinities and hence may abort due to a floating point exception in environments which do not handle NaNs and infinities in the ieee standard default manner. ๐Ÿ˜ญ

Parameters ๐ŸŒˆ

  • JOBZ โ€” CHARACTER*1
    • = 'N': Compute eigenvalues only;
    • = 'V': Compute eigenvalues and eigenvectors. Not available in this release. ๐Ÿ’€
  • RANGE โ€” CHARACTER*1
    • = 'A': all eigenvalues will be found.
    • = 'V': all eigenvalues in the half-open interval (VL,VU] will be found.
    • = 'I': the IL-th through IU-th eigenvalues will be found.
    • For RANGE = 'V' or 'I' and IU - IL < N - 1, DSTEBZ and ZSTEIN are called
  • UPLO โ€” CHARACTER*1
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N โ€” INTEGER. The order of the matrix A. N >= 0.
  • A โ€” COMPLEX*16 array, dimension (LDA, N). On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A. On exit, the lower triangle (if UPLO='L') or the upper triangle (if UPLO='U') of A, including the diagonal, is destroyed. ๐Ÿ’…
  • LDA
  • LDA โ€” LDA is INTEGER. It's the leading dimension of the array A, and the vibe check here is strict: LDA >= max(1,N). no exceptions bestie ๐Ÿ’…
  • VL โ€” VL is DOUBLE PRECISION. If RANGE='V', this is the lower bound of the interval we're hunting eigenvalues in. Constraint: VL < VU. Not referenced if RANGE = 'A' or 'I' โ€” so don't even stress about it then. ๐ŸŽ€
  • VU โ€” VU is DOUBLE PRECISION. If RANGE='V', this is the upper bound of the interval to be searched for eigenvalues. Again: VL < VU. And again: not referenced if RANGE = 'A' or 'I'. โœจ
  • IL โ€” IL is INTEGER. If RANGE='I', it's the index of the smallest eigenvalue to be returned. Rules: 1 <= IL <= IU <= N, if N > 0; and IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'. ๐Ÿฆ‹
  • IU โ€” IU is INTEGER. If RANGE='I', it's the index of the largest eigenvalue to be returned. Same rules, same energy: 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'. ๐Ÿฆ‹
  • ABSTOL โ€” ABSTOL is DOUBLE PRECISION. It's the absolute error tolerance for the eigenvalues. An approximate eigenvalue gets accepted as converged when it's determined to lie in an interval [a,b] of width less than or equal to
ABSTOL + EPS *   max( |a|,|b| ) ,

where EPS is the machine precision. If ABSTOL is less than or equal to zero, then EPS*|T| will be used in its place, where |T| is the 1-norm of the tridiagonal matrix obtained by reducing A to tridiagonal form. ๐Ÿ“

See 'Computing Small Singular Values of Bidiagonal Matrices with Guaranteed High Relative Accuracy,' by Demmel and Kahan, LAPACK Working Note #3. iykyk ๐Ÿ“š

If high relative accuracy is important, set ABSTOL to DLAMCH( 'Safe minimum' ). Doing so will guarantee that eigenvalues are computed to high relative accuracy when possible in future releases. The current code does not make any guarantees about high relative accuracy, but future releases will. See J. Barlow and J. Demmel, 'Computing Accurate Eigensystems of Scaled Diagonally Dominant Matrices', LAPACK Working Note #7, for a discussion of which matrices define their eigenvalues to high relative accuracy. ๐Ÿ‘‘

  • M โ€” M is INTEGER. The total number of eigenvalues found, and it lives in 0 <= M <= N. If RANGE = 'A', then M = N; and if RANGE = 'I', then M = IU-IL+1. math slay โœจ
  • W โ€” W is DOUBLE PRECISION array, dimension (N). The first M elements contain the selected eigenvalues in ascending order. ๐Ÿ“ˆ
  • Z โ€” Z is COMPLEX*16 array, dimension (LDZ, max(1,M)). 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 i-th column of Z holding the eigenvector associated with W(i). If JOBZ = 'N', then Z is not referenced. ๐Ÿ’ซ
Note: the user 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 must be used. don't get caught lacking on this one fr fr ๐Ÿ˜ญ
  • LDZ โ€” LDZ is INTEGER. The leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= max(1,N). ๐ŸŽ€
  • ISUPPZ โ€” ISUPPZ is INTEGER array, dimension ( 2*max(1,M) ). This is the support of the eigenvectors in Z, i.e., the indices indicating the nonzero elements in Z. The i-th eigenvector is nonzero only in elements ISUPPZ( 2*i-1 ) through ISUPPZ( 2*i ). This is an output of ZSTEMR (tridiagonal matrix). The support of the eigenvectors of A is typically 1:N because of the unitary transformations applied by ZUNMTR. Implemented only for RANGE = 'A' or 'I' and IU - IL = N - 1 โ€” like, that's the whole condition, periodt. ๐Ÿ’…
  • WORK โ€” WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. ๐Ÿซถ
  • LWORK โ€” LWORK is INTEGER. The dimension of the array WORK.

If JOBZ = 'N' and N > 1, LWORK must be queried.

LWORK = MAX(1, 26*N, dimension) where
dimension = max(stage1,stage2) + (KD+1)*N + N
          = N*KD + N*max(KD+1,FACTOPTNB)
            + max(2*KD*KD, KD*NTHREADS)
            + (KD+1)*N + N
where KD is the blocking size of the reduction,
FACTOPTNB is the blocking used by the QR or LQ
algorithm, usually FACTOPTNB=128 is a good choice
NTHREADS is the number of threads used when
openMP compilation is enabled, otherwise =1.

If JOBZ = 'V' and N > 1, LWORK must be queried. Not yet available ๐Ÿ˜ญ (the audacity tbh)

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. the -1 trick is iconic, we love a low-effort recon mission ๐Ÿ•ต๏ธโ€โ™€๏ธ

  • RWORK โ€” RWORK is DOUBLE PRECISION array, dimension (MAX(1,LRWORK)). On exit, if INFO = 0, RWORK(1) returns the optimal (and minimal) LRWORK. โญ
  • LRWORK โ€” LRWORK is INTEGER. The length of the array RWORK. LRWORK >= max(1,24*N). ๐Ÿ“

If LRWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. ๐Ÿ”

  • IWORK โ€” IWORK is INTEGER array, dimension (MAX(1,LIWORK)). On exit, if INFO = 0, IWORK(1) returns the optimal (and minimal) LIWORK. โญ
  • LIWORK โ€” LIWORK is INTEGER. The dimension of the array IWORK. LIWORK >= max(1,10*N). ๐Ÿ“

If LIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. ๐Ÿ”

  • INFO โ€” INFO is INTEGER. The receipts:
    • = 0: successful exit slay โœ…
    • < 0: if INFO = -i, the i-th argument had an illegal value oops ๐Ÿ™ˆ
    • > 0: Internal error not our fault bestie ๐Ÿ’€

๐Ÿ’œ Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

๐Ÿ’œ Contributors

  • Inderjit Dhillon, IBM Almaden, USA \n
  • Osni Marques, LBNL/NERSC, USA \n
  • Ken Stanley, Computer Science Division, University of California at Berkeley, USA \n
  • Jason Riedy, Computer Science Division, University of California at Berkeley, USA \n

absolute legends, every single one of them ๐Ÿซถ

๐Ÿ“š Further Details

All details about the 2stage techniques are available in:

  • Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8 , 11 pages. http://doi.acm.org/10.1145/2063384.2063394
  • A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292
  • A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196

reading list unlocked ๐Ÿ“–โœจ


๐Ÿฆ‹ subroutine zheevx

subroutine zheevx (character JOBZ, character RANGE, character UPLO, integer
    N, complex*16, dimension( lda, * ) A, integer LDA, double precision VL,
    double precision VU, integer IL, integer IU, double precision ABSTOL,
    integer M, double precision, dimension( * ) W, complex*16, dimension(
    ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, integer LWORK,
    double precision, dimension( * ) RWORK, integer, dimension( * ) IWORK,
    integer, dimension( * ) IFAIL, integer INFO)

ZHEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices ๐ŸŒธ

Purpose: ZHEEVX computes selected eigenvalues and, optionally, eigenvectors of a complex 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. pick your fighter, bestie ๐Ÿ’…

Parameters

  • JOBZ โ€” JOBZ is CHARACTER*1
    • = 'N': Compute eigenvalues only;
    • = 'V': Compute eigenvalues and eigenvectors.
  • RANGE โ€” RANGE is CHARACTER*1
    • = 'A': all eigenvalues will be found.
    • = 'V': all eigenvalues in the half-open interval (VL,VU] will be found.
    • = 'I': the IL-th through IU-th eigenvalues will be found.
  • UPLO โ€” UPLO is CHARACTER*1
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N โ€” N is INTEGER. The order of the matrix A. N >= 0. ๐ŸŒˆ
  • A โ€”
  • A โ€” a COMPLEX*16 array, dimension (LDA, N). On entry, bestie, this is your Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A holds the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A holds the lower triangular part of the matrix A. On exit, the lower triangle (if UPLO='L') or the upper triangle (if UPLO='U') of A, including the diagonal, is destroyed. Not "lightly nudged". Destroyed. ๐Ÿซ 
  • LDA โ€” INTEGER, the leading dimension of the array A. Constraint: LDA >= max(1,N). That's the law. โš–๏ธ
  • VL โ€” DOUBLE PRECISION. If RANGE='V', this is the lower bound of the interval to be searched for eigenvalues, and VL < VU. Not referenced if RANGE = 'A' or 'I'. (So don't stress about it when it's not invited to the party. ๐Ÿ’…)
  • VU โ€” DOUBLE PRECISION. If RANGE='V', this is the upper bound of the interval to be searched for eigenvalues, and VL < VU. Not referenced if RANGE = 'A' or 'I'. The duo works as a pair, no cap. ๐Ÿฆ‹
  • IL โ€” INTEGER. If RANGE='I', this is the index of the smallest eigenvalue to be returned. Rules of the house: 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'.
  • IU โ€” INTEGER. If RANGE='I', this is the index of the largest eigenvalue to be returned. Same rules, same energy: 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'.
  • ABSTOL โ€” DOUBLE PRECISION, the absolute error tolerance for the eigenvalues. An approximate eigenvalue gets accepted as converged when it's determined to lie in an interval [a,b] whose width is less than or equal to
ABSTOL + EPS *   max( |a|,|b| ) ,

where EPS is the machine precision. If ABSTOL is less than or equal to zero, then EPS*|T| will be used in its place, where |T| is the 1-norm of the tridiagonal matrix you get by reducing A to tridiagonal form. ๐Ÿ”ฅ

Eigenvalues get computed most accurately when ABSTOL is set to twice the underflow threshold 2*DLAMCH('S'), not zero. If this routine comes back with INFO>0, meaning some eigenvectors didn't converge, try setting ABSTOL to 2*DLAMCH('S'). That's the move. โœจ

Also go read 'Computing Small Singular Values of Bidiagonal Matrices with Guaranteed High Relative Accuracy,' by Demmel and Kahan, LAPACK Working Note #3. Iconic literature behavior. ๐Ÿ“š

  • M โ€” INTEGER, the total number of eigenvalues found. 0 <= M <= N. If RANGE = 'A', then M = N, and if RANGE = 'I', then M = IU-IL+1. Simple math, slay. ๐Ÿงฎ
  • W โ€” a DOUBLE PRECISION array, dimension (N). On a normal exit, the first M elements contain the selected eigenvalues in ascending order. Sorted, organized, main character energy. ๐Ÿ‘‘
  • Z โ€” a COMPLEX*16 array, dimension (LDZ, max(1,M)). 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 i-th column of Z holding the eigenvector associated with W(i). If an eigenvector fails to converge, then that column of Z contains the latest approximation to the eigenvector, and the index of that eigenvector gets returned in IFAIL. If JOBZ = 'N', then Z is not referenced.
Heads up, bestie: the user 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 must be used. No guessing games. ๐Ÿ™ˆ
  • LDZ โ€” INTEGER, the leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= max(1,N).
  • WORK โ€” a COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. It's giving receipts. ๐Ÿงพ
  • LWORK โ€” INTEGER, the length of the array WORK. LWORK >= 1, when N <= 1; otherwise 2*N. For optimal efficiency, LWORK >= (NB+1)*N, where NB is the max of the blocksize for ZHETRD and for ZUNMTR as returned by ILAENV.

If LWORK = -1, then 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 by XERBLA. Sneaky but legal. ๐Ÿ˜Œ

  • RWORK โ€” a DOUBLE PRECISION array, dimension (7*N). Seven times N. That's the whole personality. ๐Ÿ“
  • IWORK โ€” an INTEGER array, dimension (5*N). Five times N, matching energy. ๐Ÿ“
  • IFAIL โ€” an INTEGER array, dimension (N). If JOBZ = 'V', then if INFO = 0, the first M elements of IFAIL are zero. If INFO > 0, then IFAIL contains the indices of the eigenvectors that failed to converge. If JOBZ = 'N', then IFAIL is not referenced. The snitch list, respectfully. ๐Ÿ’€
  • INFO โ€” INTEGER:
    • = 0: successful exit ๐ŸŽ‰
    • < 0: if INFO = -i, the i-th argument had an illegal value ๐Ÿ˜ญ
    • > 0: if INFO = i, then i eigenvectors failed to converge. Their indices are stored in array IFAIL. ๐Ÿ’€

Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

The whole squad. ๐Ÿซถ


subroutine zheevx_2stage

subroutine zheevx_2stage (character JOBZ, character RANGE, character UPLO,
    integer N, complex*16, dimension( lda, * ) A, integer LDA, double
    precision VL, double precision VU, integer IL, integer IU, double
    precision ABSTOL, integer M, double precision, dimension( * ) W,
    complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( *
    ) WORK, integer LWORK, double precision, dimension( * ) RWORK, integer,
    dimension( * ) IWORK, integer, dimension( * ) IFAIL, integer INFO)

ZHEEVX_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices โœจ

Purpose:

ZHEEVX_2STAGE computes selected eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A using the 2stage technique for the reduction to tridiagonal. Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues. Pick your fighter. ๐Ÿ’…

Parameters

  • JOBZ โ€” JOBZ is CHARACTER*1
    • = 'N': Compute eigenvalues only;
    • = 'V': Compute eigenvalues and eigenvectors. Not available in this release. ๐Ÿ˜ญ (devastating, honestly)
  • RANGE โ€” RANGE is CHARACTER*1
    • = 'A': all eigenvalues will be found.
    • = 'V': all eigenvalues in the half-open interval (VL,VU] will be found.
    • = 'I': the IL-th through IU-th eigenvalues will be found.
  • UPLO โ€” UPLO is CHARACTER*1
    • = 'U': Upper triangle of A is stored;
    • = 'L': Lower triangle of A is stored.
  • N โ€” N is INTEGER. The order of the matrix A. N >= 0.
  • A โ€” A is COMPLEX*16 array, dimension (LDA, N). On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A. On exit, the lower triangle (if UPLO='L') or the upper triangle (if UPLO='U') of A, including the diagonal, is destroyed. Same warning, same chaos. ๐Ÿซ 
  • LDA โ€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
  • VL โ€” VL is DOUBLE PRECISION. If RANGE='V', the lower bound of the interval to be searched for eigenvalues. VL < VU. Not referenced if RANGE = 'A' or 'I'.
  • VU โ€” VU is DOUBLE PRECISION. If RANGE='V', the upper bound of the interval to be searched for eigenvalues. VL < VU. Not referenced if RANGE = 'A' or 'I'.
  • IL โ€” IL is INTEGER. If RANGE='I', the index of the smallest eigenvalue to be returned. 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'.
  • IU โ€” IU is INTEGER. If RANGE='I', the index of the largest eigenvalue to be returned. 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'.
  • ABSTOL โ€” ABSTOL is DOUBLE PRECISION, 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
ABSTOL + EPS *   max( |a|,|b| ) ,

where EPS is the machine precision. If ABSTOL is less than or equal to zero, then EPS*|T| will be used in its place, where |T| is the 1-norm of 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*DLAMCH('S'), not zero. If this routine returns with INFO>0, indicating that some eigenvectors did not converge, try setting ABSTOL to 2*DLAMCH('S').

See 'Computing Small Singular Values of Bidiagonal Matrices with Guaranteed High Relative Accuracy,' by Demmel and Kahan, LAPACK Working Note #3. ๐Ÿ“–

  • M โ€” M is INTEGER. The total number of eigenvalues found. 0 <= M <= N. If RANGE = 'A', M = N, and if RANGE = 'I', M = IU-IL+1.
  • W โ€” W is DOUBLE PRECISION array, dimension (N). On normal exit, the first M elements contain the selected eigenvalues in ascending order. ๐ŸŒˆ
  • Z โ€” โ€ฆand Z's whole glow-up is coming right up, bestie. Stay tuned. ๐Ÿ’œ
  • Z โ€” Z is COMPLEX*16 array, dimension (LDZ, max(1,M)) ๐Ÿ’œ

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 i-th column of Z holding the eigenvector associated with W(i). iconic behaviour honestly.

If an eigenvector fails to converge, then that column of Z contains the latest approximation to the eigenvector, and the index of the eigenvector is returned in IFAIL. ๐Ÿ˜ญ she tried her best.

If JOBZ = 'N', then Z is not referenced. literally not even looked at.

Note: the user 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 must be used. bestie pls do not forget this one, it's giving consequences.
  • LDZ โ€” LDZ is INTEGER

The leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= max(1,N).

  • WORK โ€” WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))

On exit, if INFO = 0, WORK(1) returns the optimal LWORK. she's telling you her ideal size, listen to her ๐Ÿ’…

  • LWORK โ€” LWORK is INTEGER

The length of the array WORK. LWORK >= 1, when N <= 1; otherwise:

If JOBZ = 'N' and N > 1, LWORK must be queried. ๐Ÿซถ

LWORK = MAX(1, 8*N, dimension) where
dimension = max(stage1,stage2) + (KD+1)*N + N
          = N*KD + N*max(KD+1,FACTOPTNB)
            + max(2*KD*KD, KD*NTHREADS)
            + (KD+1)*N + N
where KD is the blocking size of the reduction,
FACTOPTNB is the blocking used by the QR or LQ
algorithm, usually FACTOPTNB=128 is a good choice
NTHREADS is the number of threads used when
openMP compilation is enabled, otherwise =1.

If JOBZ = 'V' and N > 1, LWORK must be queried. Not yet available ๐Ÿ™ˆ (yes fr fr, that's what it says)

If LWORK = -1, then 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 by XERBLA. sneaky lil query mode, no drama ๐Ÿ’–

  • RWORK โ€” RWORK is DOUBLE PRECISION array, dimension (7*N)
  • IWORK โ€” IWORK is INTEGER array, dimension (5*N)
  • IFAIL โ€” IFAIL is INTEGER array, dimension (N)

If JOBZ = 'V', then if INFO = 0, the first M elements of IFAIL are zero. If INFO > 0, then IFAIL contains the indices of the eigenvectors that failed to converge. the receipts of who ghosted you ๐Ÿ˜ญ

If JOBZ = 'N', then IFAIL is not referenced.

  • INFO โ€” INFO is INTEGER
    • = 0: successful exit โœจ
    • < 0: if INFO = -i, the i-th argument had an illegal value ๐Ÿšจ
    • > 0: if INFO = i, then i eigenvectors failed to converge. Their indices are stored in array IFAIL. ๐Ÿ’€

๐Ÿ‘‘ Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.


๐Ÿ”ฌ Further Details:

All details about the 2stage techniques are available in:

Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8 , 11 pages. http://doi.acm.org/10.1145/2063384.2063394

A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292

A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196


๐ŸŒธ subroutine zhegv

subroutine zhegv (integer ITYPE, character JOBZ, character UPLO, integer N,
    complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension(
    ldb, * ) B, integer LDB, double precision, dimension( * ) W, complex*16,
    dimension( * ) WORK, integer LWORK, double precision, dimension( * )
    RWORK, integer INFO)

ZHEGV ๐Ÿ’–

Purpose:

ZHEGV computes all the eigenvalues, and optionally, the eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and B are assumed to be Hermitian and B is also positive definite. she's the classic, the blueprint, the moment ๐Ÿ‘‘

Parameters

  • ITYPE โ€” ITYPE is INTEGER

Specifies the problem type to be solved:

  • = 1: A*x = (lambda)*B*x
  • = 2: A*B*x = (lambda)*x
  • = 3: B*A*x = (lambda)*x
  • JOBZ โ€” JOBZ is CHARACTER*1
    • = 'N': Compute eigenvalues only;
    • = 'V': Compute eigenvalues and eigenvectors.
  • UPLO โ€” UPLO is CHARACTER*1
    • = 'U': Upper triangles of A and B are stored;
    • = 'L': Lower triangles of A and B are stored.
  • N โ€” N is INTEGER

The order of the matrices A and B. N >= 0.

  • A โ€” A is COMPLEX*16 array, dimension (LDA, N)

On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A.

On exit, if JOBZ = 'V', then if INFO = 0, A contains the matrix Z of eigenvectors. The eigenvectors are normalized as follows: if ITYPE = 1 or 2, Z**H*B*Z = I; if ITYPE = 3, Z**H*inv(B)*Z = I.

If JOBZ = 'N', then on exit the upper triangle (if UPLO='U') or the lower triangle (if UPLO='L') of A, including the diagonal, is destroyed. ๐Ÿ’€ she's gone, gone.

  • LDA โ€” LDA is INTEGER

The leading dimension of the array A. LDA >= max(1,N).

  • B โ€” B is COMPLEX*16 array, dimension (LDB, N)

On entry, the Hermitian positive definite matrix B. If UPLO = 'U', the leading N-by-N upper triangular part of B contains the upper triangular part of the matrix B. If UPLO = 'L', the leading N-by-N lower triangular part of B contains the lower triangular part of the matrix B.

On exit, if INFO <= N, the part of B containing the matrix is overwritten by the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H.

  • LDB โ€” LDB is INTEGER

The leading dimension of the array B. LDB >= max(1,N).

  • W โ€” W is DOUBLE PRECISION array, dimension (N)

If INFO = 0, the eigenvalues in ascending order. sorted, organised, main character energy ๐ŸŒˆ

  • WORK โ€” WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))

On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

  • LWORK โ€” LWORK is INTEGER

The length of the array WORK. LWORK >= max(1,2*N-1). For optimal efficiency, LWORK >= (NB+1)*N, where NB is the blocksize for ZHETRD returned by ILAENV.

If LWORK = -1, then 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 by XERBLA.

  • RWORK โ€” RWORK is DOUBLE PRECISION array, dimension (max(1, 3*N-2))
  • INFO โ€” INFO is INTEGER
    • = 0: successful exit โœจ
    • < 0: if INFO = -i, the i-th argument had an illegal value ๐Ÿšจ
    • > 0: ZPOTRF or ZHEEV returned an error code:
      • <= N: if INFO = i, ZHEEV failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero;
      • > N: if INFO = N + i, for 1 <= i <= N, then the leading minor of order i of B is not positive definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed. ๐Ÿ’€ no results for you, sorry bestie.

Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.


๐Ÿฆ‹ subroutine zhegv_2stage

subroutine zhegv_2stage (integer ITYPE, character JOBZ, character UPLO,
    integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16,
    dimension( ldb, * ) B, integer LDB, double precision, dimension( * ) W,
    complex*16, dimension( * ) WORK, integer LWORK, double precision,
    dimension( * ) RWORK, integer INFO)

ZHEGV_2STAGE ๐Ÿ”ฅ

Purpose:

ZHEGV_2STAGE computes all the eigenvalues, and optionally, the eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and B are assumed to be Hermitian and B is also positive definite. This routine use the 2stage technique for the reduction to tridiagonal which showed higher performance on recent architecture and for large sizes N>2000. she's the upgraded glow-up version, ate and left no crumbs ๐Ÿ’…

Parameters

  • ITYPE โ€” ITYPE is INTEGER

Specifies the problem type to be solved:

  • = 1: A*x = (lambda)*B*x
  • = 2: A*B*x = (lambda)*x
  • = 3: B*A*x = (lambda)*x
  • JOBZ โ€” JOBZ is CHARACTER*1
    • = 'N': Compute eigenvalues only;
    • = 'V': Compute eigenvalues and eigenvectors. Not available in this release. ๐Ÿ˜ญ (we wait)
  • UPLO
  • UPLO is CHARACTER*1 โ€” bestie, this tells us which triangle of A and B we're actually storing.
    • = 'U': Upper triangles of A and B are stored;
    • = 'L': Lower triangles of A and B are stored.
  • N is INTEGER โ€” the order of the matrices A and B. N >= 0 periodt.
  • A is COMPLEX*16 array, dimension (LDA, N).
    • On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A.
    • On exit, if JOBZ = 'V', then if INFO = 0, A contains the matrix Z of eigenvectors. The eigenvectors are normalized as follows:
      • if ITYPE = 1 or 2, Z**H*B*Z = I;
      • if ITYPE = 3, Z**H*inv(B)*Z = I.
    • If JOBZ = 'N', then on exit the upper triangle (if UPLO='U') or the lower triangle (if UPLO='L') of A, including the diagonal, is destroyed. ๐Ÿ’€
  • LDA is INTEGER โ€” the leading dimension of the array A. LDA >= max(1,N).
  • B is COMPLEX*16 array, dimension (LDB, N).
    • On entry, the Hermitian positive definite matrix B. If UPLO = 'U', the leading N-by-N upper triangular part of B contains the upper triangular part of the matrix B. If UPLO = 'L', the leading N-by-N lower triangular part of B contains the lower triangular part of the matrix B.
    • On exit, if INFO <= N, the part of B containing the matrix is overwritten by the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H.
  • LDB is INTEGER โ€” the leading dimension of the array B. LDB >= max(1,N).
  • W is DOUBLE PRECISION array, dimension (N) โ€” if INFO = 0, the eigenvalues in ascending order. so satisfying when they're sorted, right? โœจ
  • WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)) โ€” on exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK is INTEGER โ€” the length of the array WORK. LWORK >= 1, when N <= 1; otherwise:
    • If JOBZ = 'N' and N > 1, LWORK must be queried.
LWORK = MAX(1, dimension) where
                                          dimension = max(stage1,stage2) + (KD+1)*N + N
                                                    = N*KD + N*max(KD+1,FACTOPTNB)
                                                      + max(2*KD*KD, KD*NTHREADS)
                                                      + (KD+1)*N + N
                                          where KD is the blocking size of the reduction,
                                          FACTOPTNB is the blocking used by the QR or LQ
                                          algorithm, usually FACTOPTNB=128 is a good choice
                                          NTHREADS is the number of threads used when
                                          openMP compilation is enabled, otherwise =1.
  • If JOBZ = 'V' and N > 1, LWORK must be queried. Not yet available ๐Ÿ˜ญ
  • If LWORK = -1, then 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 by XERBLA.
  • RWORK is DOUBLE PRECISION array, dimension (max(1, 3*N-2)).
  • INFO is INTEGER
    • = 0: successful exit ๐ŸŽ‰
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • > 0: ZPOTRF or ZHEEV returned an error code:
      • <= N: if INFO = i, ZHEEV failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero;
      • > N: if INFO = N + i, for 1 <= i <= N, then the leading minor of order i of B is not positive definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed.

Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

the literal icons who wrote this! ๐Ÿ’…

Further Details

All details about the 2stage techniques are available in:

  • Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8 , 11 pages. http://doi.acm.org/10.1145/2063384.2063394
  • A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292
  • A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196

subroutine zhegvd

subroutine zhegvd (integer ITYPE, character JOBZ, character UPLO, integer N,
    complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension(
    ldb, * ) B, integer LDB, double precision, dimension( * ) W, complex*16,
    dimension( * ) WORK, integer LWORK, double precision, dimension( * )
    RWORK, integer LRWORK, integer, dimension( * ) IWORK, integer LIWORK,
    integer INFO)

ZHEGVD

Purpose

ZHEGVD computes all the eigenvalues, and optionally, the eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and B are assumed to be Hermitian and B is also positive definite. If eigenvectors are desired, it uses a divide and conquer algorithm. divide and conquer? she's a queen. ๐Ÿ‘‘

The divide and conquer algorithm makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none.

Parameters

  • ITYPE is INTEGER โ€” specifies the problem type to be solved:
    • = 1: A*x = (lambda)*B*x
    • = 2: A*B*x = (lambda)*x
    • = 3: B*A*x = (lambda)*x
  • JOBZ is CHARACTER*1
    • = 'N': Compute eigenvalues only;
    • = 'V': Compute eigenvalues and eigenvectors.
  • UPLO is CHARACTER*1
    • = 'U': Upper triangles of A and B are stored;
    • = 'L': Lower triangles of A and B are stored.
  • N is INTEGER โ€” the order of the matrices A and B. N >= 0.
  • A is COMPLEX*16 array, dimension (LDA, N)
    • On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A.
    • On exit, if JOBZ = 'V', then if INFO = 0, A contains the matrix Z of eigenvectors. The eigenvectors are normalized as follows:
      • if ITYPE = 1 or 2, Z**H*B*Z = I;
      • if ITYPE = 3, Z**H*inv(B)*Z = I.
    • If JOBZ = 'N', then on exit the upper triangle (if UPLO='U') or the lower triangle (if UPLO='L') of A, including the diagonal, is destroyed. ๐Ÿ’€
  • LDA is INTEGER โ€” the leading dimension of the array A. LDA >= max(1,N).
  • B is COMPLEX*16 array, dimension (LDB, N)
    • On entry, the Hermitian matrix B. If UPLO = 'U', the leading N-by-N upper triangular part of B contains the upper triangular part of the matrix B. If UPLO = 'L', the leading N-by-N lower triangular part of B contains the lower triangular part of the matrix B.
    • On exit, if INFO <= N, the part of B containing the matrix is overwritten by the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H.
  • LDB is INTEGER โ€” the leading dimension of the array B. LDB >= max(1,N).
  • W is DOUBLE PRECISION array, dimension (N) โ€” if INFO = 0, the eigenvalues in ascending order.
  • WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)) โ€” on exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK is INTEGER โ€” the length of the array WORK.
    • If N <= 1, LWORK >= 1.
    • If JOBZ = 'N' and N > 1, LWORK >= N + 1.
    • If JOBZ = 'V' and N > 1, LWORK >= 2*N + N**2.
    • If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA.
  • RWORK is DOUBLE PRECISION array, dimension (MAX(1,LRWORK)) โ€” on exit, if INFO = 0, RWORK(1) returns the optimal LRWORK.
  • LRWORK is INTEGER โ€” the dimension of the array RWORK.
    • If N <= 1, LRWORK >= 1.
    • If JOBZ = 'N' and N > 1, LRWORK >= N.
    • If JOBZ = 'V' and N > 1, LRWORK >= 1 + 5*N + 2*N**2.

If LRWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. so like, it's just doing recon, not the actual math. ๐Ÿ’…

  • IWORK โ€” bestie, this is an INTEGER array, dimension (MAX(1,LIWORK)). On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK. it's giving helpful hints. โœจ
  • LIWORK โ€” an INTEGER. The dimension of the array IWORK. Here's the tea: If N <= 1, LIWORK >= 1. If JOBZ = 'N' and N > 1, LIWORK >= 1. If JOBZ = 'V' and N > 1, LIWORK >= 3 + 5*N. If LIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. so many workspace queries, but we love a flexible queen. ๐Ÿ‘‘
  • INFO โ€” an INTEGER. = 0: successful exit, we love a win. < 0: if INFO = -i, the i-th argument had an illegal value, not the vibe. > 0: ZPOTRF or ZHEEVD returned an error code: <= N: if INFO = i and JOBZ = 'N', then the algorithm failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero; if INFO = i and JOBZ = 'V', then the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columns INFO/(N+1) through mod(INFO,N+1); > N: if INFO = N + i, for 1 <= i <= N, then the leading minor of order i of B is not positive definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed. big yikes, but at least you know what went wrong. ๐Ÿ’€

Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

shoutout to the institutions. ๐ŸŽ€


Further Details

Modified so that no backsubstitution is performed if ZHEEVD fails to converge (NEIG in old code could be greater than N causing out of bounds reference to A - reported by Ralf Meyer). Also corrected the description of INFO and the test on ITYPE. Sven, 16 Feb 05. history lesson, love that. ๐Ÿฆ‹


Contributors

  • Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA

thanks Mark! ๐Ÿซถ


subroutine zhegvx

subroutine zhegvx (integer ITYPE, character JOBZ, character RANGE, character
    UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA,
    complex*16, dimension( ldb, * ) B, integer LDB, double precision VL,
    double precision VU, integer IL, integer IU, double precision ABSTOL,
    integer M, double precision, dimension( * ) W, complex*16, dimension(
    ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, integer LWORK,
    double precision, dimension( * ) RWORK, integer, dimension( * ) IWORK,
    integer, dimension( * ) IFAIL, integer INFO)
ZHEGVX

Purpose

ZHEGVX computes selected eigenvalues, and optionally, eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and B are assumed to be Hermitian and B is also positive definite. Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues. it's giving choose-your-own-adventure, but make it linear algebra. โœจ

Parameters

  • ITYPE โ€” an INTEGER. Specifies the problem type to be solved: = 1: A*x = (lambda)*B*x; = 2: A*B*x = (lambda)*x; = 3: B*A*x = (lambda)*x. pick your fighter. ๐Ÿ’…
  • JOBZ โ€” a CHARACTER*1. = 'N': compute eigenvalues only; = 'V': compute eigenvalues and eigenvectors. simple as that.
  • RANGE โ€” a CHARACTER*1. = 'A': all eigenvalues will be found. = 'V': all eigenvalues in the half-open interval (VL,VU] will be found. = 'I': the IL-th through IU-th eigenvalues will be found. choose your range, bestie.
  • UPLO โ€” a CHARACTER*1. = 'U': upper triangles of A and B are stored; = 'L': lower triangles of A and B are stored. upper or lower, you decide. ๐ŸŒธ
  • N โ€” an INTEGER. The order of the matrices A and B. N >= 0. no negativity allowed. ๐Ÿšซ
  • A โ€” a COMPLEX*16 array, dimension (LDA, N). On entry, the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A. On exit, the lower triangle (if UPLO='L') or the upper triangle (if UPLO='U') of A, including the diagonal, is destroyed. rip to that part of A, it's gone. ๐Ÿ’€
  • LDA โ€” an INTEGER. The leading dimension of the array A. LDA >= max(1,N). respect the dimension. ๐Ÿ‘‘
  • B โ€” a COMPLEX*16 array, dimension (LDB, N). On entry, the Hermitian matrix B. If UPLO = 'U', the leading N-by-N upper triangular part of B contains the upper triangular part of the matrix B. If UPLO = 'L', the leading N-by-N lower triangular part of B contains the lower triangular part of the matrix B. On exit, if INFO <= N, the part of B containing the matrix is overwritten by the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H. so B gets a glow-up. โœจ
  • LDB โ€” an INTEGER. The leading dimension of the array B. LDB >= max(1,N). keep it consistent. ๐Ÿ’…
  • VL โ€” a DOUBLE PRECISION. If RANGE='V', the lower bound of the interval to be searched for eigenvalues. VL < VU. Not referenced if RANGE = 'A' or 'I'. only for the 'V' girlies. ๐Ÿ’œ
  • VU โ€” a DOUBLE PRECISION. If RANGE='V', the upper bound of the interval to be searched for eigenvalues. VL < VU. Not referenced if RANGE = 'A' or 'I'. the upper limit, periodt.
  • IL โ€” an INTEGER. If RANGE='I', the index of the smallest eigenvalue to be returned. 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'. index vibes only. ๐Ÿ”ข
  • IU โ€” an INTEGER. If RANGE='I', the index of the largest eigenvalue to be returned. 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'. the upper index, slay. ๐Ÿ‘‘
  • ABSTOL โ€” a DOUBLE PRECISION. 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 ABSTOL + EPS * max( |a|,|b| ), where EPS is the machine precision. If ABSTOL is less than or equal to zero, then EPS*|T| will be used in its place, where |T| is the 1-norm of the tridiagonal matrix obtained by reducing C to tridiagonal form, where C is the symmetric matrix of the standard symmetric problem to which the generalized problem is transformed. Eigenvalues will be computed most accurately when ABSTOL is set to twice the underflow threshold 2*DLAMCH('S'), not zero. If this routine returns with INFO>0, indicating that some eigenvectors did not converge, try setting ABSTOL to 2*DLAMCH('S'). so if things are acting up, bump that tolerance. ๐Ÿ’…
  • M โ€” an INTEGER. The total number of eigenvalues found. 0 <= M <= N. If RANGE = 'A', M = N, and if RANGE = 'I', M = IU-IL+1. the count is giving math. ๐Ÿงฎ
  • W โ€” a DOUBLE PRECISION array, dimension (N). The first M elements contain the selected eigenvalues in ascending order. sorted and ready. ๐ŸŒˆ
  • Z โ€” a COMPLEX*16 array, dimension (LDZ, max(1,M)). If JOBZ = 'N', then Z is not referenced. 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 i-th column of Z holding the eigenvector associated with W(i). The eigenvectors are normalized as follows: if ITYPE = 1 or 2, Z**T*B*Z = I; if ITYPE = 3, Z**T*inv(B)*Z = I. If an eigenvector fails to converge, then that column of Z contains the latest approximation to the eigenvector, and the index of the eigenvector is returned in IFAIL. Note: the user 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 must be used. so don't skimp on columns, bestie. ๐Ÿซถ
  • LDZ โ€” an INTEGER. The leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= max(1,N). dimension check, always. ๐Ÿ’…
  • WORK โ€” a COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. it's the workspace, doing its thing. โœจ
  • LWORK โ€” an INTEGER. The length of the array WORK. LWORK >= max(1,2*N). For optimal efficiency, LWORK >= (NB+1)*N, where NB is the blocksize for ZHETRD returned by ILAENV. If LWORK = -1, then 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 by XERBLA. so if you want max efficiency, give it more space. ๐Ÿ’…
  • RWORK โ€” a DOUBLE PRECISION array, dimension (7*N). seven times N, that's the vibe. ๐Ÿ“
  • IWORK โ€” an INTEGER array, dimension (5*N). five times N, iconic. ๐ŸŒˆ
  • IFAIL โ€”
  • IFAIL โ€” INTEGER array, dimension (N) ๐Ÿ’–

So like, if JOBZ = 'V' and INFO = 0? The first M elements of IFAIL are all zero. Clean. โœจ If INFO > 0 instead, then IFAIL is holding the indices of the eigenvectors that failed to converge โ€” the little drama queens that just would not settle. ๐Ÿ˜ญ

And if JOBZ = 'N'? Then IFAIL is not referenced, bestie. It's giving background character, no lines. ๐Ÿ’€

  • INFO โ€” INTEGER, the vibe check at the end ๐Ÿ‘‘
    • = 0: successful exit, we ate, no notes ๐ŸŽ€
    • < 0: if INFO = -i, then the i-th argument had an illegal value. Somebody passed something cursed and the routine is NOT having it. ๐Ÿ’…
    • > 0: ZPOTRF or ZHEEVX returned an error code, and here's the tea:
      • <= N: if INFO = i, then ZHEEVX failed to converge; i eigenvectors failed to converge, and their indices are stored in array IFAIL. ๐Ÿซถ
      • > N: if INFO = N + i, for 1 <= i <= N, then the leading minor of order i of B is not positive definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed โ€” like, nothing. Zero. Nada. ๐Ÿ™ˆ

๐Ÿ‘‘ Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

The whole squad, fr fr ๐ŸŒˆ

๐Ÿซถ Contributors:

Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA โ€” shoutout to Mark, iconic behavior ๐Ÿ’œ


โœจ Author (the other one, yes there's two, iykyk)

Generated automatically by Doxygen for LAPACK from the source code. ๐Ÿค– Not a human, just a very diligent little robot doing its thing. Slay.


And that's a wrap on complex16HEeigen(3), bestie โ€” you made it to the end of all ten parts and honestly? Main character energy. ๐ŸŒธ

This lil masterpiece is Version 3.11.0, dated Sun Nov 27 2022, and it lives at complex16HEeigen(3). Go forth and diagonalize responsibly. ๐Ÿ’…โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from