(self, **hints)
return (A*B + B*A).doit(**hints)
Evaluate anticommutator
Evaluate anticommutator
Evaluate anticommutator
def doit(self, **hints):
        """ Evaluate anticommutator """
        A = self.args[0]
        B = self.args[1]
        if isinstance(A, Operator) and isinstance(B, Operator):
            try:
                comm = A._eval_anticommutator(B, **hints)
            except NotImplementedError:
                try:
                    comm = B._eval_anticommutator(A, **hints)
                except NotImplementedError:
                    comm = None
            if comm is not None:
                return comm.doit(**hints)
        return (A*B + B*A).doit(**hints)
def doit ( self , * * hints ) : A = self . args [ 0 ] B = self . args [ 1 ] if isinstance ( A , Operator ) and isinstance ( B , Operator ) : try : comm = A . _eval_anticommutator ( B , * * hints ) except NotImplementedError : try : comm = B . _eval_anticommutator ( A , * * hints ) except NotImplementedError : comm = None if comm is not None : return comm . doit ( * * hints ) return ( A * B + B * A ) . doit ( * * hints )