# Efficient and stable QR factorization of partially orthonormal matrix

Let $$U \in \mathbb{C}^{m \times n_U}$$ be an orthonormal matrix, let $$A \in \mathbb{C}^{m \times n_A}$$, and $$m \geq n_U + n_A$$. I want to compute a QR factorization $$X = \left[U A\right] = QR$$, with $$Q \in \mathbb{C}^{m \times (n_U + n_A)}$$ and $$R \in \mathbb{C}^{(n_U+n_A) \times (n_U+n_A)}$$, taking advantage of the orthonormality of $$U$$.

I am concerned with numerical stability and efficiency. I don't want to just project out $$U$$ from $$A$$ and QR the residual because that is equivalent to classical Gram-Schmidt using the basis $$U$$ on each column of $$A$$. Is there a way to do this in LAPACK without resorting to a full-size QR of $$X$$?

Just a long-comment sketched answer. Projecting out $$U$$ from $$A$$ and QR the residual is not equivalent to classical Gram-Schmidt, I think. You apply orthogonal transformations from the left, not triangular transformations from the right. In particular, because you apply orthogonal transformations, it should be backward stable.
• Let's verify this. Let $\tilde{A}=A - U (U^H A)$. Let $\tilde{a}_j$ be the $j$th column of $\tilde{A}$. Then $\tilde{a}_j = a_j - \sum_{i} (u_i^H a_j) u_i$. Is that not CGS? The inner product in the $i$th element of the sum is computed against the original vector $a_j$ rather than the result of projecting out the previous $u_i$'s as would be done in modified GS. Aug 21, 2022 at 10:56
• I must admit that the details of the numericali issues in CGS are not 100% clear to me either. But to me it seems that this is no more similar to CGS than MGS, since the $u_i$ are unchanged by the orthogonalization process. This should show that the angles between $U$ and $\hat{A}$ stay small, which (if I understand correctly) is the concern here. Aug 22, 2022 at 7:11