SRC/zlaev2.f(3)

πŸ’– NAME πŸ’–

SRC/zlaev2.f(3) β€” bestie, this is the manual page for SRC/zlaev2.f, and it's lowkey one of the cutest little subroutines in LAPACK. That page name is SRC/zlaev2.f too, so like… same energy, iykyk πŸŽ€


✨ SYNOPSIS ✨

πŸ¦‹ Functions/Subroutines

  • subroutine zlaev2 (a, b, c, rt1, rt2, cs1, sn1) β€” okay so ZLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. Periodt. That's the whole vibe.

🌸 Function/Subroutine Documentation 🌸

πŸ’… The subroutine itself

subroutine zlaev2 (complex*16 a, complex*16 b, complex*16 c, double
    precision rt1, double precision rt2, double precision cs1, complex*16
    sn1)

ZLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix. Literally that's what it does, and it does it slayfully ✨

πŸŽ€ Purpose:

!>
!> ZLAEV2 computes the eigendecomposition of a 2-by-2 Hermitian matrix
!>    [  A         B  ]
!>    [  CONJG(B)  C  ].
!> On return, RT1 is the eigenvalue of larger absolute value, RT2 is the
!> eigenvalue of smaller absolute value, and (CS1,SN1) is the unit right
!> eigenvector for RT1, giving the decomposition
!>
!> [ CS1  CONJG(SN1) ] [    A     B ] [ CS1 -CONJG(SN1) ] = [ RT1  0  ]
!> [-SN1     CS1     ] [ CONJG(B) C ] [ SN1     CS1     ]   [  0  RT2 ].
!>

So like, RT1 is the eigenvalue with the bigger absolute value, RT2 is the one with the smaller absolute value, and (CS1,SN1) is the unit right eigenvector for RT1. And that whole sandwich of matrices up there? That's the decomposition, and it's giving iconic πŸ‘‘


🌈 Parameters

  • A β€” A is COMPLEX*16. It's the (1,1) element of the 2-by-2 matrix. Front row, bestie 🫢
  • B β€” B is COMPLEX*16. It's the (1,2) element and the conjugate of the (2,1) element of the 2-by-2 matrix. Two jobs, one icon πŸ’…
  • C β€” C is COMPLEX*16. It's the (2,2) element of the 2-by-2 matrix.
  • RT1 β€” RT1 is DOUBLE PRECISION. The eigenvalue of larger absolute value. Main character eigenvalue fr fr ⭐
  • RT2 β€” RT2 is DOUBLE PRECISION. The eigenvalue of smaller absolute value. Still valid, still slaying, just smaller πŸ¦‹
  • CS1 β€” CS1 is DOUBLE PRECISION. (The docs literally just say that, no extra lore, so I'm not gonna invent any πŸ™ˆ)
  • SN1 β€” SN1 is COMPLEX*16. Together, the vector (CS1, SN1) is a unit right eigenvector for RT1. Cute couple, no cap πŸ’œ

πŸ‘‘ Author

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

πŸ”₯ Further Details:

!>
!>  RT1 is accurate to a few ulps barring over/underflow.
!>
!>  RT2 may be inaccurate if there is massive cancellation in the
!>  determinant A*C-B*B; higher precision or correctly rounded or
!>  correctly truncated arithmetic would be needed to compute RT2
!>  accurately in all cases.
!>
!>  CS1 and SN1 are accurate to a few ulps barring over/underflow.
!>
!>  Overflow is possible only if RT1 is within a factor of 5 of overflow.
!>  Underflow is harmless if the input data is 0 or exceeds
!>     underflow_threshold / macheps.
!>
🫢 Real talk though, bestie, read that middle one again: RT2 may be inaccurate if there's massive cancellation in the determinant A*C-B*B. To get RT2 accurate in all cases you'd need higher precision, or correctly rounded arithmetic, or correctly truncated arithmetic. So like… don't come for RT2 when it's off, it's doing its best 😭
πŸ’€ And overflow? Possible only if RT1 is within a factor of 5 of overflow. Underflow is harmless if the input data is 0 or exceeds underflow_threshold / macheps. Not me being dramatic, that's just the facts.

πŸ“ Definition

Definition at line 120 of file zlaev2.f.


🧚 Author (the meta one)

Generated automatically by Doxygen for LAPACK from the source code. So nobody hand-wrote this one, the machine did it and honestly? It ate ✨


LAPACK β€” Version 3.12.0 🌈, and that's the whole page for SRC/zlaev2.f(3) β€” ily, go decompose a Hermitian matrix, and remember: two-by-two is still a real matrix, you're doing amazing πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from