{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This function is a wrapper to the ARPACK "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " SSEUPD and DSEUPD functions which use the Implicitly Restarted Lanczos Method to find the eigenvalues and eigenvectors "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "2"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "",
              "annotation": "ArpackNoConvergence",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "When the requested convergence is not obtained."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The currently converged eigenvalues and eigenvectors can be found as "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "eigenvalues"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "eigenvectors"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " attributes of the exception object."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "w",
              "annotation": "array",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Array of k eigenvalues."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "v",
              "annotation": "array",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "An array representing the "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "k"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " eigenvectors.  The column "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "v[:, i]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is the eigenvector corresponding to the eigenvalue "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "w[i]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Find k eigenvalues and eigenvectors of the real symmetric square matrix or complex Hermitian matrix A."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "A",
              "annotation": "ndarray, sparse matrix or LinearOperator",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "A square operator representing the operation "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "A @ x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", where "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "A"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is real symmetric or complex Hermitian. For buckling mode (see below) "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "A"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " must additionally be positive-definite."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "k",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The number of eigenvalues and eigenvectors desired. "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "k"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " must be smaller than N. It is not possible to compute all eigenvectors of a matrix."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Solves "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "A @ x[i] = w[i] * x[i]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the standard eigenvalue problem for w[i] eigenvalues with corresponding eigenvectors x[i]."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If M is specified, solves "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "A @ x[i] = w[i] * M @ x[i]"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the generalized eigenvalue problem for w[i] eigenvalues with corresponding eigenvectors x[i]."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Note that there is no specialized routine for the case when A is a complex Hermitian matrix. In this case, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "eigsh()"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " will call "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "eigs()"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and return the real parts of the eigenvalues thus obtained."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "M",
              "annotation": "An N x N matrix, array, sparse matrix, or linear operator representing",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "the operation "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "M @ x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for the generalized eigenvalue problem"
                    }
                  ]
                },
                {
                  "__type": "Blockquote",
                  "__tag": 4059,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "A @ x = w * M @ x."
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "M must represent a real symmetric matrix if A is real, and must represent a complex Hermitian matrix if A is complex. For best results, the data type of M should be the same as that of A. Additionally:"
                    }
                  ]
                },
                {
                  "__type": "Blockquote",
                  "__tag": 4059,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "If sigma is None, M is symmetric positive definite."
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "If sigma is specified, M is symmetric positive semi-definite."
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "In buckling mode, M is symmetric indefinite."
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If sigma is None, eigsh requires an operator to compute the solution of the linear equation "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "M @ x = b"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". This is done internally via a (sparse) LU decomposition for an explicit matrix M, or via an iterative solver for a general linear operator.  Alternatively, the user can supply the matrix or operator Minv, which gives "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x = Minv @ b = M^-1 @ b"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "sigma",
              "annotation": "real",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Find eigenvalues near sigma using shift-invert mode.  This requires an operator to compute the solution of the linear system "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "[A - sigma * M] x = b"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", where M is the identity matrix if unspecified.  This is computed internally via a (sparse) LU decomposition for explicit matrices A & M, or via an iterative solver if either A or M is a general linear operator. Alternatively, the user can supply the matrix or operator "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "OPinv"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", which gives "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x = OPinv @ b = [A - sigma * M]^-1 @ b"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Regardless of the selected mode (normal, cayley, or buckling), "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "OPinv"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " should always be supplied as "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "OPinv = [A - sigma * M]^-1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Note that when sigma is specified, the keyword 'which' refers to the shifted eigenvalues "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "w'[i]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " where:"
                    }
                  ]
                },
                {
                  "__type": "Blockquote",
                  "__tag": 4059,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "if "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "mode == 'normal'"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ": "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "w'[i] = 1 / (w[i] - sigma)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "."
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "if "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "mode == 'cayley'"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ":  "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "w'[i] = (w[i] + sigma) / (w[i] - sigma)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "."
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "if "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "mode == 'buckling'"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": ": "
                        },
                        {
                          "__type": "InlineCode",
                          "__tag": 4051,
                          "value": "w'[i] = w[i] / (w[i] - sigma)"
                        },
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "."
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "(see further discussion in 'mode' below)"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "v0",
              "annotation": "ndarray, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Starting vector for iteration. Default: random"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "ncv",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The number of Lanczos vectors generated ncv must be greater than k and smaller than n; it is recommended that "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "ncv > 2*k"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Default: "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "min(n, max(2*k + 1, 20))"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "which",
              "annotation": "str ['LM' | 'SM' | 'LA' | 'SA' | 'BE']",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If A is a complex Hermitian matrix, 'BE' is invalid. Which "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "k"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " eigenvectors and eigenvalues to find:"
                    }
                  ]
                },
                {
                  "__type": "Blockquote",
                  "__tag": 4059,
                  "children": [
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "'LM'Largest (in magnitude) eigenvalues."
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "'SM'Smallest (in magnitude) eigenvalues."
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "'LA'Largest (algebraic) eigenvalues."
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "'SA'Smallest (algebraic) eigenvalues."
                        }
                      ]
                    },
                    {
                      "__type": "Paragraph",
                      "__tag": 4045,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "'BE'Half (k/2) from each end of the spectrum."
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "When k is odd, return one more (k/2+1) from the high end. When sigma != None, 'which' refers to the shifted eigenvalues "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "w'[i]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (see discussion in 'sigma', above).  ARPACK is generally better at finding large values than small values.  If small eigenvalues are desired, consider using shift-invert mode for better performance."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "maxiter",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Maximum number of Arnoldi update iterations allowed. Default: "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "n*10"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "tol",
              "annotation": "float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Relative accuracy for eigenvalues (stopping criterion). The default value of 0 implies machine precision."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "Minv",
              "annotation": "N x N matrix, array, sparse matrix, or LinearOperator",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "See notes in M, above."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "OPinv",
              "annotation": "N x N matrix, array, sparse matrix, or LinearOperator",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "See notes in sigma, above."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "return_eigenvectors",
              "annotation": "bool",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Return eigenvectors (True) in addition to eigenvalues. This value determines the order in which eigenvalues are sorted. The sort order is also dependent on the "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "which"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " variable."
                    }
                  ]
                },
                {
                  "__type": "Blockquote",
                  "__tag": 4059,
                  "children": [
                    {
                      "__type": "DefList",
                      "__tag": 4033,
                      "children": [
                        {
                          "__type": "DefListItem",
                          "__tag": 4037,
                          "dt": {
                            "__type": "Paragraph",
                            "__tag": 4045,
                            "children": [
                              {
                                "__type": "Text",
                                "__tag": 4046,
                                "value": "For which = 'LM' or 'SA':"
                              }
                            ]
                          },
                          "dd": [
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "If "
                                },
                                {
                                  "__type": "ParamRef",
                                  "__tag": 4071,
                                  "name": "return_eigenvectors"
                                },
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": " is True, eigenvalues are sorted by         algebraic value."
                                }
                              ]
                            },
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "If "
                                },
                                {
                                  "__type": "ParamRef",
                                  "__tag": 4071,
                                  "name": "return_eigenvectors"
                                },
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": " is False, eigenvalues are sorted by         absolute value."
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "__type": "DefListItem",
                          "__tag": 4037,
                          "dt": {
                            "__type": "Paragraph",
                            "__tag": 4045,
                            "children": [
                              {
                                "__type": "Text",
                                "__tag": 4046,
                                "value": "For which = 'BE' or 'LA':"
                              }
                            ]
                          },
                          "dd": [
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "eigenvalues are always sorted by algebraic value."
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "__type": "DefListItem",
                          "__tag": 4037,
                          "dt": {
                            "__type": "Paragraph",
                            "__tag": 4045,
                            "children": [
                              {
                                "__type": "Text",
                                "__tag": 4046,
                                "value": "For which = 'SM':"
                              }
                            ]
                          },
                          "dd": [
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "If "
                                },
                                {
                                  "__type": "ParamRef",
                                  "__tag": 4071,
                                  "name": "return_eigenvectors"
                                },
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": " is True, eigenvalues are sorted by         algebraic value."
                                }
                              ]
                            },
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "If "
                                },
                                {
                                  "__type": "ParamRef",
                                  "__tag": 4071,
                                  "name": "return_eigenvectors"
                                },
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": " is False, eigenvalues are sorted by         decreasing absolute value."
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "mode",
              "annotation": "string ['normal' | 'buckling' | 'cayley']",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Specify strategy to use for shift-invert mode.  This argument applies only for real-valued A and sigma != None.  For shift-invert mode, ARPACK internally solves the eigenvalue problem "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "OP @ x'[i] = w'[i] * B @ x'[i]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and transforms the resulting Ritz vectors x'[i] and Ritz values w'[i] into the desired eigenvectors and eigenvalues of the problem "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "A @ x[i] = w[i] * M @ x[i]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". The modes are as follows:"
                    }
                  ]
                },
                {
                  "__type": "Blockquote",
                  "__tag": 4059,
                  "children": [
                    {
                      "__type": "DefList",
                      "__tag": 4033,
                      "children": [
                        {
                          "__type": "DefListItem",
                          "__tag": 4037,
                          "dt": {
                            "__type": "Paragraph",
                            "__tag": 4045,
                            "children": [
                              {
                                "__type": "Text",
                                "__tag": 4046,
                                "value": "'normal' :"
                              }
                            ]
                          },
                          "dd": [
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "OP = [A - sigma * M]^-1 @ M,         B = M,         w'[i] = 1 / (w[i] - sigma)"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "__type": "DefListItem",
                          "__tag": 4037,
                          "dt": {
                            "__type": "Paragraph",
                            "__tag": 4045,
                            "children": [
                              {
                                "__type": "Text",
                                "__tag": 4046,
                                "value": "'buckling' :"
                              }
                            ]
                          },
                          "dd": [
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "OP = [A - sigma * M]^-1 @ A,         B = A,         w'[i] = w[i] / (w[i] - sigma)"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "__type": "DefListItem",
                          "__tag": 4037,
                          "dt": {
                            "__type": "Paragraph",
                            "__tag": 4045,
                            "children": [
                              {
                                "__type": "Text",
                                "__tag": 4046,
                                "value": "'cayley' :"
                              }
                            ]
                          },
                          "dd": [
                            {
                              "__type": "Paragraph",
                              "__tag": 4045,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "OP = [A - sigma * M]^-1 @ [A + sigma * M],         B = M,         w'[i] = (w[i] + sigma) / (w[i] - sigma)"
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The choice of mode will affect which eigenvalues are selected by the keyword 'which', and can also impact the stability of convergence (see [2] for a discussion)."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "rng",
              "annotation": "`numpy.random.Generator`, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Pseudorandom number generator state. When "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "rng"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is None, a new "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "numpy.random.Generator",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "numpy",
                        "version": "*",
                        "kind": "api",
                        "path": "numpy.random._generator:Generator"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is created using entropy from the operating system. Types other than "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "numpy.random.Generator",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "numpy",
                        "version": "*",
                        "kind": "api",
                        "path": "numpy.random._generator:Generator"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " are passed to "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "numpy.random.default_rng",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "numpy",
                        "version": "*",
                        "kind": "api",
                        "path": "numpy.random:default_rng"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " to instantiate a "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "Generator"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/sparse/linalg/_eigen/arpack/arpack.py",
  "item_line": 1434,
  "item_type": "function",
  "aliases": [
    "scipy.sparse.linalg.eigsh"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nfrom scipy.sparse.linalg import eigsh\nidentity = np.eye(13)\neigenvalues, eigenvectors = eigsh(identity, k=6)\neigenvalues\neigenvectors.shape\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "eigs",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.sparse.linalg._eigen.arpack.arpack:eigs"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "eigenvalues and eigenvectors for a general (nonsymmetric) matrix A"
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "svds",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.sparse.linalg._eigen._svds:svds"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "singular value decomposition for a matrix A"
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "A",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "k",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "6"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "M",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "sigma",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "which",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "LM"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "v0",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "ncv",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "maxiter",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "tol",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "0"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "return_eigenvectors",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "True"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "Minv",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "OPinv",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "mode",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "normal"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "rng",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "eigsh"
  },
  "references": [
    ".. [1] ARPACK Software, https://github.com/opencollab/arpack-ng",
    ".. [2] R. B. Lehoucq, D. C. Sorensen, and C. Yang,  ARPACK USERS GUIDE:",
    "   Solution of Large Scale Eigenvalue Problems by Implicitly Restarted",
    "   Arnoldi Methods. SIAM, Philadelphia, PA, 1998."
  ],
  "qa": "scipy.sparse.linalg._eigen.arpack.arpack:eigsh",
  "arbitrary": [],
  "local_refs": [
    "A",
    "M",
    "Minv",
    "OPinv",
    "k",
    "maxiter",
    "mode",
    "ncv",
    "return_eigenvectors",
    "rng",
    "sigma",
    "tol",
    "v",
    "v0",
    "w",
    "which"
  ]
}