Skip to content

Commit b8a3f66

Browse files
committed
Add test for orbital moments
1 parent 6a5dac2 commit b8a3f66

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
@@ -837,9 +837,32 @@ def test_soc(self):
837837
"tot": Magmom([0.0, 0.0, 0.0]),
838838
},
839839
)
840+
expected_orbmom = (
841+
{
842+
"p": Magmom([0.0, 0.0, 0.0]),
843+
"d": Magmom([0.109, 0.109, 0.109]),
844+
"tot": Magmom([0.108, 0.108, 0.108]),
845+
},
846+
{
847+
"p": Magmom([0.0, 0.0, 0.0]),
848+
"d": Magmom([-0.109, -0.109, -0.109]),
849+
"tot": Magmom([-0.108, -0.108, -0.108]),
850+
},
851+
{
852+
"p": Magmom([0.0, 0.0, 0.0]),
853+
"d": Magmom([0.0, 0.0, 0.0]),
854+
"tot": Magmom([0.0, 0.0, 0.0]),
855+
},
856+
{
857+
"p": Magmom([0.0, 0.0, 0.0]),
858+
"d": Magmom([0.0, 0.0, 0.0]),
859+
"tot": Magmom([0.0, 0.0, 0.0]),
860+
},
861+
)
840862
# test note: Magmom class uses np.allclose() when testing for equality
841863
# so fine to use == operator here
842864
assert outcar.magnetization == expected_mag, "Wrong vector magnetization read from Outcar for SOC calculation"
865+
assert outcar.orbital_moment == expected_orbmom, "Wrong orbital moments read from Outcar for SOC calculation"
843866

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

0 commit comments

Comments
 (0)