diff --git a/test/api/test_api_phono3py.py b/test/api/test_api_phono3py.py index 576fd39c..010794ac 100644 --- a/test/api/test_api_phono3py.py +++ b/test/api/test_api_phono3py.py @@ -227,20 +227,24 @@ def test_symmetrize_fc_traditional(si_pbesol: Phono3py, is_compact_fc: bool): v1, v2, v3, _, _, _ = get_drift_fc3(ph3.fc3, primitive=ph3.primitive) np.testing.assert_allclose( - [v1, v2, v3], [-1.755065e-01, -1.749287e-01, 3.333333e-05], atol=1e-6 + np.abs([v1, v2, v3]), [1.755065e-01, 1.749287e-01, 3.333333e-05], atol=1e-6 ) ph3.symmetrize_fc3(level=3) v1_sym, v2_sym, v3_sym, _, _, _ = get_drift_fc3(ph3.fc3, primitive=ph3.primitive) if is_compact_fc: - np.testing.assert_allclose([v1_sym, v2_sym, v3_sym], 1.217081e-05, atol=1e-6) + np.testing.assert_allclose( + np.abs([v1_sym, v2_sym, v3_sym]), 1.217081e-05, atol=1e-6 + ) else: - np.testing.assert_allclose([v1_sym, v2_sym, v3_sym], 1.421085e-14, atol=1e-6) + np.testing.assert_allclose( + np.abs([v1_sym, v2_sym, v3_sym]), 1.421085e-14, atol=1e-6 + ) v1_sym, v2_sym, _, _ = get_drift_force_constants(ph3.fc2, primitive=ph3.primitive) if is_compact_fc: - np.testing.assert_allclose([v1_sym, v2_sym], -1.0e-06, atol=1e-6) + np.testing.assert_allclose(np.abs([v1_sym, v2_sym]), 1.0e-06, atol=1e-6) else: - np.testing.assert_allclose([v1_sym, v2_sym], -1.0e-06, atol=1e-6) + np.testing.assert_allclose(np.abs([v1_sym, v2_sym]), 1.0e-06, atol=1e-6) @pytest.mark.parametrize("is_compact_fc", [True, False])