Adding more coins – straight and cheating
Up until now, our recipes have been mainly of the 1- or 2-qubit sort. With our simulator, there is nothing stopping us from adding more qubits to our circuits at will, with the caveat that each additional qubit will require more and more processing power from the system on which your simulator runs. For example, the IBM Quantum Experience® qasm_simulator
runs on an IBM POWER9™ server and maxes out at around 32 qubits.
In this recipe, we will create two 3-qubit quantum programs, one multi-coin toss, and one new entangled state called GHZ (for Greenberger–Horne–Zeilinger state).
Instead of doing this by creating two separate files, we will take a look at a new command, reset()
. As the name implies, using the reset()
command with a qubit sets it back to its original state of , ready to start a new quantum computing round. In this example, we use reset()
to run two quantum programs in a row, writing to two...