mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 03:53:41 +02:00
docstrings added
This commit is contained in:
parent
caa5fdb348
commit
0ad5076b7e
2 changed files with 3 additions and 1 deletions
|
@ -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 = 1 / 12. * np.trace(matmul(inv_prop, np.kron(np.eye(3, dtype=int), p_slash)))
|
||||||
res.gamma_method()
|
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")
|
warnings.warn("Imaginary part of Zq is not zero within 5 sigma")
|
||||||
return res
|
return res
|
||||||
return res.real
|
return res.real
|
||||||
|
|
|
@ -668,12 +668,14 @@ class CObs:
|
||||||
return self._imag
|
return self._imag
|
||||||
|
|
||||||
def gamma_method(self, **kwargs):
|
def gamma_method(self, **kwargs):
|
||||||
|
"""Executes the gamma_method for the real and the imaginary part."""
|
||||||
if isinstance(self.real, Obs):
|
if isinstance(self.real, Obs):
|
||||||
self.real.gamma_method(**kwargs)
|
self.real.gamma_method(**kwargs)
|
||||||
if isinstance(self.imag, Obs):
|
if isinstance(self.imag, Obs):
|
||||||
self.imag.gamma_method(**kwargs)
|
self.imag.gamma_method(**kwargs)
|
||||||
|
|
||||||
def is_zero(self):
|
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
|
return self.real == 0.0 and self.imag == 0.0
|
||||||
|
|
||||||
def conjugate(self):
|
def conjugate(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue