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