Gates and circuits for Grover’s algorithm
Qiskit’s PhaseOracle
and Grover
classes provide turnkey solutions to complicated problems. Turnkey solutions can get results quickly and painlessly, but solutions of this kind have limitations. Turnkey solutions seldom apply to problems that have unusual constraints, and unusual constraints pop up often in real life. What’s more, when you apply a turnkey solution, you gain little or no insight about the way you solved the problem.
So, in this section, we will drill down into the circuitry to implement Grover’s algorithm. We will focus on satisfiability because it applies to so many kinds of problems.
Gates for the oracle
In Chapter 7, we introduced a circuit to demonstrate phase kickback. I’ve copied a drawing of the circuit here:
Figure 8.26 – The target kicks the change back to its source
Phase kickback isn’t limited to gates with two qubits. Figure 8.27 contains a three...