def _transl2uga(self, tensor: Tensor): """Translate a tensor object in terms of the fermion operators. This is an internal utility. The resulting tensor has the internal '_uga_dr' drudge object as its owner. """ return Tensor(self, tensor.subst_all(self._agp2uga_defs).terms)
def _transl2uga(self, tensor: Tensor): """Translate a tensor object in terms of the fermion operators. This is an internal utility. The resulting tensor has the internal AGP drudge object as its owner. """ chk = tensor.bind(self._agp_dr._isAGP) # for t in trms: # if ~self._agp_dr._isAGP(t): # raise ValueError('Unexpected generator of the AGP Algebra',vec) return Tensor(self, tensor.subst_all(self._agp2uga_defs).terms)
def _transl2agp(self, tensor: Tensor): """Translate a tensor object in terms of the fermion operators. This is an internal utility. The resulting tensor has the internal AGP drudge object as its owner. """ chk = tensor.bind(self._isUGA) # for t in trms: # if ~_isUGA(t): # raise ValueError('Unexpected generator of the Unitary Group',vec) return Tensor(self._agp_dr, tensor.subst_all(self._uga2agp_defs).terms)
def spin_flip_to_fermi(self, tnsr: Tensor): """Substitute all the Spin flip operators with their respective fermionic strings""" gen_idx = self.all_orb_dumms[0] sp_def = self.define( SPIN_RAISE, gen_idx, cr[gen_idx, SpinOneHalf.UP] * an[gen_idx, SpinOneHalf.DOWN]) sm_def = self.define( SPIN_LOWER, gen_idx, cr[gen_idx, SpinOneHalf.DOWN] * an[gen_idx, SpinOneHalf.UP]) spin_defs = [sp_def, sm_def] return Tensor(self, tnsr.subst_all(spin_defs).terms)