SRC/zbbcsd.f(3)

πŸ’… NAME

SRC/zbbcsd.f β€” bestie, this is the source file page for ZBBCSD, and it's from the Library Functions Manual. It's a LAPACK routine, it's iconic, and we're gonna get through it together ✨


🌸 SYNOPSIS

Functions/Subroutines

subroutine zbbcsd (jobu1, jobu2, jobv1t, jobv2t, trans, m, p, q, theta,
    phi, u1, ldu1, u2, ldu2, v1t, ldv1t, v2t, ldv2t, b11d, b11e, b12d,
    b12e, b21d, b21e, b22d, b22e, rwork, lrwork, info)

ZBBCSD β€” that's the whole vibe of this page 🫢


πŸ¦‹ Function/Subroutine Documentation

subroutine zbbcsd (character jobu1, character jobu2, character jobv1t, character jobv2t, character trans, integer m, integer p, integer q, double precision, dimension( * ) theta, double precision, dimension( * ) phi, complex*16, dimension( ldu1, * ) u1, integer ldu1, complex*16, dimension( ldu2, * ) u2, integer ldu2, complex*16, dimension( ldv1t, * ) v1t, integer ldv1t, complex*16, dimension( ldv2t, * ) v2t, integer ldv2t, double precision, dimension( * ) b11d, double precision, dimension( * ) b11e, double precision, dimension( * ) b12d, double precision, dimension( * ) b12e, double precision, dimension( * ) b21d, double precision, dimension( * ) b21e, double precision, dimension( * ) b22d, double precision, dimension( * ) b22e, double precision, dimension( * ) rwork, integer lrwork, integer info)

ZBBCSD


πŸ”₯ Purpose

okay so. ZBBCSD computes the CS decomposition of a unitary matrix in bidiagonal-block form, and the way it does it is genuinely stunning 😭

    [ B11 | B12 0  0 ]
    [  0  |  0 -I  0 ]
X = [----------------]
    [ B21 | B22 0  0 ]
    [  0  |  0  0  I ]
                              [  C | -S  0  0 ]
                  [ U1 |    ] [  0 |  0 -I  0 ] [ V1 |    ]**H
                = [---------] [---------------] [---------]   .
                  [    | U2 ] [  S |  C  0  0 ] [    | V2 ]
                              [  0 |  0  0  I ]

so X is M-by-M, its top-left block is P-by-Q, and Q must be no larger than P, M-P, or M-Q. periodt. (if Q is not the smallest index, then X must be transposed and/or permuted β€” which like, can be done in constant time using the TRANS and SIGNS options, see ZUNCSD for details πŸ‘€)

the bidiagonal matrices B11, B12, B21, and B22 are represented implicitly by angles THETA(1:Q) and PHI(1:Q-1) β€” no cap, they're not stored as actual arrays of matrix entries, it's all angles πŸ’«

and the unitary matrices U1, U2, V1T, and V2T are input/output. the input matrices are pre- or post-multiplied by the appropriate singular vector matrices. iconic behaviour honestly.


