def _single_qubit_cue(rng: np.random.Generator) -> cirq.Gate:
    """Randomly generate a CUE gate.

    Args:
        rng: Random number generator

    Returns:
        cirq gate
    """

    # phasedxz parameters are distinct between -1 and +1
    x_exponent, z_exponent, axis_phase_exponent = 1 - 2 * rng.random(size=3)

    return cirq.PhasedXZGate(
        x_exponent=x_exponent, z_exponent=z_exponent, axis_phase_exponent=axis_phase_exponent
    )
Randomly generate a CUE gate.

    Args:
        rng: Random number generator

    Returns:
        cirq gate
    
cirq-core/cirq/transformers/randomized_measurements.py