mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
further docstrings updated
This commit is contained in:
parent
56e1425835
commit
b90caa4cdc
2 changed files with 19 additions and 10 deletions
|
@ -79,16 +79,16 @@ class Corr:
|
||||||
else:
|
else:
|
||||||
raise Exception("Reweighting status of correlator corrupted.")
|
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."""
|
"""Apply the gamma method to the content of the Corr."""
|
||||||
for item in self.content:
|
for item in self.content:
|
||||||
if not(item is None):
|
if not(item is None):
|
||||||
if self.N == 1:
|
if self.N == 1:
|
||||||
item[0].gamma_method()
|
item[0].gamma_method(**kwargs)
|
||||||
else:
|
else:
|
||||||
for i in range(self.N):
|
for i in range(self.N):
|
||||||
for j 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.
|
# 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.
|
# The method can use one or two vectors.
|
||||||
|
@ -238,7 +238,15 @@ class Corr:
|
||||||
return Corr(self.content[::-1])
|
return Corr(self.content[::-1])
|
||||||
|
|
||||||
def correlate(self, partner):
|
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 = []
|
new_content = []
|
||||||
for x0, t_slice in enumerate(self.content):
|
for x0, t_slice in enumerate(self.content):
|
||||||
if t_slice is None:
|
if t_slice is None:
|
||||||
|
@ -350,10 +358,11 @@ class Corr:
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
variant : str
|
variant : str
|
||||||
log: uses the standard effective mass log(C(t) / C(t+1))
|
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.
|
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.
|
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
|
See, e.g., arXiv:1205.5380
|
||||||
|
arccosh : Uses the explicit form of the symmetrized correlator (not recommended)
|
||||||
guess : float
|
guess : float
|
||||||
guess for the root finder, only relevant for the root variant
|
guess for the root finder, only relevant for the root variant
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -333,10 +333,6 @@ class Obs:
|
||||||
|
|
||||||
return gamma
|
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):
|
def details(self, ens_content=True):
|
||||||
"""Output detailed properties of the Obs.
|
"""Output detailed properties of the Obs.
|
||||||
|
|
||||||
|
@ -370,6 +366,10 @@ class Obs:
|
||||||
m = max(map(len, list(self.e_content.keys()))) + 1
|
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())]))
|
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):
|
def is_zero_within_error(self, sigma=1):
|
||||||
"""Checks whether the observable is zero within 'sigma' standard errors.
|
"""Checks whether the observable is zero within 'sigma' standard errors.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue