def all_two_qubit_gates(qc):
    """
    Returns a list of the directions of all two-qubit gates (control, target)
    """
    res = []
    for g in qc:
        if len(g[1]) == 2:
            res.append((g[1][0].index, g[1][1].index))
    return res