5.2 Using QAOA with Qiskit
With everything that we have learned in the previous sections of this chapter and what we already know about Qiskit from Chapter 2, The Tools of the Trade in Quantum Computing, and Section 3.2.2, we could implement our own Qiskit version of QAOA. However, there is no need for that! As we shall show in this section, the Qiskit Optimization package provides all that is necessary to run QAOA on both quantum simulators and actual quantum computers. Moreover, it includes a set of tools to work directly with problems written under the QUBO formalism. As a matter of fact, in this section, we will also see how, underneath the hood, Qiskit uses the very same mathematical concepts that we have been studying.
Let’s start by explaining how to work with QAOA in Qiskit when we already have the problem Hamiltonian.
5.2.1 Using QAOA with Hamiltonians
If we have the Hamiltonian that encodes our optimization problem, it is very easy to use Qiskit’s QAOA implementation...