Skip to content

Commit a7a71a7

Browse files
committed
Add test for orbital moments
1 parent e6a3327 commit a7a71a7

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
@@ -932,9 +932,32 @@ def test_soc(self):
932932
"tot": Magmom([0.0, 0.0, 0.0]),
933933
},
934934
)
935+
expected_orbmom = (
936+
{
937+
"p": Magmom([0.0, 0.0, 0.0]),
938+
"d": Magmom([0.109, 0.109, 0.109]),
939+
"tot": Magmom([0.108, 0.108, 0.108]),
940+
},
941+
{
942+
"p": Magmom([0.0, 0.0, 0.0]),
943+
"d": Magmom([-0.109, -0.109, -0.109]),
944+
"tot": Magmom([-0.108, -0.108, -0.108]),
945+
},
946+
{
947+
"p": Magmom([0.0, 0.0, 0.0]),
948+
"d": Magmom([0.0, 0.0, 0.0]),
949+
"tot": Magmom([0.0, 0.0, 0.0]),
950+
},
951+
{
952+
"p": Magmom([0.0, 0.0, 0.0]),
953+
"d": Magmom([0.0, 0.0, 0.0]),
954+
"tot": Magmom([0.0, 0.0, 0.0]),
955+
},
956+
)
935957
# test note: Magmom class uses np.allclose() when testing for equality
936958
# so fine to use == operator here
937959
assert outcar.magnetization == expected_mag, "Wrong vector magnetization read from Outcar for SOC calculation"
960+
assert outcar.orbital_moment == expected_orbmom, "Wrong orbital moments read from Outcar for SOC calculation"
938961

939962
assert outcar.noncollinear is True
940963

0 commit comments

Comments
 (0)