I have been trying to implement QAOA with classical optimization of the angles $\gamma$ and $\beta$, but I I'm failing at the classical part.

In paper Quantum Approximate Optimization Algorithm: Performance, Mechanism, and Implementation on Near-Term Devices QAOA works with variational parameters $\gamma$ and $\beta$ which are first chosen randomely and afer thar is in a loop of 3 steps.

Step1. Simulating $\langle \psi_p(\gamma,\beta)|H|\psi_p(\gamma,\beta)\rangle$ with the Quantum Computer.

Step2. Measure in the Z basis. And getting $\langle \psi_p(\gamma,\beta)|H|\psi_p(\gamma,\beta)\rangle$.

Step3. Use a classical optimizesers to calculate new angles $\gamma$ and $\beta$. In the paper it says that $F_p(\vec{\gamma},\vec{\beta}) = \langle \psi_p(\gamma,\beta)|H|\psi_p(\gamma,\beta)\rangle$ is maximized.
My Questions are:

  1. How does the measured expectiaon Value from step 2 is involved in the classical optimization?
  2. Are the old $\gamma$ and $\beta$ involved in the classical optimization?
  3. Are step 1 and step 2 only done once? Becuase then the measurement in step 2 will be very unreliable.
  4. How is the function $F_p(\vec{\gamma},\vec{\beta}) = \langle \psi_p(\gamma,\beta)|H|\psi_p(\gamma,\beta)\rangle$ written classicaly so that a classical optimizer can work with is?
  5. Is there a paper where this is explained or programmed?
  • $\begingroup$ In Step 1, what you actually sample is $|\boldsymbol \gamma , \boldsymbol \beta \rangle$ after passing through the quantum circuit. This is what you measure in the computational basis. The expectation value is usually simple to calculate since $H$ (the 'cost' Hamiltonian) is diagonal in the computational basis. $\endgroup$ Oct 2, 2020 at 14:06

1 Answer 1

  1. $\langle \psi_p(\gamma,\beta)|H|\psi_p(\gamma,\beta)\rangle$ is basically the function evaluation step during the optimization. If you use a gradient-free optimizer, then it uses this information to drive its search.

  2. Depending on the optimizer if it needs them to update the parameters.

  3. You seem confused between the simulation and measurement part. $\langle \psi_p(\gamma,\beta)|H|\psi_p(\gamma,\beta)\rangle$ is the expression you want to optimize. But with a real quantum computer, you can only estimate it by doing many measurements (you get bitstrings which serve as candidates) and averaging the corresponding energies. So you need many measurements if you want a higher precision for that estimate.

  4. It is not written. As said in 3, you estimate it. The optimizer uses that information in its optimization process.

  5. There are many tutorials on many platforms such as Cirq or Pennylane.

  • $\begingroup$ Thank you so much :) $\endgroup$
    – Hannah
    Oct 5, 2020 at 20:39

Your Answer

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

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