Linear Algebra Calculators
QR Factorization
This calculator uses Wedderburn rank reduction to find the QR factorization of a matrix $A$. The process constructs the two matrices $Q$ and $R$ in stages. $Q$ is constructed a column at a time while $R$ is constructed a row at a time.
At each stage you'll have an equation $A=QR+B$ where you start with $Q$ and $R$ nonexistent, and with $B=A$. Also note that at each stage after the first $Q^TQ=I$.
- Choose a column $q$ from $B$ as described below.
- Set the row $r=q^T B$.
- Let $\Vert q \Vert$ be the 2-norm of the column $q$.
- The next column of $Q$ is $q/\Vert q\Vert$.
- The next row of $R$ is $r/\Vert q\Vert$.
Eventually $B=0$ and $A=QR$.
At this point (if you've been following the Gram-Schmidt Algorithm) $R$ is upper triangular, and the columns of $Q$ contain an orthonormal basis for the column space of $A$.
If you've been following the Gram-Schmidt Algorithm with Column Pivoting, then $R$ is a (column) permuted upper triangular matrix, and the columns of $Q$ again contain an orthonormal basis (almost certainly different) for the column space of $A$.
- Gram-Schmidt Algorithm
- Choose $q$ to be the first nonzero column of $B$.
- Gram-Schmidt Algorithm with Column Pivoting
- Choose $q$ to be the column of $B$ with the largest 2-norm.
Either choose the number of columns and press this button to get a new matrix, or enter your matrix in the box below. (Look at the example to see the format.)
Matrix $A$:
Select a column number.
Update `Q`, `R` and `B`.
The reset button leaves the `A` matrix alone, but reinitializes `Q`, `R` and `B`.
Back to calculator page or home page.