Getting results from different QUBO samplers
One advantage of using the QUBO method is that once the matrix has been created, any QUBO solver can be used to find the minimum energy solution. However, there are some nuances that you must be aware of. In the case of D-Wave, the function we will use converts the matrix into the BQM and then sends it to the Amazon Braket D-Wave device. In the case of sending the QUBO to Rigetti, the function must create the quantum circuit and then optimize the QAOA parameters. Also, the circuit for Rigetti is slightly different because it does not utilize ZZ gates; instead, it uses a combination of CX and CZ gates. For now, it is only necessary to know that these differences exist and have been encapsulated within the solver functions we will use here. If you are interested in diving into how to prepare each matrix for the specific solver, as well as how to interpret the results, please review the various functions.
Now, let’s solve the Knapsack...