ite data in ``a`` (may improve performance). Default is False. overwrite_b : bool, optional Whether to overwrite data in ``b`` (may improve performance). Default is False. check_finite : bool, optional Whether to check that the input matrices contain only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs. turbo : bool, optional, deprecated .. deprecated:: 1.5.0 `eigh` keyword argument `turbo` is deprecated in favour of ``driver=gvd`` keyword instead and will be removed in SciPy 1.12.0. eigvals : tuple (lo, hi), optional, deprecated .. deprecated:: 1.5.0 `eigh` keyword argument `eigvals` is deprecated in favour of `subset_by_index` keyword instead and will be removed in SciPy 1.12.0. Returns ------- w : (N,) ndarray The N (1<=N<=M) selected eigenvalues, in ascending order, each repeated according to its multiplicity. v : (M, N) ndarray (if ``eigvals_only == False``) Raises ------ LinAlgError If eigenvalue computation does not converge, an error occurred, or b matrix is not definite positive. Note that if input matrices are not symmetric or Hermitian, no error will be reported but results will be wrong. See Also -------- eigvalsh : eigenvalues of symmetric or Hermitian arrays eig : eigenvalues and right eigenvectors for non-symmetric arrays eigh_tridiagonal : eigenvalues and right eiegenvectors for symmetric/Hermitian tridiagonal matrices Notes ----- This function does not check the input array for being Hermitian/symmetric in order to allow for representing arrays with only their upper/lower triangular parts. Also, note that even though not taken into account, finiteness check applies to the whole array and unaffected by "lower" keyword. This function uses LAPACK drivers for computations in all possible keyword combinations, prefixed with ``sy`` if arrays are real and ``he`` if complex, e.g., a float array with "evr" driver is solved via "syevr", complex arrays with "gvx" driver problem is solved via "hegvx" etc. As a brief summary, the slowest and the most robust driver is the classical ``ev`` which uses symmetric QR. ``evr`` is seen as the optimal choice for the most general cases. However, there are certain occasions that ``evd`` computes faster at the expense of more memory usage. ``evx``, while still being faster than ``ev``, often performs worse than the rest except when very few eigenvalues are requested for large arrays though there is still no performance guarantee. For the generalized problem, normalization with respect to the given type argument:: type 1 and 3 : v.conj().T @ a @ v = w type 2 : inv(v).conj().T @ a @ inv(v) = w type 1 or 2 : v.conj().T @ b @ v = I type 3 : v.conj().T @ inv(b) @ v = I Examples -------- >>> import numpy as np >>> from scipy.linalg import eigh >>> A = np.array([[6, 3, 1, 5], [3, 0, 5, 1], [1, 5, 6, 2], [5, 1, 2, 2]]) >>> w, v = eigh(A) >>> np.allclose(A @ v - v @ np.diag(w), np.zeros((4, 4))) True Request only the eigenvalues >>> w = eigh(A, eigvals_only=True) Request eigenvalues that are less than 10. >>> A = np.array([[34, -4, -10, -7, 2], ... [-4, 7, 2, 12, 0], ... [-10, 2, 44, 2, -19], ... [-7, 12, 2, 79, -34], ... [2, 0, -19, -34, 29]]) >>> eigh(A, eigvals_only=True, subset_by_value=[-np.inf, 10]) array([6.69199443e-07, 9.11938152e+00]) Request the second smallest eigenvalue and its eigenvector >>> w, v = eigh(A, subset_by_index=[1, 1]) >>> w array([9.11938152]) >>> v.shape # only a single column is returned (5, 1) zuKeyword argument 'turbo' is deprecated in favour of 'driver=gvd' keyword instead and will be removed in SciPy 1.12.0.re