code: def benchmark(N, gates):
      
      qubits = list(range(0, N))
      ket = qf.zero_state(N)
  
      for n in range(0, N):
          ket = qf.H(n).run(ket)
  
      for _ in range(0, (gates-N)//3):
          qubit0, qubit1 = random.sample(qubits, 2)
          ket = qf.X(qubit0).run(ket)
          ket = qf.T(qubit1).run(ket)
          ket = qf.CNOT(qubit0, qubit1).run(ket)
  
      return ket.vec.tensor
docs: Create and run a circuit with N qubits and given number of gates