@@ -839,9 +839,32 @@ def test_soc(self):
839
839
"tot" : Magmom ([0.0 , 0.0 , 0.0 ]),
840
840
},
841
841
)
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
+ )
842
864
# test note: Magmom class uses np.allclose() when testing for equality
843
865
# so fine to use == operator here
844
866
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"
845
868
846
869
def test_polarization (self ):
847
870
filepath = f"{ TEST_FILES_DIR } /OUTCAR.BaTiO3.polar"
0 commit comments