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

def lcm(f, g):

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