docstrings added

This commit is contained in:
Fabian Joswig 2021-10-26 17:12:25 +01:00
parent caa5fdb348
commit 0ad5076b7e
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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):