From 8069bfc3e3f09faffd48724432aef5cb4d0eb6ee Mon Sep 17 00:00:00 2001 From: Michele Nottoli <michele.nottoli@gmail.com> Date: Tue, 7 Nov 2023 14:32:28 +0100 Subject: [PATCH] Lint. --- gext/fitting.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gext/fitting.py b/gext/fitting.py index 9422b15..c726142 100644 --- a/gext/fitting.py +++ b/gext/fitting.py @@ -61,11 +61,11 @@ class LeastSquare(AbstractFitting): """Given a set of vectors and a target return the fitting coefficients.""" matrix = np.array(vectors).T - A = matrix.T @ matrix + a = matrix.T @ matrix b = matrix.T @ target if self.options["regularization"] > 0.0: - A += np.identity(len(b))*self.options["regularization"] - coefficients = np.linalg.solve(A, b) + a += np.identity(len(b))*self.options["regularization"] + coefficients = np.linalg.solve(a, b) return np.array(coefficients, dtype=np.float64) class QuasiTimeReversible(AbstractFitting): @@ -98,12 +98,12 @@ class QuasiTimeReversible(AbstractFitting): else: time_reversible_matrix = matrix[:, :q//2+1] + matrix[:, :q//2-1:-1] - A = time_reversible_matrix.T @ time_reversible_matrix + a = time_reversible_matrix.T @ time_reversible_matrix b = time_reversible_matrix.T @ (target + past_target) if self.options["regularization"] > 0.0: - A += np.identity(len(b))*self.options["regularization"] - coefficients = np.linalg.solve(A, b) + a += np.identity(len(b))*self.options["regularization"] + coefficients = np.linalg.solve(a, b) if q == 1: full_coefficients = np.concatenate(([-1.0], coefficients)) -- GitLab