Error propagation and statistical analysis for Markov chain Monte Carlo simulations in lattice QCD and statistical mechanics using autograd
Find a file
2021-11-03 10:15:44 +00:00
.github/workflows first version of new bookeeping system 2021-11-01 17:14:30 +00:00
examples Examples updated, minor bug fixes 2021-10-11 18:31:02 +01:00
pyerrors Corr.__get_item__ now returns an Obs in case there is only one entry per 2021-11-03 10:15:44 +00:00
tests docstring and test added for Corr.reweight 2021-11-02 14:19:00 +00:00
.gitignore Benchmarks added 2021-10-26 10:20:47 +01:00
CHANGELOG.md fits fit_exp removed 2021-10-21 11:53:50 +01:00
conftest.py Initial public release 2020-10-13 16:53:00 +02:00
CONTRIBUTING.md CONTRIBUTING updated 2021-10-27 09:08:37 +01: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 README updated 2021-10-26 10:21:48 +01:00
setup.py README updated 2021-10-23 17:02:50 +01:00

flake8 pytest

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)
  • treatment of slow modes in the simulation as suggested in arXiv:1009.5228
  • coherent error propagation for data from different Markov chains
  • non-linear fits with x- and y-errors and exact linear error propagation based on automatic differentiation as introduced in [arXiv:1809.01289]
  • real and complex matrix operations and their error propagation based on automatic differentiation (cholesky decomposition, calculation of eigenvalues and eigenvectors, singular value decomposition...)

There exist similar implementations of gamma method error analysis suites in

Installation

To install the most recent release of pyerrors run

pip install git+https://github.com/fjosw/pyerrors.git@master

to install the current develop version run

pip install git+https://github.com/fjosw/pyerrors.git@develop

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 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

import numpy as np

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