# Scipy QZ documentation

The scipy.linalg.qz function implements generalized Schur decomposition for a pair of matrices A, B such that (A, B) = (Q @ AA @ Z*, Q @ BB @ Z*), where AA is quasi upper triangular and BB is upper triangular. The documentation says for the matrix AA "1x1 blocks correspond to real generalized eigenvalues and 2x2 blocks are ‘standardized’ by making the corresponding elements of BB have the form: [[a 0], [0, b]]". I was wondering if someone is aware of how this standardization is done?

• Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
– Community Bot
Commented Sep 20, 2022 at 16:57
• This is a wrapper for the LAPACK routine CGGES. Have you looked at the LAPACK user's guide and LAPACK Working Notes for more information about the algorithm used by this routine? Commented Sep 20, 2022 at 16:58

$$(A,B) = \left(\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}, \begin{bmatrix} b_{11} & b_{12} \\ 0 & b_{22} \end{bmatrix} \right)$$
Then an SVD is calculated of $$B$$. Because it is a 2x2 upper triangular matrix, this can be done using 2 Givens rotations (see dlasv2) and optionally some sign inversions to give: $$UBV = D$$, where $$D$$ is diagonal with positive elements.
Then the final standardized block is $$U(A,B)V$$.