Questions
- Is this circuit reversible?
- In this chapter’s Coding Deutsch’s algorithm section code, change the number of shots from 1 to 100. Then, run the modified code on a real quantum computer. How many of those 100 shots give you the correct answer (constant versus balanced)?
Run the modified code more than once. Observe the variation in the number of correct shots from one run to another.
- When we run Deutsch’s algorithm, the result depends on whether or not there’s a CNOT gate inside the oracle. But the result doesn’t depend on whether or not there’s an X gate in the oracle. Why not?
- Does the following circuitry implement the Opposite_of function? Why, or why not?
- Look up the
compose
method belonging to theQuantumCircuit
class in the Qiskit documentation.
Modify the get_oracle
code in this chapter’s Coding Deutsch’s algorithm...