[docs]defget_ispin(self):"""Returns the spin-treatment level."""returnself.ispin
[docs]defget_spin_num(self):"""Returns number of spin channels."""ns=self.ispinifself.ispin==4:ns=1returnns
[docs]defset_ispin(self,ispin):"""Sets spin-treatment level. One can set ispin either as an int or str. The correspondence is as follows - 1 == "degenerate" - 2 == "collinear" - 4 == "non-collinear" Args: ispin (int, str): spin-treatment level. """ifisinstance(ispin,str):ifispin=="degenerate":ispin=1elifispin=="collinear":ispin=2elifispin=="non-collinear":ispin=4else:raiseException("Invalid ispin value: "+ispin+".")elifnotisinstance(ispin,int):raiseException("Argument ispin must be an int or a str.")ifispinnotin[1,2,4]:raiseException("Invalid hamiltonian.ispin value: "+ispin+".")self.ispin=ispin
[docs]defset_soc(self,soc):"""Sets soc switch. Args: soc (bool): If True then SOC is included and it isn't otherwise. """ifnotisinstance(soc,bool):raiseException("Argument soc must be a bool.")self.soc=socifself.soc:self.set_ispin(4)