bundles / scipy 1.17.1 / scipy / linalg / _decomp / eigvals
function
scipy.linalg._decomp:eigvals
source: /scipy/linalg/_decomp.py :841
Signature
def eigvals ( a , b = None , overwrite_a = False , check_finite = True , homogeneous_eigvals = False ) Summary
Compute eigenvalues from an ordinary or generalized eigenvalue problem.
Extended Summary
Find eigenvalues of a general matrix
a vr[:,i] = w[i] b vr[:,i]The documentation is written assuming array arguments are of specified "core" shapes. However, array argument(s) of this function may have additional "batch" dimensions prepended to the core shape. In this case, the array is treated as a batch of lower-dimensional slices; see linalg_batch for details. Note that calls with zero-size batches are unsupported and will raise a ValueError.
Parameters
a: (M, M) array_likeA complex or real matrix whose eigenvalues and eigenvectors will be computed.
b: (M, M) array_like, optionalRight-hand side matrix in a generalized eigenvalue problem. If omitted, identity matrix is assumed.
overwrite_a: bool, optionalWhether to overwrite data in a (may improve performance)
check_finite: bool, optionalWhether 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.
homogeneous_eigvals: bool, optionalIf True, return the eigenvalues in homogeneous coordinates. In this case
wis a (2, M) array so thatw[1,i] a vr[:,i] = w[0,i] b vr[:,i]Default is False.
Returns
w: (M,) or (2, M) double or complex ndarrayThe eigenvalues, each repeated according to its multiplicity but not in any specific order. The shape is (M,) unless
homogeneous_eigvals=True.
Raises
: LinAlgErrorIf eigenvalue computation does not converge
Examples
import numpy as np from scipy import linalg a = np.array([[0., -1.], [1., 0.]]) linalg.eigvals(a)✓
b = np.array([[0., 1.], [1., 1.]]) linalg.eigvals(a, b)✓
a = np.array([[3., 0., 0.], [0., 8., 0.], [0., 0., 7.]]) linalg.eigvals(a, homogeneous_eigvals=True)✓
See also
- eig
eigenvalues and right eigenvectors of general arrays.
- eigvals_banded
eigenvalues for symmetric/Hermitian band matrices
- eigvalsh
eigenvalues of symmetric or Hermitian arrays
- eigvalsh_tridiagonal
eigenvalues of symmetric/Hermitian tridiagonal matrices
Aliases
-
scipy.linalg.eigvals