From b90caa4cdc0b77fa32e1c146ea4291fed96b0d39 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 12 Nov 2021 14:25:51 +0000 Subject: [PATCH] further docstrings updated --- pyerrors/correlators.py | 21 +++++++++++++++------ pyerrors/obs.py | 8 ++++---- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index c2ae3eda..9c1ef29c 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -79,16 +79,16 @@ class Corr: else: raise Exception("Reweighting status of correlator corrupted.") - def gamma_method(self): + def gamma_method(self, **kwargs): """Apply the gamma method to the content of the Corr.""" for item in self.content: if not(item is None): if self.N == 1: - item[0].gamma_method() + item[0].gamma_method(**kwargs) else: for i in range(self.N): for j in range(self.N): - item[i, j].gamma_method() + item[i, j].gamma_method(**kwargs) # We need to project the Correlator with a Vector to get a single value at each timeslice. # The method can use one or two vectors. @@ -238,7 +238,15 @@ class Corr: return Corr(self.content[::-1]) def correlate(self, partner): - """Correlate the correlator with another correlator or Obs""" + """Correlate the correlator with another correlator or Obs + + Parameters + ---------- + partner : Obs or Corr + partner to correlate the correlator with. + Can either be an Obs which is correlated with all entries of the + correlator or a Corr of same length. + """ new_content = [] for x0, t_slice in enumerate(self.content): if t_slice is None: @@ -350,10 +358,11 @@ class Corr: Parameters ---------- variant : str - log: uses the standard effective mass log(C(t) / C(t+1)) - cosh : Use periodicitiy of the correlator by solving C(t) / C(t+1) = cosh(m * (t - T/2)) / cosh(m * (t + 1 - T/2)) for m. + log : uses the standard effective mass log(C(t) / C(t+1)) + cosh, periodic : Use periodicitiy of the correlator by solving C(t) / C(t+1) = cosh(m * (t - T/2)) / cosh(m * (t + 1 - T/2)) for m. sinh : Use anti-periodicitiy of the correlator by solving C(t) / C(t+1) = sinh(m * (t - T/2)) / sinh(m * (t + 1 - T/2)) for m. See, e.g., arXiv:1205.5380 + arccosh : Uses the explicit form of the symmetrized correlator (not recommended) guess : float guess for the root finder, only relevant for the root variant """ diff --git a/pyerrors/obs.py b/pyerrors/obs.py index 1c98d2a3..2b4398cf 100644 --- a/pyerrors/obs.py +++ b/pyerrors/obs.py @@ -333,10 +333,6 @@ class Obs: return gamma - def print(self, level=1): - warnings.warn("Method 'print' renamed to 'details'", DeprecationWarning) - self.details(level > 1) - def details(self, ens_content=True): """Output detailed properties of the Obs. @@ -370,6 +366,10 @@ class Obs: m = max(map(len, list(self.e_content.keys()))) + 1 print('\n'.join([' ' + key.rjust(m) + ': ' + str(value) for key, value in sorted(self.e_content.items())])) + def print(self, level=1): + warnings.warn("Method 'print' renamed to 'details'", DeprecationWarning) + self.details(level > 1) + def is_zero_within_error(self, sigma=1): """Checks whether the observable is zero within 'sigma' standard errors.