def T(a,b):
    """
    Simple interface to the kinetic function.
    >>> from pyquante2 import pgbf,cgbf
    >>> from pyquante2.basis.pgbf import pgbf
    >>> s = pgbf(1)
    >>> isclose(T(s,s),1.5)
    True

    >>> sc = cgbf(exps=[1],coefs=[1])
    >>> isclose(T(sc,sc),1.5)
    True

    >>> sc = cgbf(exps=[1],coefs=[1])
    >>> isclose(T(sc,s),1.5)
    True
    >>> isclose(T(s,sc),1.5)
    True

    """
    if b.contracted:
        return sum(cb*T(pb,a) for (cb,pb) in b)
    elif a.contracted:
        return sum(ca*T(b,pa) for (ca,pa) in a)
    return a.norm*b.norm*kinetic(a.exponent,a.powers,a.origin,
                                 b.exponent,b.powers,b.origin)