'Returns -expr with permuted indices.
>>> from sympy import symbols, Function
>>> from sympy.physics.secondquant import PermutationOperator
>>> p,q = symbols(\'p,q\')
>>> f = Function(\'f\')
>>> PermutationOperator(p,q).get_permuted(f(p,q))
-f(q, p)'

def get_permuted(self, expr):

    i = self.args[0]
    j = self.args[1]
    if (expr.has(i) and expr.has(j)):
        tmp = Dummy()
        expr = expr.subs(i, tmp)
        expr = expr.subs(j, i)
        expr = expr.subs(tmp, j)
        return (S.NegativeOne * expr)
    else:
        return expr
