scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsBackRef
eigh_tridiagonal(d, e, eigvals_only=False, select='a', select_range=None, check_finite=True, tol=0.0, lapack_driver='auto')

Find eigenvalues w and optionally right eigenvectors v of a :

a v[:,i] = w[i] v[:,i]
v.H v    = identity

For a real symmetric matrix a with diagonal elements d and off-diagonal elements e.

Notes

This function makes use of LAPACK S/DSTEMR routines.

Parameters

d : ndarray, shape (ndim,)

The diagonal elements of the array.

e : ndarray, shape (ndim-1,)

The off-diagonal elements of the array.

select : {'a', 'v', 'i'}, optional

Which eigenvalues to calculate

====== ======================================== select calculated ====== ======================================== 'a' All eigenvalues 'v' Eigenvalues in the interval (min, max] 'i' Eigenvalues with indices min <= i <= max ====== ========================================

select_range : (min, max), optional

Range of selected eigenvalues

check_finite : bool, optional

Whether to check that the input matrix contains 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.

tol : float

The absolute tolerance to which each eigenvalue is required (only used when 'stebz' is the :None:None:`lapack_driver`). An eigenvalue (or cluster) is considered to have converged if it lies in an interval of this width. If <= 0. (default), the value eps*|a| is used where eps is the machine precision, and |a| is the 1-norm of the matrix a .

lapack_driver : str

LAPACK function to use, can be 'auto', 'stemr', 'stebz', 'sterf', or 'stev'. When 'auto' (default), it will use 'stemr' if select='a' and 'stebz' otherwise. When 'stebz' is used to find the eigenvalues and eigvals_only=False , then a second LAPACK call (to ?STEIN ) is used to find the corresponding eigenvectors. 'sterf' can only be used when eigvals_only=True and select='a' . 'stev' can only be used when select='a' .

Raises

LinAlgError

If eigenvalue computation does not converge.

Returns

w : (M,) ndarray

The eigenvalues, in ascending order, each repeated according to its multiplicity.

v : (M, M) ndarray

The normalized eigenvector corresponding to the eigenvalue w[i] is the column v[:,i] .

Solve eigenvalue problem for a real symmetric tridiagonal matrix.

See Also

eig

eigenvalues and right eigenvectors for non-symmetric arrays

eig_banded

eigenvalues and right eigenvectors for symmetric/Hermitian band matrices

eigh

eigenvalues and right eigenvectors for symmetric/Hermitian arrays

eigvalsh_tridiagonal

eigenvalues of symmetric/Hermitian tridiagonal matrices

Examples

>>> from scipy.linalg import eigh_tridiagonal
... d = 3*np.ones(4)
... e = -1*np.ones(3)
... w, v = eigh_tridiagonal(d, e)
... A = np.diag(d) + np.diag(e, k=1) + np.diag(e, k=-1)
... np.allclose(A @ v - v @ np.diag(w), np.zeros((4, 4))) True
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.linalg._decomp.eig_banded scipy.linalg._decomp.eigvalsh_tridiagonal scipy.linalg._decomp.eig scipy.linalg._decomp.eigh

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/linalg/_decomp.py#1189
type: <class 'function'>
Commit: