dimanche 27 novembre 2022

How can I get the eigenvectors and eigenvalues of the matrix and ordering them by `lambda_1

I use the following code to get a random matrix (normalized GOE) in Python:

pip install scikit-rmt

from skrmt.ensemble import GaussianEnsemble

# sampling a GOE matrix of size 1000x1000
goe = GaussianEnsemble(beta=1, n=1000)
# plotting its spectral distribution in the interval (-2,2)
goe.plot_eigval_hist(bins=80, interval=(-2,2), density=True)

But how can I get the eigenvectors and eigenvalues? And ordering them by lambda_1<lambda_2<...<lambda_n and their eigenvectors.


I try to use

from numpy.linalg import eig
l, v=eig(goe)

But it shows that LinAlgError: 0-dimensional array given. Array must be at least two-dimensional




Aucun commentaire:

Enregistrer un commentaire