Skip to content

Eigensolvers

inverse_power_method(A, m=0.0, B=None, maxiter=100, tol=1e-10)

Implementation of the inverse power method (or inverse iteration) scheme to find an eigenvector associated with an eigenvalue of A that is close to 'm'. In other words, this function computes x such that : Ax = λBx where λ is an eigenvalue of A that minimizes |λ-m|.

Parameters:

Name Type Description Default
A csc_matrix

the matrix

required
mu float

the approximate eigenvalue. Will compute an eigenvector for the eigenvalue λ that minimizes its distance to mu. Defaults to zero.

required
B csc_matrix

metrics matrix for generalized eigenvectors computation. If not specified, will be the identity matrix. Defaults to None.

None
maxiter int

maximal number of internal iteration. Defaults to 100.

100
tol float

early stopping criterion. Will stop the iteration if |x_{n+1} - x_n| < tol. Defaults to 1e-6.

1e-10

Returns:

Type Description
ndarray

np.ndarray: a unit norm eiven vector associated with an eigenvalue that is close to 'mu'

rayleigh_quotient_iteration(A, m=0.0, B=None, x0=None, maxiter=100, tol=1e-10)

Performs Rayleigh quotient iteration on matrix A to find an eigenvector of A whose eigenvalue is near 'm'. Similar to the inverse power method, except that the approximated eigenvalue is computed as the Rayleigh quotient, which converges faster for symmetric matrices.

Parameters:

Name Type Description Default
A csc_matrix

the matrix

required
m float

the approximate eigenvalue. Will compute an eigenvector for the eigenvalue λ that minimizes its distance to m. Defaults to zero.

0.0
B csc_matrix

metrics matrix for generalized eigenvectors computation. If not specified, will be the identity matrix. Defaults to None.

None
x0 ndarray

Initial guess for the eigenvector. If not provided, will be taken as a random vector with normalized values. Defaults to None.

None
maxiter int

maximal number of internal iteration. Defaults to 100.

100
tol float

early stopping criterion. Will stop the iteration if |x_{n+1} - x_n| < tol. Defaults to 1e-6.

1e-10
References

https://en.wikipedia.org/wiki/Rayleigh_quotient_iteration

Returns:

Type Description
ndarray

np.ndarray: An eigenvector of A associated with eigenvalue λ that is closest to m.