From ad53f28e4633ee7e93a4d6b3cee581798e6cb72a Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Mon, 25 Oct 2021 14:32:28 +0100 Subject: [PATCH] mat_mat_op renamed to _mat_mat_op --- pyerrors/correlators.py | 8 ++++---- pyerrors/linalg.py | 6 +++--- pyerrors/npr.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index 8ef26ce2..d9f3142b 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -5,7 +5,7 @@ import matplotlib.pyplot as plt import scipy.linalg from .pyerrors import Obs, dump_object from .fits import standard_fit -from .linalg import eigh, mat_mat_op +from .linalg import eigh, inv, cholesky from .roots import find_root @@ -187,10 +187,10 @@ class Corr: def Eigenvalue(self, t0, state=1): G = self.smearing_symmetric() G0 = G.content[t0] - L = mat_mat_op(anp.linalg.cholesky, G0) - Li = mat_mat_op(anp.linalg.inv, L) + L = cholesky(G0) + Li = inv(L) LT = L.T - LTi = mat_mat_op(anp.linalg.inv, LT) + LTi = inv(LT) newcontent = [] for t in range(self.T): Gt = G.content[t] diff --git a/pyerrors/linalg.py b/pyerrors/linalg.py index 99fa0bb3..4d2aea61 100644 --- a/pyerrors/linalg.py +++ b/pyerrors/linalg.py @@ -171,11 +171,11 @@ def matmul(*operands): def inv(x): - return mat_mat_op(anp.linalg.inv, x) + return _mat_mat_op(anp.linalg.inv, x) def cholesky(x): - return mat_mat_op(anp.linalg.cholesky, x) + return _mat_mat_op(anp.linalg.cholesky, x) def scalar_mat_op(op, obs, **kwargs): @@ -203,7 +203,7 @@ def scalar_mat_op(op, obs, **kwargs): return derived_observable(_mat, raveled_obs, **kwargs) -def mat_mat_op(op, obs, **kwargs): +def _mat_mat_op(op, obs, **kwargs): """Computes the matrix to matrix operation op to a given matrix of Obs.""" # Use real representation to calculate matrix operations for complex matrices if isinstance(obs.ravel()[0], CObs): diff --git a/pyerrors/npr.py b/pyerrors/npr.py index acd21dff..16c86442 100644 --- a/pyerrors/npr.py +++ b/pyerrors/npr.py @@ -27,8 +27,8 @@ class Npr_matrix(np.ndarray): raise Exception('g5H only works for 12x12 matrices.') extended_g5 = np.kron(np.eye(3, dtype=int), gamma5) return Npr_matrix(matmul(extended_g5, self.conj().T, extended_g5), - mom_in=self.mom_out, - mom_out=self.mom_in) + mom_in=self.mom_out, + mom_out=self.mom_in) def _propagate_mom(self, other, name): s_mom = getattr(self, name, None)