power_method, a Python code which carries out the power method, for determining the eigenvalue of largest magnitude, and the corresponding eigenvector, of a given matrix.
The power method implemented here is given a real square matrix, and seeks to determine the eigenvalue of maximum modulus, and a corresponding eigenvector.
The basic power method will not perform as expected if, corresponding to the maximum modulus, there are complex eigenvalues, or a pair of real eigenvalues of opposite sign. The power method's behavior can break down or be very slow initially if the starting vector has a zero or very small component in the eigenspace corresponding to the maximal eigenvalue.
A second version of the power method is included which can handle the case of complex eigenvalues.
The computer code and data files described and made available on this web page are distributed under the MIT license
power_method is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.
pagerank, a Python code which illustrates the eigenvalue (power method) and surfer (Markov chain) approaches to ranking web pages.
test_eigen, a Python code which implements test matrices for eigenvalue analysis.
test_matrix, a Python code which defines test matrices.