artiste-qb-net / qubiter

Python tools for reading, writing, compiling, simulating quantum computer circuits. Includes numpy and tensorflow backends. “Quantum Space, the final frontier. These are the voyages of the starship Qubiter. Its five-year mission: to explore strange new worlds, to seek out new life and new civilizations, to boldly go where no man has gone before.”
Other
120 stars 31 forks source link

Controls() #45

Open bsiegelwax opened 8 months ago

bsiegelwax commented 8 months ago

From https://nbviewer.org/github/artiste-qb-net/qubiter/blob/master/qubiter/jupyter_notebooks/Say_Hello_World_With_Qubiter.ipynb

trols = Controls(num_qbits, {1:True, 2:False, 3:False})

generated

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[<ipython-input-19-b5dfb9a1e5a2>](https://localhost:8080/#) in <cell line: 4>()
      2 rads = 30*np.pi/180
      3 ax = 2 # y axis
----> 4 trols = Controls(num_qbits, {1:True, 2:False, 3:False})
      5 wr.write_controlled_one_qbit_gate(
      6     target_pos, trols, OneQubitGate.rot_ax, [rads, ax])

TypeError: Controls.__init__() takes 2 positional arguments but 3 were given

in Colab.