def U2(p, r0, r1):
    """
    General two body gate arxiv:1807.00800. Uses 15 parameters.
    
    p: list or tuple of 15 floats, angles for the rotation gates.
    r0: int, first register/qubit to apply the gate to.
    r1: int, second register/qubit to apply the gate to.
    
    returns: list, algorithm.
    """
    return [
        "rz(%g, %d)" % (p[0], r0),
        "ry(%g, %d)" % (p[1], r0),
        "rz(%g, %d)" % (p[2], r0),
        "rz(%g, %d)" % (p[3], r1),
        "ry(%g, %d)" % (p[4], r1),
        "rz(%g, %d)" % (p[5], r1),
        "cx(%d, %d)" % (r1, r0),
        "rz(%g, %d)" % (p[6], r0),
        "ry(%g, %d)" % (p[7], r1),
        "cx(%d, %d)" % (r0, r1),
        "ry(%g, %d)" % (p[8], r1),
        "cx(%d, %d)" % (r1, r0),
        "rz(%g, %d)" % (p[9], r0),
        "ry(%g, %d)" % (p[10], r0), 
        "rz(%g, %d)" % (p[11], r0),
        "rz(%g, %d)" % (p[12], r1), 
        "ry(%g, %d)" % (p[13], r1), 
        "rz(%g, %d)" % (p[14], r1),
    ]