def _ctmp_err_rate_2_q(gen, g_mat_dict) -> float:
    """Compute the 2 qubit error rate for a given generator."""
    # pylint: disable=invalid-name
    g_mat = g_mat_dict[gen]
    b, a, _ = gen
    r = g_mat[int(b, 2), int(a, 2)]
    return r