scipy.linalg.eig

scipy.linalg.eig(a, b=None, left=False, right=True, overwrite_a=False, overwrite_b=False)[source]

Solve an ordinary or generalized eigenvalue problem of a square matrix.

Find eigenvalues w and right or left eigenvectors of a general matrix:

a   vr[:,i] = w[i]        b   vr[:,i]
a.H vl[:,i] = w[i].conj() b.H vl[:,i]

where .H is the Hermitian conjugation.

Parameters :

a : array_like, shape (M, M)

A complex or real matrix whose eigenvalues and eigenvectors will be computed.

b : array_like, shape (M, M), optional

Right-hand side matrix in a generalized eigenvalue problem. Default is None, identity matrix is assumed.

left : bool, optional

Whether to calculate and return left eigenvectors. Default is False.

right : bool, optional

Whether to calculate and return right eigenvectors. Default is True.

overwrite_a : bool, optional

Whether to overwrite a; may improve performance. Default is False.

overwrite_b : bool, optional

Whether to overwrite b; may improve performance. Default is False.

Returns :

w : double or complex ndarray

The eigenvalues, each repeated according to its multiplicity. Of shape (M,).

vl : double or complex ndarray

The normalized left eigenvector corresponding to the eigenvalue w[i] is the column v[:,i]. Only returned if left=True. Of shape (M, M).

vr : double or complex array

The normalized right eigenvector corresponding to the eigenvalue w[i] is the column vr[:,i]. Only returned if right=True. Of shape (M, M).

Raises :

LinAlgError :

If eigenvalue computation does not converge.

See also

eigh
Eigenvalues and right eigenvectors for symmetric/Hermitian arrays.

Previous topic

scipy.linalg.triu

Next topic

scipy.linalg.eigvals