Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

In this chapter we focus on algorithms for computing a QR factorization of a tall matrix ARn×d\vec{A}\in\R^{n\times d}, where ndn\gg d.

Classical methods

Classical algorithms for computing the QR factorization, such as the LAPACK methods underlying np.linalg.qr, are typically based on Householder reflections or Givens rotations. These algorithms are numerically stable and run in O(nd2)O(nd^2) operations. However, these algorithms are inherently sequential, leading to relatively low flop-rates on modern hardware. The algorithms presented in this chapter address this shortcoming.

Other factorizations

Many of the ideas we discuss in this chapter can be used to compute other factorizations. For instance to compute a singular value decomposition (SVD), simply compute an SVD R=UΣVT\vec{R} = \vec{U}' \vec{\Sigma} \vec{V}^\T and then set U=QU\vec{U} = \vec{Q} \vec{U}' to obtain an SVD A=UΣVT\vec{A} = \vec{U} \vec{\Sigma} \vec{V}^\T.

This may be relevant for computing the matrix-sign function, which is used in the Muon optimizer Jordan et al., 2024 for training LLMs; see also Appendix F in Amsel et al., 2025.

Further Reading

References
  1. Jordan, K., Jin, Y., Boza, V., You, J., Cesista, F., Newhouse, L., & Bernstein, J. (2024). Muon: An optimizer for hidden layers in neural networks. https://kellerjordan.github.io/posts/muon/
  2. Amsel, N., Persson, D., Musco, C., & Gower, R. M. (2025). The Polar Express: Optimal Matrix Sign Methods and Their Application to the Muon Algorithm. https://arxiv.org/abs/2505.16932
  3. Epperly, E. (2024). Neat Randomized Algorithms: Randomized Cholesky QR. https://www.ethanepperly.com/index.php/2024/06/25/neat-randomized-algorithms-randomized-cholesky-qr/
  4. Fan, Y., Guo, Y., Ying, L., & Lin, L. (2021). A Novel Randomized XR-Based Preconditioned CholeskyQR Algorithm. https://arxiv.org/abs/2111.11148
  5. Balabanov, O. (2022). Randomized Cholesky QR factorizations. https://arxiv.org/abs/2210.09953
  6. Higgins, Y., Pearson, K., Armstrong, R., Costa, T. S., & Erichson, N. B. (2023). Analysis of Randomized Householder-Cholesky QR Factorization with Multisketching. https://arxiv.org/abs/2309.05868
  7. Melnichenko, M., Balabanov, O., Murray, R., Demmel, J., Mahoney, M. W., & Luszczek, P. (2025). CholeskyQR with Randomization and Pivoting for Tall Matrices (CQRRPT). In SIAM Journal on Matrix Analysis and Applications (Vol. 46, pp. 1701–1734). Society for Industrial & Applied Mathematics (SIAM). 10.1137/24m163712x
  8. de Damas, J.-G., Grigori, L., Simunec, I., & Timsit, E. (2025). Randomized orthogonalization and Krylov subspace methods: principles and algorithms. https://arxiv.org/abs/2512.15455