A Python3 library to analyse data generated from (Monte Carlo) Markov chains.
The software is hosted on GitHub and is distributed under the GNU GPLv2 license.
Features
object-oriented for easy manipulation of data
FFT acceleration for calculation of autocorrelations
minimal memory footprint for large data sets and memory monitoring system
support for master-field setup, ie autocorrelations in more than one dimension
support for systematic errors and external input data
flexible interface for fits
support for linear algebra operations (e.g. matrix inverse, eigenvalue problem, etc..)
If you use this library in your publications cite it following the instructions here Zenodo webpage.
Please also consider citing:
Bruno, R. Sommer, On fits to correlated and auto-correlated data. Comput.Phys.Commun. 285 (2023) 108643.
Schaefer, R. Sommer, F. Virotta, Critical slowing down and error analysis in lattice QCD simulations. Nucl.Phys.B 845 (2011) 93-119.
Wolff, Monte Carlo errors with less errors. Comput.Phys.Commun. 156 (2004) 143-153.
pyobs can be installed in three different ways. After installation it can be imported like any other package
>>> import pyobs
>>> help(pyobs.observable)
pip install from remote repository
$ pip install git+https://github.com/mbruno46/pyobs.git@master#egg=pyobs
$ # for upgrading
$ pip install -U git+https://github.com/mbruno46/pyobs.git@master#egg=pyobs
pip install from local repository
$ git clone git+https://github.com/mbruno46/pyobs.git
$ pip install ./pyobs
developer mode
$ pip install -e ./pyobs
The library can alternatively be used without installation by adding the appropriate path to sys. In this case it is recommended to recompile the C++ extensions manually with python setup.py build_ext.
>>> import sys
>>> sys.path.append('/path/to/pyobs/directory/')
>>> import pyobs
Note that recompiling the C++ extensions might be necessary also after pulling the latest commits, in the developer mode.
Virtual environments can be used to create a copy of the python distribution in the home directory where the user can freely install additional packages, including pyobs.
$ cd $HOME
$ python3.6 -m venv mypy
The environment can be activated, meaning that pip and python commands will be automatically identified with those in the environment
$ source mypy/bin/activate
$ pip install numpy jupyter notebook
Alternatively, just use the full path
$ cd mypy/bin
$ ./pip install numpy
$ ./pip install git+https://github.com/mbruno46/pyobs.git@master#egg=pyobs
All notable changes to this project will be documented in this file. The format is based on Keep a changelog.
jackknife error support
exponential tail
BDIO format has bug for python>=3.10
added full support for complex observables
added conj method to observable class
temporary class complex_observable migrated to tests
minor bugs
temporary support for complex observables via complex_observable class (binary operations @, *, unary operations inv, eig, T)
extended output for peek function
fixed bug in chiexp for combined fits
faster index search in transform.py for large observables
added support for expected chi square
improved error estimation and plotting in presence of holes
minor bugs fixed (I/O xml)
fixed bug in transform (roll, sort..)
improved behavior under roundoff errors
fixed compatibility issues with numpy>=1.24.0
finite volume 2to2 quantization condition
write support for xml.gz format
documentation updated
Fixed - several minor bugs fixed
added utility functions (tensor_remove, import_string)
minor bugs fixed
added support xml and bdio format (dobs-tools, ALPHA Collab.)
interface for synthetic autocorrelated data changed
several bugs fixed
added support for binning of Monte Carlo data, and blocking for master-field data
added support for linting of code
performance improvements for slicing/indexing/extending observables
added support for root finder, basic interpolation, cumsum
fixed documentation bugs
minor improvements to mfit
added support for variance and cov. matrix (data.py rewritten)
added IO with binary file format (default), based on bison
performance improvements in create and derobs
additional gradient class for optimization of element-wise operations
minor bug fixes
IO with json file format supported
pip install supported
error of the error and 4th moment bias supported
support for code coverage and automatic unit tests
flexible fit modules (Levenberg-Marquardt minimizer)
documentation and tutorials
symbolic differentiation for fit functions
support for eigenvalue/eigenvectors (including non-symmetric case)
support for exp, log, cosh, arccosh, besselk
fast C++ extensions for master-field case
overloaded basic math operations (+,-,*,/)
tensor operations: unary support (sum, trace), matmul via @ operand
basic tensor manipulation (reshape, concatenate) and getitem
FFT for autocorrelations
support for external data with known covariances and systematic errors
memory management system, utility functions
random module for generation of autocorrelated data sets