'Compute roots of ``f`` by factorization in the ground domain.
Examples
>>> from sympy import Poly
>>> from sympy.abc import x
>>> Poly(x**6 - 4*x**4 + 4*x**3 - x**2).ground_roots()
{0: 2, 1: 2}'

def ground_roots(f):

    if f.is_multivariate:
        raise MultivariatePolynomialError(("can't    compute    ground    roots    of    %s" % f))
    roots = {}
    for (factor, k) in f.factor_list()[1]:
        if factor.is_linear:
            (a, b) = factor.all_coeffs()
            roots[((- b) / a)] = k
    return roots
