'Returns the polynomial GCD of ``f`` and ``g``.
Examples
>>> from sympy import Poly
>>> from sympy.abc import x
>>> Poly(x**2 - 1, x).gcd(Poly(x**2 - 3*x + 2, x))
Poly(x - 1, x, domain=\'ZZ\')'

def gcd(f, g):

    (_, per, F, G) = f._unify(g)
    if hasattr(f.rep, 'gcd'):
        result = F.gcd(G)
    else:
        raise OperationNotSupported(f, 'gcd')
    return per(result)
