ZHPTRD(3)
π ZHPTRD(3) β bestie's guide to the complex Hermitian packed β tridiagonal glow-up
okay so this is a page from the LAPACK Library Functions Manual and honestly? it's giving linear algebra main character energy. sit down, grab a boba, we're reducing a complex Hermitian matrix to real symmetric tridiagonal form. no cap. π«Ά
β¨ NAME β¨
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/zhptrd.f
that's the whole name, bestie β it's a .f file living its best life in the LAPACK source tree. yes the NAME section is literally just a file path and honestly? iconic. π
πΈ SYNOPSIS πΈ
Functions/Subroutines
subroutine ZHPTRD (uplo, n, ap, d, e, tau, info)
ZHPTRD β that's her. that's the girl.
π¦ Function/Subroutine Documentation π¦
subroutine ZHPTRD (character uplo, integer n, complex*16, dimension( * ) ap,
double precision, dimension( * ) d, double precision, dimension( * ) e,
complex*16, dimension( * ) tau, integer info)
ZHPTRD π (the full-signature version, for when you need the whole fit)
π― Purpose:
ZHPTRD reduces a complex Hermitian matrix A stored in packed form to real symmetric tridiagonal form T by a unitary similarity transformation: Q**H * A * Q = T.
so basically: A comes in complex + Hermitian + packed (squeezed, no zeros), and T comes out real + symmetric + tridiagonal (just the diagonal and its two adjacent lanes). the transformation is Q**H * A * Q = T, and Q is unitary. she did that. π₯
π Parameters
UPLO
UPLOisCHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
pick your fighter: upper or lower triangle. there is no third option, don't try it. π
N
NisINTEGER- The order of the matrix A.
N >= 0.
the size of the situation. and yes, N >= 0 β zero is a valid vibe check. β¨
AP
APisCOMPLEX*16array, dimension(N*(N+1)/2)- On entry, the upper or lower triangle of the Hermitian matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:
- if
UPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*(2*n-j)/2) = A(i,j)forj<=i<=n.
- if
- 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 over-written 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.
this is the big one, the packed storage container, the whole personality. π
heads up: on exit she gets overwritten. like, gone. the diagonal + first superdiagonal (or subdiagonal) become T's elements, and the rest plus TAU become Q. so if you needed the original A, too late bestie π See Further Details below, i'm not retyping it, it's right there.
D
DisDOUBLE PRECISIONarray, dimension(N)- The diagonal elements of the tridiagonal matrix T:
D(i) = A(i,i).
the main diagonal of T, cute and real and double precision. β
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'.
the off-diagonal besties β note the size is N-1, because a tridiagonal's off-diagonals are one shorter than the diagonal. math said balance. π§
TAU
TAUisCOMPLEX*16array, dimension(N-1)- The scalar factors of the elementary reflectors (see Further Details).
the scalars that make the reflectors reflect. also N-1. see Further Details, again, for the actual math. π
INFO
INFOisINTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value
the vibe check report. 0 means slay, negative means somebody passed a bad argument and we're telling you exactly which one by index. β οΈ
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the group project that actually got finished. respect. π
π Further Details:
IfUPLO = 'U', the matrix Q is represented as a product of elementary reflectorsfortran Q = H(n-1) . . . H(2) H(1).EachH(i)has the formfortran H(i) = I - tau * v * v**Hwheretauis a complex scalar, andvis a complex vector withv(i+1:n) = 0andv(i) = 1;v(1:i-1)is stored on exit inAP, overwritingA(1:i-1,i+1), andtauis stored inTAU(i). IfUPLO = 'L', the matrix Q is represented as a product of elementary reflectorsfortran Q = H(1) H(2) . . . H(n-1).EachH(i)has the formfortran H(i) = I - tau * v * v**Hwheretauis a complex scalar, andvis a complex vector withv(1:i) = 0andv(i+1) = 1;v(i+2:n)is stored on exit inAP, overwritingA(i+2:n,i), andtauis stored inTAU(i).
so the 'U' order is backwards (H(n-1) . . . H(2) H(1)) and the 'L' order is forwards (H(1) H(2) . . . H(n-1)) β do NOT mix those up, that's the whole tea. each H(i) is I - tau * v * v**H with those exact zero-and-one patterns on v, and the nonzero part of v gets parked in AP on exit while tau goes to TAU(i). note: that's overwriting A(1:i-1,i+1) for 'U' and A(i+2:n,i) for 'L' β your original numbers are not coming back. π
Definition at line 150 of file zhptrd.f.
okay that's the whole page, you're officially a ZHPTRD understander π
β¨ cute sign-off β¨ this glamorous little document was Generated automatically by Doxygen for LAPACK from the source code, and it's serving LAPACK Version 3.12.0 realness. mwah. ππ¦πΈ
π¦ 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