Skip to content

Commit

Permalink
Add test symmetrized LBTE over pinv-solvers
Browse files Browse the repository at this point in the history
  • Loading branch information
atztogo committed Nov 25, 2024
1 parent d56960a commit 2b491d2
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/conductivity/test_kappa_LBTE.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 2b491d2

Please sign in to comment.