ZHETRD(3)
π¦ ZHETRD β the girlies are reducing a complex Hermitian matrix to tridiagonal form β¨
ok so real quick before we get into it: this is zhetrd.f, and the full path the manual screams at you is /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/zhetrd.f β that's the NAME, that's the file, that's where she lives π
. It's ZHETRD, a subroutine from the LAPACK library functions manual, and she's lowkey doing SO much. Buckle up bestie π
β¨ SYNOPSIS β¨
ok so the functions/subroutines section literally just says this:
subroutine ZHETRD (uplo, n, a, lda, d, e, tau, work, lwork, info)
and then, like, also:
ZHETRD
that's it. that's the whole vibe. moving on π«Ά
π Function/Subroutine Documentation π
πΈ the full signature, bestie
subroutine ZHETRD (character uplo, integer n, complex*16, dimension( lda, * ) a, integer lda, double precision, dimension( * ) d, double precision, dimension( * ) e, complex*16, dimension( * ) tau, complex*16, dimension( * ) work, integer lwork, integer info)
yes that's a lot of arguments, no we're not skipping any of them, and yes, her name is ZHETRD π
π₯ Purpose π₯
ok so what does she Actually do. here it is, straight up:
ZHETRDreduces a complex Hermitian matrix A to real symmetric tridiagonal form T by a unitary similarity transformation:Q**H * A * Q = T.
iconic. she takes your fancy complex Hermitian situation and gives you a nice tidy tridiagonal queen. periodt β¨
π Parameters π
UPLO
UPLOisCHARACTER*1= 'U': the upper triangle of A is stored, slay= 'L': the lower triangle of A is stored
pick a side bestie, there's no third option π
N
NisINTEGER- the order of the matrix A.
N >= 0.
A
AisCOMPLEX*16array, 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, and the strictly lower triangular part of A is not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. - on exit, if
UPLO = 'U', the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the arrayTAU, represent the unitary matrix Q as a product of elementary reflectors; ifUPLO = 'L', the diagonal and first subdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the arrayTAU, represent the unitary matrix Q as a product of elementary reflectors. See Further Details β she's got lore π
bestie she gets overwritten. like, on exit A is not your original matrix anymore. it's giving main character transformation arc. emotionally prepare π¦
LDA
LDAisINTEGER- the leading dimension of the array A.
LDA >= max(1,N).
D
DisDOUBLE PRECISIONarray, dimension(N)- the diagonal elements of the tridiagonal matrix T:
D(i) = A(i,i).
E
EisDOUBLE PRECISIONarray, dimension(N-1)- the off-diagonal elements of the tridiagonal matrix T:
E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.
TAU
TAUisCOMPLEX*16array, dimension(N-1)- the scalar factors of the elementary reflectors (see Further Details).
WORK
WORKisCOMPLEX*16array, dimension(MAX(1,LWORK))- on exit, if
INFO = 0,WORK(1)returns the optimalLWORK.
LWORK
LWORKisINTEGER- the dimension of the array
WORK.LWORK >= 1. - for optimum performance
LWORK >= N*NB, whereNBis the optimal blocksize. - if
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.
soLWORK = -1is not an error, it's a mood. she's just peeking at how much space she'd want, no drama, noXERBLAyelling π
INFO
INFOisINTEGER= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value
π Author π
these absolute legends wrote her:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
give them their flowers π
π Further Details π
ok this is the good part, the lore drop, the iykyk section β¨
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors
Q = H(n-1) . . . H(2) H(1).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(n-1).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( d e v2 v3 v4 ) ( d )
( d e v3 v4 ) ( e d )
( d e v4 ) ( v1 e d )
( d e ) ( v1 v2 e d )
( d ) ( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i).
literally a whole before-and-after of your matrix. screenshot it, it's iconic πΈ
β Definition at line 191 of file zhetrd.f. β
yes bestie, line 191, that's where the magic starts π«
πΈ Author (the other one) πΈ
Generated automatically by Doxygen for LAPACK from the source code.
not a human, a robot, and honestly she ate π€π
ok that's the whole page π«Ά she's LAPACK, Version 3.12.0, and the file is /home/abui...RC/zhetrd.f(3) β mwah, go reduce something gorgeous, drink water, and remember: Q**H * A * Q = T β¨ππ
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms