'Square a polynomial ``f``.
Examples
>>> from sympy import Poly
>>> from sympy.abc import x
>>> Poly(x - 2, x).sqr()
Poly(x**2 - 4*x + 4, x, domain=\'ZZ\')
>>> Poly(x - 2, x)**2
Poly(x**2 - 4*x + 4, x, domain=\'ZZ\')'

def sqr(f):

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