'Convert algebraic coefficients to rationals.
Examples
>>> from sympy import Poly, I
>>> from sympy.abc import x
>>> Poly(x**2 + I*x + 1, x, extension=I).lift()
Poly(x**4 + 3*x**2 + 1, x, domain=\'QQ\')'

def lift(f):

    if hasattr(f.rep, 'lift'):
        result = f.rep.lift()
    else:
        raise OperationNotSupported(f, 'lift')
    return f.per(result)
