From 088a7da7e60814c3c2aa84a1635a0aed3c800ff9 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Wed, 18 May 2022 10:09:23 +0100 Subject: [PATCH] feat: Deprecation warning for Corr.GEVP kwarg state removed, documentation extended. --- pyerrors/correlators.py | 12 ++++++++++-- tests/correlators_test.py | 3 --- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index a8f4def6..ab4f6f50 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -245,7 +245,11 @@ class Corr: r'''Solve the generalized eigenvalue problem on the correlator matrix and returns the corresponding eigenvectors. The eigenvectors are sorted according to the descending eigenvalues, the zeroth eigenvector(s) correspond to the - largest eigenvalue(s). + largest eigenvalue(s). The eigenvector(s) for the individual states can be accessed via slicing + ```python + C.GEVP(t0=2)[0] # Ground state vector(s) + C.GEVP(t0=2)[:3] # Vectors for the lowest three states + ``` Parameters ---------- @@ -259,6 +263,11 @@ class Corr: - "Eigenvalue": The eigenvector is chosen according to which eigenvalue it belongs individually on every timeslice. - "Eigenvector": Use the method described in arXiv:2004.10472 to find the set of v(t) belonging to the state. The reference state is identified by its eigenvalue at $t=t_s$. + + Other Parameters + ---------------- + state : int + Returns only the vector(s) for a specified state. The lowest state is zero. ''' if self.N == 1: @@ -310,7 +319,6 @@ class Corr: raise Exception("Unkown value for 'sort'.") if "state" in kwargs: - warnings.warn("Argument 'state' is deprecated, use slicing instead.", DeprecationWarning) return reordered_vecs[kwargs.get("state")] else: return reordered_vecs diff --git a/tests/correlators_test.py b/tests/correlators_test.py index 0c1d089b..90dac90a 100644 --- a/tests/correlators_test.py +++ b/tests/correlators_test.py @@ -256,9 +256,6 @@ def test_GEVP_warnings(): with pytest.warns(DeprecationWarning): corr_mat.GEVP(0, sorted_list="Eigenvalue") - with pytest.warns(DeprecationWarning): - corr_mat.GEVP(0, state=0) - def test_GEVP_exceptions(): corr_aa = _gen_corr(1) corr_ab = 0.5 * corr_aa