From 2b491d23271bb8df31ed97bff421d52791d37620 Mon Sep 17 00:00:00 2001 From: Atsushi Togo Date: Mon, 25 Nov 2024 14:16:00 +0900 Subject: [PATCH] Add test symmetrized LBTE over pinv-solvers --- test/conductivity/test_kappa_LBTE.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/test/conductivity/test_kappa_LBTE.py b/test/conductivity/test_kappa_LBTE.py index 1c7c9ab4..10326417 100644 --- a/test/conductivity/test_kappa_LBTE.py +++ b/test/conductivity/test_kappa_LBTE.py @@ -10,9 +10,19 @@ @pytest.mark.skipif( not phono3c.include_lapacke(), reason="test for phono3py compliled with lapacke" ) -@pytest.mark.parametrize("pinv_solver", [1, 2, 3, 4, 5]) -def test_kappa_LBTE(si_pbesol: Phono3py, pinv_solver: int): +@pytest.mark.parametrize("pinv_solver", [1, 2]) +def test_kappa_LBTE_12(si_pbesol: Phono3py, pinv_solver: int): + """Test for symmetry reduced collision matrix.""" + _test_kappa_LBTE(si_pbesol, pinv_solver) + + +@pytest.mark.parametrize("pinv_solver", [3, 4, 5]) +def test_kappa_LBTE_345(si_pbesol: Phono3py, pinv_solver: int): """Test for symmetry reduced collision matrix.""" + _test_kappa_LBTE(si_pbesol, pinv_solver) + + +def _test_kappa_LBTE(si_pbesol: Phono3py, pinv_solver: int): if si_pbesol._make_r0_average: ref_kappa = [110.896, 110.896, 110.896, 0, 0, 0] else: @@ -65,7 +75,7 @@ def test_kappa_LBTE_full_colmat(si_pbesol: Phono3py): is_reducible_collision_matrix=True, ) kappa = si_pbesol.thermal_conductivity.kappa.ravel() - np.testing.assert_allclose(ref_kappa, kappa, atol=0.3) + np.testing.assert_allclose(ref_kappa, kappa, atol=0.5) def test_kappa_LBTE_aln(aln_lda: Phono3py):