Solving Deutsch’s problem
The circuit that solves Deutsch’s problem has very few gates. It doesn’t look very complicated. But to understand why the circuit works, you have to understand some important concepts. This section covers those critical concepts.
Phase kickback
In Chapter 4, we introduced the controlled NOT (CNOT) gate with its control and target qubits. In a typical scenario, the control qubit tells the target qubit what to do, and the target qubit obeys willingly. But what about a non-typical scenario? Is there such a thing as a disobedient target qubit? To find out, let’s do an experiment.
Run the following code:
from qiskit import QuantumCircuitfrom qiskit.quantum_info import Statevector from qiskit.visualization \ import plot_bloch_multivector circ = QuantumCircuit(2) circ.x(1) circ.h(0) circ.h(1) display(circ.draw('latex')) state = Statevector(circ)
display(plot_bloch_multivector(state, reverse_bits...