[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-11-20 09:44:15 +00:00
parent d2afa4cc8b
commit 7977b61135

View File

@ -3,20 +3,20 @@ import numpy as np
def lanczos(a: np.ndarray) -> tuple[list[float], list[float]]:
"""
Implements the Lanczos algorithm for a symmetric matrix.
Implements the Lanczos algorithm for a symmetric matrix.
Parameters:
-----------
matrix : numpy.ndarray
Symmetric matrix of size (n, n).
Parameters:
-----------
matrix : numpy.ndarray
Symmetric matrix of size (n, n).
Returns:
--------
alpha : [float]
List of diagonal elements of the resulting tridiagonal matrix.
beta : [float]
List of off-diagonal elements of the resulting tridiagonal matrix.
"""
Returns:
--------
alpha : [float]
List of diagonal elements of the resulting tridiagonal matrix.
beta : [float]
List of off-diagonal elements of the resulting tridiagonal matrix.
"""
n = a.shape[0]
v = np.zeros((n, n))
rng = np.random.default_rng()