mirror of https://github.com/phonopy/phono3py.git
Update test
This commit is contained in:
parent
cfcd64fb9f
commit
7effdf6c26
|
@ -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)
|
v1, v2, v3, _, _, _ = get_drift_fc3(ph3.fc3, primitive=ph3.primitive)
|
||||||
np.testing.assert_allclose(
|
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)
|
ph3.symmetrize_fc3(level=3)
|
||||||
v1_sym, v2_sym, v3_sym, _, _, _ = get_drift_fc3(ph3.fc3, primitive=ph3.primitive)
|
v1_sym, v2_sym, v3_sym, _, _, _ = get_drift_fc3(ph3.fc3, primitive=ph3.primitive)
|
||||||
if is_compact_fc:
|
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:
|
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)
|
v1_sym, v2_sym, _, _ = get_drift_force_constants(ph3.fc2, primitive=ph3.primitive)
|
||||||
if is_compact_fc:
|
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:
|
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])
|
@pytest.mark.parametrize("is_compact_fc", [True, False])
|
||||||
|
|
Loading…
Reference in New Issue