πŸ‘‘ Parameters

  • JOBU1 β€” JOBU1 is CHARACTER. = 'Y': U1 is updated; otherwise: U1 is not updated. that's it, that's the whole flag πŸŽ€
  • JOBU2 β€” JOBU2 is CHARACTER. = 'Y': U2 is updated; otherwise: U2 is not updated.
  • JOBV1T β€” JOBV1T is CHARACTER. = 'Y': V1T is updated; otherwise: V1T is not updated.
  • JOBV2T β€” JOBV2T is CHARACTER. = 'Y': V2T is updated; otherwise: V2T is not updated.
  • TRANS β€” TRANS is CHARACTER. = 'T': X, U1, U2, V1T, and V2T are stored in row-major order; otherwise: X, U1, U2, V1T, and V2T are stored in column-major order. lowkey the most important flag here ngl 🫢
  • M β€” M is INTEGER. the number of rows and columns in X, the unitary matrix in bidiagonal-block form.
  • P β€” P is INTEGER. the number of rows in the top-left block of X. 0 <= P <= M.
  • Q β€” Q is INTEGER. the number of columns in the top-left block of X. 0 <= Q <= MIN(P,M-P,M-Q). so like, Q stays small. it's the main character but it's also the smallest index, iykyk πŸ’…
  • THETA β€” THETA is DOUBLE PRECISION array, dimension (Q). on entry: the angles THETA(1),...,THETA(Q) that, along with PHI(1), ...,PHI(Q-1), define the matrix in bidiagonal-block form. on exit: the angles whose cosines and sines define the diagonal blocks in the CS decomposition. she transforms ✨
  • PHI β€” PHI is DOUBLE PRECISION array, dimension (Q-1). the angles PHI(1),...,PHI(Q-1) that, along with THETA(1),...,THETA(Q), define the matrix in bidiagonal-block form.
  • U1 β€” U1 is COMPLEX*16 array, dimension (LDU1,P). on entry: a P-by-P matrix. on exit: U1 is postmultiplied by the left singular vector matrix common to [ B11 ; 0 ] and [ B12 0 0 ; 0 -I 0 0 ]. πŸ¦‹
  • LDU1 β€” LDU1 is INTEGER. the leading dimension of the array U1, LDU1 >= MAX(1,P).
  • U2 β€” U2 is COMPLEX*16 array, dimension (LDU2,M-P). on entry: an (M-P)-by-(M-P) matrix. on exit: U2 is postmultiplied by the left singular vector matrix common to [ B21 ; 0 ] and [ B22 0 0 ; 0 0 I ].
  • LDU2 β€” LDU2 is INTEGER. the leading dimension of the array U2, LDU2 >= MAX(1,M-P).
  • V1T β€” V1T is COMPLEX*16 array, dimension (LDV1T,Q). on entry: a Q-by-Q matrix. on exit: V1T is premultiplied by the conjugate transpose of the right singular vector matrix common to [ B11 ; 0 ] and [ B21 ; 0 ].
  • LDV1T β€” LDV1T is INTEGER. the leading dimension of the array V1T, LDV1T >= MAX(1,Q).
  • V2T β€” V2T is COMPLEX*16 array, dimension (LDV2T,M-Q). on entry: an (M-Q)-by-(M-Q) matrix. on exit: V2T is premultiplied by the conjugate transpose of the right singular vector matrix common to [ B12 0 0 ; 0 -I 0 ] and [ B22 0 0 ; 0 0 I ].
  • LDV2T β€” LDV2T is INTEGER. the leading dimension of the array V2T, LDV2T >= MAX(1,M-Q).
  • B11D β€” B11D is DOUBLE PRECISION array, dimension (Q). when ZBBCSD converges, B11D contains the cosines of THETA(1), ..., THETA(Q). if ZBBCSD fails to converge, then B11D contains the diagonal of the partially reduced top-left block. πŸ“
  • B11E β€” B11E is DOUBLE PRECISION array, dimension (Q-1). when ZBBCSD converges, B11E contains zeros. if ZBBCSD fails to converge, then B11E contains the superdiagonal of the partially reduced top-left block.
  • B12D β€” B12D is DOUBLE PRECISION array, dimension (Q). when ZBBCSD converges, B12D contains the negative sines of THETA(1), ..., THETA(Q). if ZBBCSD fails to converge, then B12D contains the diagonal of the partially reduced top-right block.
  • B12E β€” B12E is DOUBLE PRECISION array, dimension (Q-1). when ZBBCSD converges, B12E contains zeros. if ZBBCSD fails to converge, then B12E contains the subdiagonal of the partially reduced top-right block.
  • B21D β€” B21D is DOUBLE PRECISION array, dimension (Q). when ZBBCSD converges, B21D contains the negative sines of THETA(1), ..., THETA(Q). if ZBBCSD fails to converge, then B21D contains the diagonal of the partially reduced bottom-left block.
  • B21E β€” B21E is DOUBLE PRECISION array, dimension (Q-1). when ZBBCSD converges, B21E contains zeros. if ZBBCSD fails to converge, then B21E contains the subdiagonal of the partially reduced bottom-left block.
  • B22D β€” B22D is DOUBLE PRECISION array, dimension (Q). when ZBBCSD converges, B22D contains the negative sines of THETA(1), ..., THETA(Q). if ZBBCSD fails to converge, then B22D contains the diagonal of the partially reduced bottom-right block.
  • B22E β€” B22E is DOUBLE PRECISION array, dimension (Q-1). when ZBBCSD converges, B22E contains zeros. if ZBBCSD fails to converge, then B22E contains the subdiagonal of the partially reduced bottom-right block.
  • RWORK β€” RWORK is DOUBLE PRECISION array, dimension (MAX(1,LRWORK)). on exit, if INFO = 0, RWORK(1) returns the optimal LRWORK. 🧚
  • LRWORK β€” LRWORK is INTEGER. the dimension of the array RWORK. LRWORK >= MAX(1,8*Q). if LRWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the RWORK array, returns this value as the first entry of the work array, and no error message related to LRWORK is issued by XERBLA. so like, -1 is the "just tell me how much room I need" mode πŸ’«
  • INFO β€” INFO is INTEGER.
    • = 0: successful exit. slay πŸŽ‰
    • < 0: if INFO = -i, the i-th argument had an illegal value. you gave it something cursed πŸ’€
    • > 0: if ZBBCSD did not converge, INFO specifies the number of nonzero entries in PHI, and B11D, B11E, etc., contain the partially reduced matrix. she tried, bestie 😭

πŸ’œ Internal Parameters

  • TOLMUL β€” DOUBLE PRECISION, default = MAX(10,MIN(100,EPS**(-1/8))). TOLMUL controls the convergence criterion of the QR loop. angles THETA(i), PHI(i) are rounded to 0 or PI/2 when they are within TOLMUL*EPS of either bound. so it's basically the "close enough, call it zero" slider 🎚️✨

🌈 References

  1. Brian D. Sutton. Computing the complete CS decomposition. Numer. Algorithms, 50(1):33-65, 2009. citation game strong fr fr πŸ“š

πŸŽ€ Author

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

Definition at line 328 of file zbbcsd.f. πŸ‘‘


⭐ Author

Generated automatically by Doxygen for LAPACK from the source code.


okay that's the whole page, you ate that πŸ’… no notes. this doc got spat out by Doxygen for LAPACK Version 3.12.0, and the page itself is SRC/zbbcsd.f(3) β€” mwah, go decompose something unitary πŸ«ΆπŸ’–πŸŒΈ

πŸ“¦ where this page comes from