zero_within_error method added, warnings added to Corr methods symmetric and

anti-symmetric
This commit is contained in:
Fabian Joswig 2021-10-15 11:47:41 +01:00
parent c6c02cdc57
commit 8488df00fd
3 changed files with 10 additions and 1 deletions

View file

@ -129,6 +129,9 @@ class Corr:
if self.T % 2 != 0:
raise Exception("Can not symmetrize odd T")
if np.argmax(np.abs(self.content)) != 0:
print('Warning: correlator does not seem to be symmetric around x0=0.')
newcontent = [self.content[0]]
for t in range(1, self.T):
if (self.content[t] is None) or (self.content[self.T - t] is None):
@ -144,6 +147,9 @@ class Corr:
if self.T % 2 != 0:
raise Exception("Can not symmetrize odd T")
if not all([o.zero_within_error() for o in self.content[0]]):
print('Warning: correlator does not seem to be anti-symmetric around x0=0.')
newcontent = [self.content[0]]
for t in range(1, self.T):
if (self.content[t] is None) or (self.content[self.T - t] is None):

View file

@ -340,6 +340,9 @@ class Obs:
for e_name in self.e_names:
print(e_name, ':', self.e_content[e_name])
def zero_within_error(self):
return np.abs(self.value) <= self.dvalue
def plot_tauint(self, save=None):
"""Plot integrated autocorrelation time for each ensemble."""
if not self.e_names: