From 39dff5a830cfb730783abe44b33f826f29821d5a Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Tue, 22 Feb 2022 21:33:04 +0000 Subject: [PATCH] tests: tests for GEVP fixed, docstring for Corr.Eigenvalue added, typos fixed --- pyerrors/correlators.py | 21 +++++++++++++++++++-- tests/correlators_test.py | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index 5c24007f..cc3afa4b 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -255,9 +255,9 @@ class Corr: The state one is interested in ordered by energy. The lowest state is zero. sorted_list : string if this argument is set, a list of vectors (len=self.T) is returned. If it is left as None, only one vector is returned. - "Eigenvalue" - The eigenvector is chosen according to which einvenvalue it belongs individually on every timeslice. + "Eigenvalue" - The eigenvector is chosen according to which eigenvalue it belongs individually on every timeslice. "Eigenvector" - Use the method described in arXiv:2004.10472 [hep-lat] to find the set of v(t) belonging to the state. - The referense state is identified by its eigenvalue at t=ts + The reference state is identified by its eigenvalue at t=ts """ if sorted_list is None: if (ts is None): @@ -302,6 +302,23 @@ class Corr: return all_vecs def Eigenvalue(self, t0, ts=None, state=0, sorted_list=None): + """Determines the eigenvalue of the GEVP by solving and projecting the correlator + + Parameters + ---------- + t0 : int + The time t0 for G(t)v= lambda G(t_0)v + ts : int + fixed time G(t_s)v= lambda G(t_0)v if return_list=False + If return_list=True and sorting=Eigenvector it gives a reference point for the sorting method. + state : int + The state one is interested in ordered by energy. The lowest state is zero. + sorted_list : string + if this argument is set, a list of vectors (len=self.T) is returned. If it is left as None, only one vector is returned. + "Eigenvalue" - The eigenvector is chosen according to which eigenvalue it belongs individually on every timeslice. + "Eigenvector" - Use the method described in arXiv:2004.10472 [hep-lat] to find the set of v(t) belonging to the state. + The reference state is identified by its eigenvalue at t=ts + """ vec = self.GEVP(t0, ts=ts, state=state, sorted_list=sorted_list) return self.projected(vec) diff --git a/tests/correlators_test.py b/tests/correlators_test.py index 2d068d90..581705fd 100644 --- a/tests/correlators_test.py +++ b/tests/correlators_test.py @@ -220,7 +220,7 @@ def test_prange(): def test_matrix_corr(): corr_aa = _gen_corr(1) - corr_ab = _gen_corr(0.5) + corr_ab = 0.5 * corr_aa corr_mat = pe.Corr(np.array([[corr_aa, corr_ab], [corr_ab, corr_aa]])) corr_mat.item(0, 0)