lgotta
lgotta

Reputation: 147

Python routine on matrix diagonalization

Good morning! I have a doubt about the python routine at: https://www.google.com/url?sa=t&source=web&rct=j&url=https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.sparse.linalg.eigsh.html&ved=2ahUKEwjJxrid8ezoAhXj6eAKHQbzBCwQFjAAegQIARAB&usg=AOvVaw29YNiM2xotOUio89RVOe_x&cshid=1587038068544

It says that it computers k eigenvectors and eigenvalues, with k smaller than matrix dimension, but is it possible to use it to get the lowest k eigenvalues or are those eigenvalues randomly ordered in the spectrum?

Upvotes: 1

Views: 131

Answers (1)

Uriel
Uriel

Reputation: 16184

As the documentation you linked states, the keywords which and mode affects which eigenvalues are selected:

*which* : str ['LM' | 'SM' | 'LA' | 'SA' | 'BE']

Which k eigenvectors and eigenvalues to find:
'LM' : Largest (in magnitude) eigenvalues 
'SM' : Smallest (in magnitude) eigenvalues
...

and

*mode* : string ['normal' | 'buckling' | 'cayley']

...
The choice of mode will affect which eigenvalues are selected by the keyword 'which'.

The default of which is 'LM' (largest eigenvalues) so you might want to pass 'SM' to retrieve the lowest.

Upvotes: 1

Related Questions