From 68b25ba4ca1a097d0dc110cb6fdfe9a506db4b1e Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Mon, 25 Oct 2021 12:24:54 +0100 Subject: [PATCH] npr.Zq now checks if imag part is at machine precision --- pyerrors/npr.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pyerrors/npr.py b/pyerrors/npr.py index c04813fc..a8b5ab9a 100644 --- a/pyerrors/npr.py +++ b/pyerrors/npr.py @@ -92,10 +92,7 @@ def Zq(inv_prop, fermion='Wilson'): res = 1 / 12. * np.trace(matmul(inv_prop, np.kron(np.eye(3, dtype=int), p_slash))) res.gamma_method() - if not res.imag.is_zero_within_error(5): + if not res.imag.is_zero() and not res.imag.is_zero_within_error(5): warnings.warn("Imaginary part of Zq is not zero within 5 sigma") return res - if not np.abs(res.imag.value) <= 1e-6: - warnings.warn("Imaginary part of Zq is not smaller than 1e-6") - return res return res.real