Getting eigenvalues of an arbitrary matrix with programming

Click For Summary
SUMMARY

The discussion focuses on computing eigenvalues of arbitrary matrices using power iteration and inverse power iteration methods. The power iteration method converges to the dominant eigenvector of a matrix A, while the inverse power iteration can be used to find the least dominant eigenvalue, provided A is not singular. A Python function is provided for the dominant eigenvalue calculation, utilizing matrix-vector products and normalization techniques. Additionally, the discussion mentions the use of scipy.linalg.eig for obtaining all eigenvalues and the Rayleigh Quotient Iteration algorithm for enhanced performance.

PREREQUISITES
  • Understanding of eigenvalues and eigenvectors
  • Familiarity with power iteration and inverse power iteration methods
  • Proficiency in Python programming
  • Knowledge of the SciPy library, specifically scipy.linalg.eig
NEXT STEPS
  • Research the implementation of Rayleigh Quotient Iteration for eigenvalue problems
  • Explore advanced matrix decomposition techniques in SciPy
  • Learn about the stability and convergence of iterative methods for eigenvalue computation
  • Investigate the use of NumPy for efficient matrix operations in Python
USEFUL FOR

Mathematicians, data scientists, and software developers working with numerical linear algebra, particularly those focused on eigenvalue problems and matrix computations.

Trollfaz
Messages
144
Reaction score
16
I have learnt about the power iteration for any matrix say A.
How it works is that we start with a random compatible vector v0. We define vn+1 as
vn+1=( Avn)/|max(Avn)|
After an arbitrary large number of iterations vn will slowly converge to the eigenvector associated with the dominant eigenvalue of A. To get the dominant eigenvalue, simply divide Avn by vn. The inverse power iteration can be used to find the least dominant eigenvalue of A by performing the iterations on A-1 assuming A is not singular else, the least dominant eigenvalue of A is automatically 0.
Heres how my function looks like on python:
def dominant_eigen(matrix,precision):
v=random_vector(len(matrix))
for i in range(precision):
v=matrix_vector_product(matrix,v) #takes in A and v and returns Av
v=tuple(map(lambda x:x/infinity_norm_v(v),v)) #infinity_norm_v returns magnitude of the dominant row entry
Av=matrix_vector_product(matrix,v)
return {'eigenvector':v,'eigenvalue':Av[0]/v[0]}
Are there computer methods to get all the eigenvalues of any matrices?
 
Physics news on Phys.org

Similar threads

  • · Replies 33 ·
2
Replies
33
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K