{
  "name": "Eigenvalues returned in the NumPy documentation examples",
  "description": "Worked examples printed on the NumPy reference pages for numpy.linalg.eig and numpy.linalg.eigh, tabulated by input matrix and function, with the eigenvalues the documentation shows and the property each example illustrates. Compiled from the two NumPy reference pages.",
  "page": "https://casrai.org/guides/numpy-linalg-eig",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-14T13:17:05Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Input matrix",
      "unit": "",
      "description": ""
    },
    {
      "name": "Function",
      "unit": "",
      "description": ""
    },
    {
      "name": "Eigenvalues shown",
      "unit": "",
      "description": ""
    },
    {
      "name": "What the example shows",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Input matrix": "np.diag((1, 2, 3))",
      "Function": "numpy.linalg.eig",
      "Eigenvalues shown": "1, 2, 3",
      "What the example shows": "Diagonal input gives the diagonal entries; eigenvectors are the identity columns"
    },
    {
      "Input matrix": "[[1, -1], [1, 1]]",
      "Function": "numpy.linalg.eig",
      "Eigenvalues shown": "1+1j, 1-1j",
      "What the example shows": "A real matrix with a complex-conjugate pair"
    },
    {
      "Input matrix": "[[1, 1j], [-1j, 1]]",
      "Function": "numpy.linalg.eig",
      "Eigenvalues shown": "2+0j, 0+0j",
      "What the example shows": "Complex Hermitian input; eigenvectors may vary"
    },
    {
      "Input matrix": "[[1+1e-9, 0], [0, 1-1e-9]]",
      "Function": "numpy.linalg.eig",
      "Eigenvalues shown": "1, 1",
      "What the example shows": "Round-off: theoretical eigenvalues are 1 +/- 1e-9"
    },
    {
      "Input matrix": "[[1, -2j], [2j, 5]]",
      "Function": "numpy.linalg.eigh",
      "Eigenvalues shown": "0.17157288, 5.82842712",
      "What the example shows": "Hermitian input; real eigenvalues in ascending order"
    }
  ],
  "sources": [
    {
      "title": "NumPy documentation: numpy.linalg.eig",
      "url": "https://numpy.org/doc/stable/reference/generated/numpy.linalg.eig.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "NumPy documentation: numpy.linalg.eigh",
      "url": "https://numpy.org/doc/stable/reference/generated/numpy.linalg.eigh.html",
      "accessed": "2026-11-14"
    }
  ]
}