'Return a dictionary mapping terms to their coefficient.
Since the dictionary is a defaultdict, inquiries about terms which
were not present will return a coefficient of 0. The dictionary
is considered to have a single term.
Examples
>>> from sympy.abc import a, x
>>> (3*a*x).as_coefficients_dict()
{a*x: 3}
>>> _[a]
0'

@cacheit
def as_coefficients_dict(self):

    d = defaultdict(int)
    args = self.args
    if ((len(args) == 1) or (not args[0].is_Number)):
        d[self] = S.One
    else:
        d[self._new_rawargs(*args[1:])] = args[0]
    return d
