From 1d2c41ae54bdf15d1c1639d3f0b58f80e9beb512 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Tue, 19 Jul 2022 12:49:32 +0100 Subject: [PATCH] feat: further speed up of GEVP by skipping the call to matrix_symmetric if matrix is already symmetric. --- pyerrors/correlators.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index e11ef6f9..b4a26f53 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -301,7 +301,11 @@ 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.")