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

@ -1,4 +1,4 @@
[![flake8 Lint](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml) [![CI](https://github.com/fjosw/pyerrors/actions/workflows/CI.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/CI.yml)[![](https://img.shields.io/badge/python-3.5+-blue.svg)](https://www.python.org/downloads/)
[![flake8 Lint](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml) [![CI](https://github.com/fjosw/pyerrors/actions/workflows/CI.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/CI.yml) [![](https://img.shields.io/badge/python-3.5+-blue.svg)](https://www.python.org/downloads/)
# pyerrors
pyerrors is a python package for error computation and propagation of Markov Chain Monte Carlo data.
It is based on the gamma method [arXiv:hep-lat/0306017](https://arxiv.org/abs/hep-lat/0306017). Some of its features are:

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: