From c852de06889acdd7351915f8ad17959ea1b93ae9 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Mon, 9 May 2022 14:16:46 +0100 Subject: [PATCH] tests: GEVP test extendd, test case for warning when ts and Eigenvalue sorting are used at the same time. --- tests/correlators_test.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/correlators_test.py b/tests/correlators_test.py index f0e4a665..bdae7255 100644 --- a/tests/correlators_test.py +++ b/tests/correlators_test.py @@ -230,8 +230,8 @@ def test_matrix_corr(): corr_mat = pe.Corr(np.array([[corr_aa, corr_ab], [corr_ab, corr_aa]])) corr_mat.item(0, 0) - vec_0 = corr_mat.GEVP(0, 0) - vec_1 = corr_mat.GEVP(0, 0, state=1) + vec_0 = corr_mat.GEVP(0, 0, sorted_list=None) + vec_1 = corr_mat.GEVP(0, 0, state=1, sorted_list=None) corr_0 = corr_mat.projected(vec_0) corr_1 = corr_mat.projected(vec_1) @@ -239,11 +239,14 @@ def test_matrix_corr(): assert np.all([o == 0 for o in corr_0 - corr_aa]) assert np.all([o == 0 for o in corr_1 - corr_aa]) - corr_mat.GEVP(0, 0, sorted_list="Eigenvalue") + corr_mat.GEVP(0, sorted_list="Eigenvalue") corr_mat.GEVP(0, 0, sorted_list="Eigenvector") corr_mat.matrix_symmetric() + with pytest.warns(RuntimeWarning): + corr_mat.GEVP(0, 1, sorted_list="Eigenvalue") + with pytest.raises(Exception): corr_mat.plottable()