{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $A \\in \\R^{n \\times n}$, $n \\ge 2$, be [[symmetric|0VR671PHE5]], and let $\\mathrm{off}(A)^2 = \\sum_{i \\ne j} a_{ij}^2$.\nFor indices $p \u003c q$ with $a_{pq} \\ne 0$, let $J = J(p, q, \\theta)$ be the rotation in the $(p, q)$ coordinate plane, where $\\theta \\in [-\\pi/4, \\pi/4]$ solves $\\cot 2\\theta = (a_{qq} - a_{pp})/(2 a_{pq})$.\nThen $A' = J^T A J$ is symmetric, has the same [[eigenvalues|0BQAA2BK3Q]] as $A$, satisfies $a'_{pq} = 0$, and\n$$\\mathrm{off}(A')^2 = \\mathrm{off}(A)^2 - 2 a_{pq}^2.$$\nThe *classical Jacobi method* chooses at each step a pair $(p, q)$ with $\\abs{a_{pq}}$ maximal among the off-diagonal entries and sets $A_{k+1} = J_k^T A_k J_k$, starting from $A_0 = A$.\nThen\n$$\\mathrm{off}(A_{k+1})^2 \\le \\Bigl( 1 - \\frac{2}{n(n-1)} \\Bigr) \\mathrm{off}(A_k)^2,$$\nso $A_k$ converges to a [[diagonal matrix|044JNC7ZAA]] whose diagonal entries are the eigenvalues of $A$.\n\n## Remarks\n\nThe rotation $J$ is an [[orthogonal matrix|0W02QESPJQ]], so $A'$ is [[similar|0E89HQATM8]] to $A$ and the [[Frobenius norm|JT8Q204E4R]] $\\norm{A'}_F = \\norm{A}_F$ is unchanged.\nOn the $2 \\times 2$ block in rows and columns $p, q$, the choice of $\\theta$ diagonalizes the block.\nSo the sum of squares of that block's diagonal grows by $2 a_{pq}^2$.\nThe other entries in rows and columns $p, q$ are only rotated, so their total square sum does not change.\nIf $\\abs{a_{pq}}$ is maximal among the $n(n-1)$ off-diagonal entries, then $a_{pq}^2 \\ge \\mathrm{off}(A)^2 / (n(n-1))$, which gives the linear bound.\nThe diagonal entries of $A_k$ approach the eigenvalues because each eigenvalue lies within $\\mathrm{off}(A_k)$ of some diagonal entry, by Weyl's inequality.\n\nExample: for $A = \\begin{pmatrix} 2 \u0026 1 \\\\ 1 \u0026 2 \\end{pmatrix}$, $\\cot 2\\theta = 0$ gives $\\theta = \\pi/4$, and one rotation gives $\\mathrm{diag}(1, 3)$.\nIn practice the local convergence is quadratic once the off-diagonal part is small.\nThe product $J_0 J_1 \\cdots J_k$ of the rotations converges to an orthogonal matrix whose columns are eigenvectors.\n\n## Explanations\n\n### L1 human\n\nThe Jacobi method diagonalizes a symmetric matrix by a sequence of plane rotations.\nEach rotation kills one off-diagonal entry; later rotations may make it nonzero again, but the total size of the off-diagonal part always drops.\nAfter enough rotations the matrix is nearly diagonal and the eigenvalues can be read off the diagonal.\n\n### L2 human\n\nThe method dates from Jacobi in 1846 and was revived on early computers.\nIt is slower than the [[QR algorithm|B6F8YWHYZ5]] on a serial computer.\nBut it computes small eigenvalues of well-scaled positive definite matrices to high relative accuracy, and it is easy to parallelize.\nCyclic variants sweep through all pairs in a fixed order instead of searching for the largest entry, and they also converge.\nA one-sided version applied to $A^T A$ implicitly computes the [[singular value decomposition|000NPTMX6J]].\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "HCJ2ETX89Z"
    ],
    "kind": "statement",
    "msc": [
      "65F15"
    ],
    "name": "Jacobi eigenvalue algorithm",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q1677726",
      "wikipedia": "Jacobi eigenvalue algorithm"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Jacobi_eigenvalue_algorithm"
      }
    ],
    "tag": "K3DP7D4JJC",
    "uses": [
      "0VR671PHE5",
      "0W02QESPJQ",
      "0E89HQATM8",
      "044JNC7ZAA",
      "JT8Q204E4R",
      "0BQAA2BK3Q"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/K3DP7D4JJC/",
  "links": [
    {
      "field": "about",
      "target": "HCJ2ETX89Z"
    },
    {
      "field": "uses",
      "target": "0VR671PHE5"
    },
    {
      "field": "uses",
      "target": "0W02QESPJQ"
    },
    {
      "field": "uses",
      "target": "0E89HQATM8"
    },
    {
      "field": "uses",
      "target": "044JNC7ZAA"
    },
    {
      "field": "uses",
      "target": "JT8Q204E4R"
    },
    {
      "field": "uses",
      "target": "0BQAA2BK3Q"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/K3DP7D4JJC.md",
  "msc": [
    "65F15"
  ],
  "name": "Jacobi eigenvalue algorithm",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/K3D/K3DP7D4JJC.md",
  "status": null,
  "tag": "K3DP7D4JJC",
  "uri": "m2://K3DP7D4JJC",
  "url": "https://tamnd.github.io/math2/wiki/jacobi-eigenvalue-algorithm/",
  "writing": {
    "tag": "K3DP7D4JJC",
    "kind": "statement",
    "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
      }
    ]
  }
}
