Skip to content

Alias gm for gamma_method #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file.

## [2.5.0] - 2023-xx-xx
### Added
- Hotelling t-squared p-value added for correlated fits.
- String conversion of numpy arrays containing `Obs` improved.
- Alias `gm` for `Obs.gamma_method` added.
- Input routine for xSF measurement program added.

### Fixed
- Complex valued `Corr` objects fixed.
- Small bug in `qtop_projection` fixed.

## [2.4.0] - 2022-12-01
### Added
- Log-derivatives and symmetric log-effective mass added.
Expand All @@ -13,8 +24,6 @@ All notable changes to this project will be documented in this file.
- Bug in `input.json` export in connection with `numpy.int64` fixed.
- Small bug fixes in `input.openQCD`.



## [2.3.1] - 2022-10-19
### Fixed
- Integrated autocorrelation times are now correctly estimated for gapped irregular Monte Carlo chains.
Expand Down
2 changes: 2 additions & 0 deletions pyerrors/obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ def _compute_drho(i):
self.ddvalue = np.sqrt(self.ddvalue) / self._dvalue
return

gm = gamma_method

def _calc_gamma(self, deltas, idx, shape, w_max, fft):
"""Calculate Gamma_{AA} from the deltas, which are defined on idx.
idx is assumed to be a contiguous range (possibly with a stepsize != 1)
Expand Down
12 changes: 12 additions & 0 deletions tests/obs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,3 +1015,15 @@ def test_hash():
assert hash(i_obs) != hash((1 + 1e-7) * i_obs)
assert hash(obs) != hash(o1)
assert hash(o1) != hash(o2)

def test_gm_alias():
samples = np.random.rand(500)

tt1 = pe.Obs([samples], ["ens"])
tt1.gamma_method()

tt2 = pe.Obs([samples], ["ens"])
tt2.gm()

assert np.isclose(tt1.dvalue, tt2.dvalue)