def _rand_3qubit_gate(N=None, controls=None, k=None): if N is None: return _rand_gate_U else: return gate_expand_3toN(_rand_gate_U, N, controls, k)