Calculate the QR decomposition of a matrix. The QR decomposition factors a matrix A into a product A = QR of an orthogonal matrix Q and an upper triangular matrix R.
QR factorization is a fundamental matrix decomposition method in linear algebra. For any matrix A, we can find matrices Q and R such that:
\[ A = QR \]
where:
QR factorization has numerous applications in:
Consider the matrix:
\[ A = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} \]
Its QR factorization would be:
\[ Q = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \]
\[ R = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} \]