diff --git a/pyerrors/npr.py b/pyerrors/npr.py index 16c86442..7ff81cc0 100644 --- a/pyerrors/npr.py +++ b/pyerrors/npr.py @@ -91,7 +91,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() and not res.imag.is_zero_within_error(5): + if not res.imag.is_zero_within_error(5): warnings.warn("Imaginary part of Zq is not zero within 5 sigma") return res return res.real diff --git a/pyerrors/pyerrors.py b/pyerrors/pyerrors.py index 8c03297b..3df41b7a 100644 --- a/pyerrors/pyerrors.py +++ b/pyerrors/pyerrors.py @@ -668,12 +668,14 @@ class CObs: return self._imag def gamma_method(self, **kwargs): + """Executes the gamma_method for the real and the imaginary part.""" if isinstance(self.real, Obs): self.real.gamma_method(**kwargs) if isinstance(self.imag, Obs): self.imag.gamma_method(**kwargs) def is_zero(self): + """Checks whether both real and imaginary part are zero within machine precision.""" return self.real == 0.0 and self.imag == 0.0 def conjugate(self):