code: def random_gate(qubits: Union[int, Qubits]) -> Gate:
      r
      N, qubits = qubits_count_tuple(qubits)
      unitary = scipy.stats.unitary_group.rvs(2**N)
      return Gate(unitary, qubits=qubits, name='RAND{}'.format(N))
docs: r"""Returns a random unitary gate on K qubits.
  
      Ref:
          "How to generate random matrices from the classical compact groups"
          Francesco Mezzadri, math-ph/0609050