mirror of https://github.com/phonopy/phonopy.git
Add test for q-points mode at Gamma with q-direction
This commit is contained in:
parent
2bbcbd2b79
commit
ada5786f9e
|
@ -6,7 +6,7 @@ from phonopy import Phonopy
|
|||
from phonopy.units import VaspToTHz
|
||||
|
||||
|
||||
def testQpoints(ph_nacl_nofcsym: Phonopy):
|
||||
def test_Qpoints(ph_nacl_nofcsym: Phonopy):
|
||||
"""Test phonon calculation at specific q-points by NaCl."""
|
||||
phonon = ph_nacl_nofcsym
|
||||
qpoints = [[0, 0, 0], [0, 0, 0.5]]
|
||||
|
@ -18,3 +18,19 @@ def testQpoints(ph_nacl_nofcsym: Phonopy):
|
|||
freqs = phonon.qpoints.frequencies[i] / VaspToTHz
|
||||
np.testing.assert_allclose(dm_eigs, eigs)
|
||||
np.testing.assert_allclose(freqs**2 * np.sign(freqs), eigs)
|
||||
|
||||
|
||||
def test_Qpoints_with_NAC_qdirection(ph_nacl: Phonopy):
|
||||
"""Test phonon calculation at specific q-points by NaCl."""
|
||||
phonon = ph_nacl
|
||||
qpoints = [[0, 0, 0]]
|
||||
phonon.run_qpoints(qpoints)
|
||||
freqs = phonon.get_qpoints_dict()["frequencies"]
|
||||
np.testing.assert_allclose(
|
||||
freqs, [[0, 0, 0, 4.61643516, 4.61643516, 4.61643516]], atol=1e-5
|
||||
)
|
||||
phonon.run_qpoints(qpoints, nac_q_direction=[1, 0, 0])
|
||||
freqs = phonon.get_qpoints_dict()["frequencies"]
|
||||
np.testing.assert_allclose(
|
||||
freqs, [[0, 0, 0, 4.61643516, 4.61643516, 7.39632718]], atol=1e-5
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue