1
$\begingroup$

I tried to use the QAOA to solve the MaxCut problem on a 10 nodes weighted graph and run the simulation on qiskit from $p = 1$ to $p = 6$. I was expecting to get closer to the real solution as $p$ grew but I got the opposite. I reached the solution at $p = 3$ and then it started to drift away. Why did it happen?

enter image description here

enter image description here

enter image description here

$\endgroup$
6
  • $\begingroup$ What is $p$? If the energy is not at minimum, the weight $B$ assigned for your cost of connections might be too large (or too small), so it might be worth trying to set B to a small (or large) value and check the result. $\endgroup$
    – James
    Jun 25, 2023 at 0:56
  • $\begingroup$ Few details are missing to understand what’s going on. Do you use a noiseless simulator? $\endgroup$
    – Ohad
    Jun 25, 2023 at 5:27
  • $\begingroup$ @James $p$ is the depth of the circuit, the number of layers of the QAOA. But if the weight are too large (or too small) why it finds the result at $p=3$? Does it become a problem only for large $p$? $\endgroup$ Jun 25, 2023 at 8:37
  • $\begingroup$ @Ohad I am using the ibmq_qasm_simulator without noise. $\endgroup$ Jun 25, 2023 at 8:37
  • $\begingroup$ What optimizer do you use? Is the number of optimizer iterations in each execution with different $p$ is constant? $\endgroup$
    – Ohad
    Jun 27, 2023 at 10:24

1 Answer 1

1
$\begingroup$

If the angles that were selected are not good enough, you could get worse approximation ratios as p increases. Assuming that you do not have optimal angles for each round p, what angle finding strategy did you use? Increasing the amount of computation for the angle finding could make your results better.

$\endgroup$
4
  • $\begingroup$ I let the algorithm choose the starting angles randomly. What strategy would you recommend to improve results? $\endgroup$ Jun 26, 2023 at 7:44
  • $\begingroup$ Starting angles being random is fine - in fact it is probably a good choice because we usually do not really know what good angles might be a-priori. But the important thing is how good angles are learned. You could brute-force good angle combinations, but that costs quite a bit. There are a number of classical machine learning algorithms that are reasonably good, which one works best depends on your problem and the number of parameters etc. Qiskit has a library of some good classical optimizers $\endgroup$ Jun 26, 2023 at 19:23
  • $\begingroup$ I am using the COBYLA optimizer from that library with tolerance $10^{-4}$ COBYLA(tol=1e-4) $\endgroup$ Jun 27, 2023 at 16:05
  • 1
    $\begingroup$ Yeah that is certainly a reasonable choice. It could be that the optimizer does not always find good angles though. Maybe try re-executing the learning procedure and see if the resulting angles agree. Or maybe try increasing the maxiter parameter. The relevant question is if you find very good angles and increasing p does not improve the mean approximation ratio, then there is a problem in the QAOA circuit. But I am guessing it just the angle finding being difficult. $\endgroup$ Jun 27, 2023 at 20:12

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.