From 7977b61135234be89158df6726a02037cf307bab Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:44:15 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- linear_algebra/lanczos_algorithm.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/linear_algebra/lanczos_algorithm.py b/linear_algebra/lanczos_algorithm.py index 4d792d3b0..f59986da7 100644 --- a/linear_algebra/lanczos_algorithm.py +++ b/linear_algebra/lanczos_algorithm.py @@ -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()