nifty8.operator_spectrum module#
- operator_spectrum(A, k, hermitian, which='LM', tol=0, return_eigenvectors=False)[source]#
Find k eigenvalues and eigenvectors of the endomorphism A.
- Parameters:
A (LinearOperator) – Operator of which eigenvalues shall be computed.
k (int) – The number of eigenvalues and eigenvectors desired. k must be smaller than N-1. It is not possible to compute all eigenvectors of a matrix.
hermitian (bool) – Specifies whether A is hermitian or not.
which (str, ['LM' | 'SM' | 'LR' | 'SR' | 'LI' | 'SI'], optional) –
Which k eigenvectors and eigenvalues to find:
’LM’ : largest magnitude
’SM’ : smallest magnitude
’LR’ : largest real part
’SR’ : smallest real part
’LI’ : largest imaginary part
’SI’ : smallest imaginary part
tol (float, optional) – Relative accuracy for eigenvalues (stopping criterion) The default value of 0 implies machine precision.
return_eigenvectors (bool, optional) – Return eigenvectors (True) in addition to eigenvalues
- Returns:
w (ndarray) – Array of k eigenvalues.
v (ndarray) – An array representing the k eigenvectors. The column v[:, i] is the eigenvector corresponding to the eigenvalue w[i].
- Raises:
ArpackNoConvergence – When the requested convergence is not obtained. The currently converged eigenvalues and eigenvectors can be found as
eigenvalues
andeigenvectors
attributes of the exception object.