tests: GEVP test extendd, test case for warning when ts and Eigenvalue

sorting are used at the same time.
This commit is contained in:
Fabian Joswig 2022-05-09 14:16:46 +01:00
parent e557c9b54d
commit c852de0688

View file

@ -230,8 +230,8 @@ def test_matrix_corr():
corr_mat = pe.Corr(np.array([[corr_aa, corr_ab], [corr_ab, corr_aa]])) corr_mat = pe.Corr(np.array([[corr_aa, corr_ab], [corr_ab, corr_aa]]))
corr_mat.item(0, 0) corr_mat.item(0, 0)
vec_0 = corr_mat.GEVP(0, 0) vec_0 = corr_mat.GEVP(0, 0, sorted_list=None)
vec_1 = corr_mat.GEVP(0, 0, state=1) vec_1 = corr_mat.GEVP(0, 0, state=1, sorted_list=None)
corr_0 = corr_mat.projected(vec_0) corr_0 = corr_mat.projected(vec_0)
corr_1 = corr_mat.projected(vec_1) 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_0 - corr_aa])
assert np.all([o == 0 for o in corr_1 - 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.GEVP(0, 0, sorted_list="Eigenvector")
corr_mat.matrix_symmetric() corr_mat.matrix_symmetric()
with pytest.warns(RuntimeWarning):
corr_mat.GEVP(0, 1, sorted_list="Eigenvalue")
with pytest.raises(Exception): with pytest.raises(Exception):
corr_mat.plottable() corr_mat.plottable()