From 42f62380b4a3255009b5d4320d2f1c4c7fca95a2 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Tue, 19 Jul 2022 12:22:54 +0100 Subject: [PATCH] feat: check for symmetric matrix added to GEVP for speed up, None case treated correctly in is_matrix_symmetric. --- pyerrors/correlators.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index c3391ce9..9bcfeb81 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -242,6 +242,8 @@ class Corr: if self.N == 1: raise Exception("Only works for correlator matrices.") for t in range(self.T): + if self[t] is None: + continue for i in range(self.N): for j in range(i + 1, self.N): if self[t][i, j] is self[t][j, i]: @@ -297,7 +299,10 @@ class Corr: warnings.warn("Argument 'sorted_list' is deprecated, use 'sort' instead.", DeprecationWarning) sort = kwargs.get("sorted_list") - symmetric_corr = self.matrix_symmetric() + if self.is_matrix_symmetric(): + symmetric_corr = self + else: + symmetric_corr = self.matrix_symmetric() if sort is None: if (ts is None): raise Exception("ts is required if sort=None.")