Get Math Help

GET TUTORING NEAR ME!

(800) 434-2582

By submitting the following form, you agree to Club Z!'s Terms of Use and Privacy Policy

    Home / Get Math Help

    QR Decomposition

    Usage

    QRDecomposition[m] yields the QR decomposition for a numerical matrix m. The result is a list {q, r}, where q is a unitary matrix and r is an upper-triangular matrix.

    Basic examples

    The decomposition of a 2×2 matrix into a unitary (orthogonal) matrix q and upper triangular matrix r:
In[1]:=m=(1 | 2
3 | 4);
{q, r}=QRDecomposition[m];
{q//MatrixForm, r//MatrixForm}
Out[1]={(1/sqrt(10) | 3/sqrt(10)
3/sqrt(10) | -1/sqrt(10)), (sqrt(10) | 7 sqrt(2/5)
0 | sqrt(2/5))}
Verify that m = q^†.r:
In[2]:=m==ConjugateTranspose[q].r
Out[2]=True
Compute the QR decomposition for a 3×2 matrix with exact values:
In[1]:={q, r}=QRDecomposition[(1 | 2
3 | 4
5 | 6)];
{q//MatrixForm, r//MatrixForm}
Out[1]={(1/sqrt(35) | 3/sqrt(35) | sqrt(5/7)
13/sqrt(210) | 2 sqrt(2/105) | -sqrt(5/42)), (sqrt(35) | 44/sqrt(35)
0 | 2 sqrt(6/35))}
q^T.r is the original matrix:
In[2]:=Transpose[q].r//MatrixForm
Out[2]=(1 | 2
3 | 4
5 | 6)
Compute the QR decomposition for a 2×3 matrix with approximate numerical values:
In[1]:={q, r}=QRDecomposition[(1. | 2. | 3.
4. | 5. | 6.)];
{q//MatrixForm, r//MatrixForm}
Out[1]={(-0.242536 | -0.970143
-0.970143 | 0.242536), (-4.12311 | -5.33578 | -6.54846
0. | -0.727607 | -1.45521)}
q^T.r is the original matrix:
In[2]:=Transpose[q].r//MatrixForm
Out[2]=(1. | 2. | 3.
4. | 5. | 6.)

    Options

    Pivoting | TargetStructure

    Relationships with other entities

    SchurDecomposition | LUDecomposition | SingularValueDecomposition | JordanDecomposition | CholeskyDecomposition | HessenbergDecomposition | Orthogonalize

    Relationships with other entities

    History

    introduced in Version 2 (January 1991)
last modified in Version 14 (December 2023)

    Back to List | POWERED BY THE WOLFRAM LANGUAGE