[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]]: 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: Parameters:
----------- -----------
matrix : numpy.ndarray matrix : numpy.ndarray
Symmetric matrix of size (n, n). Symmetric matrix of size (n, n).
Returns: Returns:
-------- --------
alpha : [float] alpha : [float]
List of diagonal elements of the resulting tridiagonal matrix. List of diagonal elements of the resulting tridiagonal matrix.
beta : [float] beta : [float]
List of off-diagonal elements of the resulting tridiagonal matrix. List of off-diagonal elements of the resulting tridiagonal matrix.
""" """
n = a.shape[0] n = a.shape[0]
v = np.zeros((n, n)) v = np.zeros((n, n))
rng = np.random.default_rng() rng = np.random.default_rng()