Merge branch 'develop' into documentation

This commit is contained in:
fjosw 2022-02-09 15:33:04 +00:00
commit 6f74786b1d
3 changed files with 40 additions and 5 deletions

View file

@ -2,30 +2,39 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [2.0.0] - 2021-??-?? ## [2.0.0] - 2022-??-??
### Added ### Added
- The possibility to work with Monte Carlo histories which are evenly or unevenly spaced was added.
- `cov_Obs` added as a possibility to propagate the error of non Monte Carlo data together with Monte Carlo data.
- `CObs` class added which can handle complex valued Markov chain Monte Carlo data and the corresponding error propagation. - `CObs` class added which can handle complex valued Markov chain Monte Carlo data and the corresponding error propagation.
- Matrix to matrix operations like the matrix inverse now also work for complex matrices and matrices containing entries that are not `Obs` but `float` or `int`. - Matrix to matrix operations like the matrix inverse now also work for complex matrices and matrices containing entries that are not `Obs` but `float` or `int`.
- The possibility to work with Monte Carlo histories which are evenly or unevenly spaced was added. - Support for a new `json.gz` file format was added
- The Corr class now has additional methods like `reverse`, `T_symmetry`, `correlate` and `reweight`. - The Corr class now has additional methods like `reverse`, `T_symmetry`, `correlate` and `reweight`.
- `linalg` module now has explicit functions `inv` and `cholesky`. - `Corr.m_eff` can now cope with periodic and anti-periodic correlation functions
- Forward, backward and improved variants of the first and second derivative were added to the `Corr` class
- The `linalg` module now has explicit functions `inv` and `cholesky`.
- `Obs` objects now have methods `is_zero` and `is_zero_within_error` as well as overloaded comparison operations. - `Obs` objects now have methods `is_zero` and `is_zero_within_error` as well as overloaded comparison operations.
- Functions to convert Obs data to or from jackknife was added. - Functions to convert Obs data to or from jackknife was added.
- Alternative matrix multiplication routine `jack_matmul` was added to `linalg` module which makes use of the jackknife approximation and is much faster for large matrices. - Alternative matrix multiplication routine `jack_matmul` was added to `linalg` module which makes use of the jackknife approximation and is much faster for large matrices.
- Additional input routines for npr data added to `input.hadrons`. - Additional input routines for npr data added to `input.hadrons`.
- The `sfcf` and `openQCD` input modules can now handle all recent file type versions.
- `extract_t0` can now visualize the extraction on the fly
- Module added which provides the Dirac gamma matrices in the Grid convention.
- Version number added. - Version number added.
### Changed ### Changed
- The internal bookkeeping system for ensembles/replica was changed. The separator for replica is now `|`. - The internal bookkeeping system for ensembles/replica was changed. The separator for replica is now `|`.
- The fit functions were renamed to `least_squares` and `total_least_squares`. - The fit functions were renamed to `least_squares` and `total_least_squares`.
- The output of the fit functions is now a dedicated results class which keeps track of all relevant information
- The fit functions can now deal with provided covariance matrices. - The fit functions can now deal with provided covariance matrices.
- The convention for the fit range in the Corr class has been changed. - The convention for the fit range in the Corr class has been changed.
- Obs.print was renamed to Obs.details and the output was improved. - Various method of the `Corr` class were renamed
- `Obs.print` was renamed to `Obs.details` and the output was improved.
- The default value for `Corr.prange` is now `None`. - The default value for `Corr.prange` is now `None`.
- The `input` module was restructured to contain one submodule per data source. - The `input` module was restructured to contain one submodule per data source.
- Performance of Obs.__init__ improved. - Performance of Obs.__init__ improved.
### Deprecated ### Removed
- The function `plot_corrs` was deprecated as all its functionality is now contained within `Corr.show` - The function `plot_corrs` was deprecated as all its functionality is now contained within `Corr.show`
- The kwarg `bias_correction` in `derived_observable` was removed - The kwarg `bias_correction` in `derived_observable` was removed
- Obs no longer have an attribute `e_Q` - Obs no longer have an attribute `e_Q`

View file

@ -376,6 +376,24 @@ class Corr:
"""Reverse the time ordering of the Corr""" """Reverse the time ordering of the Corr"""
return Corr(self.content[:: -1]) return Corr(self.content[:: -1])
def thin(self, spacing=2, offset=0):
"""Thin out a correlator to suppress correlations
Parameters
----------
spacing : int
Keep only every 'spacing'th entry of the correlator
offset : int
Offset the equal spacing
"""
new_content = []
for t in range(self.T):
if (offset + t) % spacing != 0:
new_content.append(None)
else:
new_content.append(self.content[t])
return Corr(new_content)
def correlate(self, partner): def correlate(self, partner):
"""Correlate the correlator with another correlator or Obs """Correlate the correlator with another correlator or Obs

View file

@ -283,3 +283,11 @@ def test_hankel():
corr.Hankel(2) corr.Hankel(2)
corr.Hankel(6, periodic=True) corr.Hankel(6, periodic=True)
def test_thin():
c = pe.Corr([pe.pseudo_Obs(i, .1, 'test') for i in range(10)])
c *= pe.cov_Obs(1., .1, '#ren')
thin = c.thin()
thin.fit(lambda a, x: a[0] * x)
c.thin(offset=1)
c.thin(3, offset=1)