def u2q(u1, u2, warnings=True):
    """
    Convert the linear and quadratic terms of the quadratic limb-darkening
    parameterization -- called `u_1` and `u_2` in Kipping 2013 or `a` and `b` in
    Claret et al. 2013 -- and convert them to `q_1` and `q_2` as described in
    Kipping 2013:

    http://adsabs.harvard.edu/abs/2013MNRAS.435.2152K

    Parameters
    ----------
    u1 : float
        Linear component of quadratic limb-darkening

    u2 : float
        Quadratic component of quadratic limb-darkening

    Returns
    -------
    (q1, q2) : tuple of floats
        Kipping (2013) style quadratic limb-darkening parameters
    """
    q1 = (u1 + u2)**2
    q2 = 0.5*u1/(u1+u2)
    if warnings and (u1 < 0 or u2 < 0):
        print("WARNING: The quadratic limb-darkening parameters " +
              "u1={0:.3f} or u2={0:.3f} violate Kipping's ".format(u1, u2) +
              "conditions for a monotonically increasing or everywhere-" +
              "positive intensity profile. Returning them as is.")
    return q1, q2