eigvalsh_tridiagonal
- scipy.linalg.eigvalsh_tridiagonal(d, e, select='a', select_range=None, check_finite=True, tol=0.0, lapack_driver='auto')
Solve eigenvalue problem for a real symmetric tridiagonal matrix.
Solve eigenvalue problem for a real symmetric tridiagonal matrix.
Find eigenvalues w 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.
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 Batched Linear Operations for details.
Note that calls with zero-size batches are unsupported and will raise a ValueError.
The diagonal elements of the array.
The off-diagonal elements of the array.
Which eigenvalues to calculate
select | calculated |
|---|---|
‘a’ | All eigenvalues |
‘v’ | Eigenvalues in the interval (min, max] |
‘i’ | Eigenvalues with indices min <= i <= max |
Range of selected eigenvalues
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.
The absolute tolerance to which each eigenvalue is required
(only used when lapack_driver='stebz').
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 function to use, can be ‘auto’, ‘stemr’, ‘stebz’, ‘sterf’,
‘stev’, or ‘stevd’. When ‘auto’ (default), it will use ‘stevd’ if
select='a' and ‘stebz’ otherwise. ‘sterf’ and ‘stev’ can only
be used when select='a'.
The eigenvalues, in ascending order, each repeated according to its multiplicity.
If eigenvalue computation does not converge.
>>> import numpy as np
>>> from scipy.linalg import eigvalsh_tridiagonal, eigvalsh
>>> d = 3*np.ones(4)
>>> e = -1*np.ones(3)
>>> w = eigvalsh_tridiagonal(d, e)
>>> A = np.diag(d) + np.diag(e, k=1) + np.diag(e, k=-1)
>>> w2 = eigvalsh(A) # Verify with other eigenvalue routines
>>> np.allclose(w - w2, np.zeros(4))
True