Skip to content

Commit c7d0e3a

Browse files
committed
Add test for orbital moments
1 parent 2392900 commit c7d0e3a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/io/vasp/test_outputs.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,9 +839,32 @@ def test_soc(self):
839839
"tot": Magmom([0.0, 0.0, 0.0]),
840840
},
841841
)
842+
expected_orbmom = (
843+
{
844+
"p": Magmom([0.0, 0.0, 0.0]),
845+
"d": Magmom([0.109, 0.109, 0.109]),
846+
"tot": Magmom([0.108, 0.108, 0.108]),
847+
},
848+
{
849+
"p": Magmom([0.0, 0.0, 0.0]),
850+
"d": Magmom([-0.109, -0.109, -0.109]),
851+
"tot": Magmom([-0.108, -0.108, -0.108]),
852+
},
853+
{
854+
"p": Magmom([0.0, 0.0, 0.0]),
855+
"d": Magmom([0.0, 0.0, 0.0]),
856+
"tot": Magmom([0.0, 0.0, 0.0]),
857+
},
858+
{
859+
"p": Magmom([0.0, 0.0, 0.0]),
860+
"d": Magmom([0.0, 0.0, 0.0]),
861+
"tot": Magmom([0.0, 0.0, 0.0]),
862+
},
863+
)
842864
# test note: Magmom class uses np.allclose() when testing for equality
843865
# so fine to use == operator here
844866
assert outcar.magnetization == expected_mag, "Wrong vector magnetization read from Outcar for SOC calculation"
867+
assert outcar.orbital_moment == expected_orbmom, "Wrong orbital moments read from Outcar for SOC calculation"
845868

846869
def test_polarization(self):
847870
filepath = f"{TEST_FILES_DIR}/OUTCAR.BaTiO3.polar"

0 commit comments

Comments
 (0)