I've come across several of the QAOA tutorials, and yet I'm afraid I haven't found any explanation on this. According to the Qiskit tutorial on QAOA, the cost function for the target problem has a series of the real-valued weights $W_{(Q,\bar{Q})}$, which is still present as it is in the problem Hamiltonian $H$ derived from the cost function.

My question is, how can one actually put these real-valued numbers into the Hamiltonian? As far as I understand they represent the energy of the system altogether, but when it comes to implementing QAOA on a real quantum computer I wonder how you can manage to encode those real values as energy in the Hamiltonian.


1 Answer 1


The real-valued weights W from the original problem are not encoded for the quantum computer to evaluate. Instead a classical routine applies them once this classical routine has gained access to the expectations that were indeed obtained from measurement samples of a real quantum computer.

The Qiskit documentation actually has some description of this in the Appendix: Evaluation on a quantum computer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.