linear_algebra.src.rayleigh_quotient

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

Functions

is_hermitian(→ bool)

Checks if a matrix is Hermitian.

rayleigh_quotient(→ Any)

Returns the Rayleigh quotient of a Hermitian matrix A and

tests(→ None)

Module Contents

linear_algebra.src.rayleigh_quotient.is_hermitian(matrix: numpy.ndarray) bool

Checks if a matrix is Hermitian. >>> import numpy as np >>> A = np.array([ … [2, 2+1j, 4], … [2-1j, 3, 1j], … [4, -1j, 1]]) >>> is_hermitian(A) True >>> A = np.array([ … [2, 2+1j, 4+1j], … [2-1j, 3, 1j], … [4, -1j, 1]]) >>> is_hermitian(A) False

linear_algebra.src.rayleigh_quotient.rayleigh_quotient(a: numpy.ndarray, v: numpy.ndarray) Any

Returns the Rayleigh quotient of a Hermitian matrix A and vector v. >>> import numpy as np >>> A = np.array([ … [1, 2, 4], … [2, 3, -1], … [4, -1, 1] … ]) >>> v = np.array([ … [1], … [2], … [3] … ]) >>> rayleigh_quotient(A, v) array([[3.]])

linear_algebra.src.rayleigh_quotient.tests() None