Error propagation and statistical analysis for Markov chain Monte Carlo simulations in lattice QCD and statistical mechanics using autograd
Find a file
2021-10-12 14:22:01 +01:00
.github/workflows numpy and mpl version numbers moved 2021-10-12 14:22:01 +01:00
examples Examples updated, minor bug fixes 2021-10-11 18:31:02 +01:00
pyerrors further instances of np.float removed 2021-10-12 14:12:21 +01:00
tests np.float changed to np.float64 2021-10-12 14:11:01 +01:00
.gitignore Initial public release 2020-10-13 16:53:00 +02:00
CHANGELOG.md Changelog updated 2021-10-11 18:37:48 +01:00
conftest.py Initial public release 2020-10-13 16:53:00 +02:00
LICENSE Initial public release 2020-10-13 16:53:00 +02:00
pytest.ini Initial public release 2020-10-13 16:53:00 +02:00
README.md Merge branch 'develop' into feature/v2.0 2021-10-11 18:52:20 +01:00
setup.py setup.py updated 2021-10-11 14:27:48 +01:00

flake8 Lint

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. Some of its features are:

  • automatic differentiation as suggested in arXiv:1809.01289 (partly based on the autograd package)
  • the treatment of slow modes in the simulation as suggested in arXiv:1009.5228
  • multi ensemble analyses
  • non-linear fits with y-errors and exact linear error propagation based on automatic differentiation as introduced in [arXiv:1809.01289]
  • non-linear fits with x- and y-errors and exact linear error propagation based on automatic differentiation
  • matrix valued operations and their error propagation based on automatic differentiation (cholesky decomposition, calculation of eigenvalues and eigenvectors, singular value decomposition...)
  • implementation of the matrix-pencil-method IEEE Trans. Acoust. 38, 814-824 (1990) for the extraction of energy levels, especially suited for noisy data and excited states

There exist similar implementations of gamma method error analysis suites in

Installation

pyerrors requires python versions >= 3.5.0

Install the package for the local user:

pip install . --user

Run tests to verify the installation:

pytest .

Usage

The basic objects of a pyerrors analysis are instances of the class Obs. They can be initialized with an array of Monte Carlo data (e.g. samples1) and a name for the given ensemble (e.g. 'ensemble1'). The gamma_method can then be used to compute the statistical error, taking into account autocorrelations. The print method outputs a human readable result.

import numpy as np
import pyerrors as pe

obs1 = pe.Obs([samples1], ['ensemble1'])
obs1.gamma_method()
obs1.print()

Often one is interested in secondary observables which can be arbitrary functions of primary observables. pyerrors overloads most basic math operations and numpy functions such that the user can work with Obs objects as if they were floats

obs3 = 12.0 / obs1 ** 2 - np.exp(-1.0 / obs2)
obs3.gamma_method()
obs3.print()

More detailed examples can be found in the /examples folder:

License

MIT