{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $A$ be an $n \\times n$ real [[matrix|0VD9ZSWWJG]].\nThe (unshifted) *QR algorithm* builds a sequence of matrices $A_0, A_1, A_2, \\ldots$ as follows.\n\n1. Set $A_0 = A$.\n2. For $k \\ge 0$, compute a [[QR decomposition|0ERWG4NXQ9]] $A_k = Q_k R_k$, with $Q_k$ an [[orthogonal matrix|0W02QESPJQ]] and $R_k$ [[upper triangular|0N4XY7Z3NN]].\n3. Set $A_{k+1} = R_k Q_k$.\n\nThe same definition applies to complex matrices with unitary $Q_k$.\n\n## Remarks\n\nSince $R_k = Q_k^T A_k$, one has $A_{k+1} = Q_k^T A_k Q_k$, so every $A_k$ is [[similar|0E89HQATM8]] to $A$ and has the same [[eigenvalues|0BQAA2BK3Q]].\nSuppose the eigenvalues of $A$ have pairwise distinct absolute values, and a mild condition on the eigenvectors holds.\nThen the entries of $A_k$ below the diagonal tend to $0$, and the diagonal entries tend to the eigenvalues.\nExample: for $A = \\begin{pmatrix} 2 \u0026 1 \\\\ 1 \u0026 2 \\end{pmatrix}$, $Q_0 = \\tfrac{1}{\\sqrt5}\\begin{pmatrix} 2 \u0026 -1 \\\\ 1 \u0026 2 \\end{pmatrix}$ and $R_0 = \\tfrac{1}{\\sqrt5}\\begin{pmatrix} 5 \u0026 4 \\\\ 0 \u0026 3 \\end{pmatrix}$.\nSo $A_1 = R_0 Q_0 = \\tfrac15 \\begin{pmatrix} 14 \u0026 3 \\\\ 3 \u0026 6 \\end{pmatrix}$; the trace stays $4$ and the off-diagonal entry drops from $1$ to $0.6$.\nNon-example of convergence: for the rotation $A = \\begin{pmatrix} 0 \u0026 -1 \\\\ 1 \u0026 0 \\end{pmatrix}$, which is orthogonal, one may take $Q_0 = A$, $R_0 = I$, so $A_1 = A$ and the sequence is constant; its eigenvalues $\\pm i$ have equal absolute value.\nPractical versions first reduce $A$ to [[Hessenberg form|YCEEWJTX56]], use shifts $A_k - \\sigma_k I = Q_k R_k$, $A_{k+1} = R_k Q_k + \\sigma_k I$, and split off converged eigenvalues.\nThe algorithm was found independently by John G. F. Francis and Vera Kublanovskaya around 1960.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "B6F8YWHYZ5",
    "kind": "definition",
    "msc": [
      "65F15",
      "15A18",
      "15A23"
    ],
    "name": "QR algorithm",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/QR_algorithm"
      }
    ],
    "tag": "6GVPDQMBN7",
    "uses": [
      "0VD9ZSWWJG",
      "0ERWG4NXQ9",
      "0W02QESPJQ",
      "0N4XY7Z3NN",
      "0E89HQATM8",
      "0BQAA2BK3Q"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/6GVPDQMBN7/",
  "links": [
    {
      "field": "defines",
      "target": "B6F8YWHYZ5"
    },
    {
      "field": "uses",
      "target": "0VD9ZSWWJG"
    },
    {
      "field": "uses",
      "target": "0ERWG4NXQ9"
    },
    {
      "field": "uses",
      "target": "0W02QESPJQ"
    },
    {
      "field": "uses",
      "target": "0N4XY7Z3NN"
    },
    {
      "field": "uses",
      "target": "0E89HQATM8"
    },
    {
      "field": "uses",
      "target": "0BQAA2BK3Q"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/6GVPDQMBN7.md",
  "msc": [
    "65F15",
    "15A18",
    "15A23"
  ],
  "name": "QR algorithm",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/6GV/6GVPDQMBN7.md",
  "status": null,
  "tag": "6GVPDQMBN7",
  "uri": "m2://6GVPDQMBN7",
  "url": "https://math2.tamnd.com/wiki/qr-algorithm-definition/",
  "writing": {
    "tag": "6GVPDQMBN7",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
