mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 23:00:25 +01:00
zero_within_error method added, warnings added to Corr methods symmetric and
anti-symmetric
This commit is contained in:
parent
c6c02cdc57
commit
8488df00fd
3 changed files with 10 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
[](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml) [](https://github.com/fjosw/pyerrors/actions/workflows/CI.yml)[](https://www.python.org/downloads/)
|
[](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml) [](https://github.com/fjosw/pyerrors/actions/workflows/CI.yml) [](https://www.python.org/downloads/)
|
||||||
# pyerrors
|
# pyerrors
|
||||||
pyerrors is a python package for error computation and propagation of Markov Chain Monte Carlo data.
|
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:
|
It is based on the gamma method [arXiv:hep-lat/0306017](https://arxiv.org/abs/hep-lat/0306017). Some of its features are:
|
||||||
|
|
|
@ -129,6 +129,9 @@ class Corr:
|
||||||
if self.T % 2 != 0:
|
if self.T % 2 != 0:
|
||||||
raise Exception("Can not symmetrize odd T")
|
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]]
|
newcontent = [self.content[0]]
|
||||||
for t in range(1, self.T):
|
for t in range(1, self.T):
|
||||||
if (self.content[t] is None) or (self.content[self.T - t] is None):
|
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:
|
if self.T % 2 != 0:
|
||||||
raise Exception("Can not symmetrize odd T")
|
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]]
|
newcontent = [self.content[0]]
|
||||||
for t in range(1, self.T):
|
for t in range(1, self.T):
|
||||||
if (self.content[t] is None) or (self.content[self.T - t] is None):
|
if (self.content[t] is None) or (self.content[self.T - t] is None):
|
||||||
|
|
|
@ -340,6 +340,9 @@ class Obs:
|
||||||
for e_name in self.e_names:
|
for e_name in self.e_names:
|
||||||
print(e_name, ':', self.e_content[e_name])
|
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):
|
def plot_tauint(self, save=None):
|
||||||
"""Plot integrated autocorrelation time for each ensemble."""
|
"""Plot integrated autocorrelation time for each ensemble."""
|
||||||
if not self.e_names:
|
if not self.e_names:
|
||||||
|
|
Loading…
Add table
Reference in a new issue