I am running vqe algorithm in qasm_simulator and cannot get the optimal solution. Are there any methods for finding the optimal value of depth for variational form and max_iter for optimizer parameters? What exactly does the depth parameter?

  • $\begingroup$ Hi @gosia123. What optimization method do you use? Nelder–Mead? COBYLA? SPSA? or something else. $\endgroup$ – Davit Khachatryan Mar 6 at 12:06
  • 1
    $\begingroup$ Hi, I'm using SPSA. $\endgroup$ – gosia123 Mar 6 at 12:22
  • $\begingroup$ nice. In my experience, the COBYLA wasn't working for VQE with qasm_simulator, so I thought maybe that's the problem here, but it's not :). $\endgroup$ – Davit Khachatryan Mar 6 at 12:31
  • 1
    $\begingroup$ One more thing: Don't know much about the mentioned parameters, but the shots number is also an important parameter for finding the optimal value in VQE. $\endgroup$ – Davit Khachatryan Mar 6 at 12:54

Depth is the number of repetitions of the basic circuit of the variational form. By adding more repetitions the expectation is that it can cover a larger part of the Hilbert space and hopefully include the solution space that a shallower one could not. Now each basic circuit has parameters so it can be varied. Adding more repetitions adds more parameters and results in a larger parameter space for the optimization which thus can get more difficult for the optimizer as it increases.

max_trials is used by SPSA that you are using. You may need to increase this number to allow the optimizer enough to find a minimum. SPSA will always go to that limit before returning.

I take it the solution is found ok on a state_vector simulator, its just when you try qasm simulator that you are having difficulty finding the solution.

| improve this answer | |
  • $\begingroup$ Thanks for the explanation. I got the parameters for the optimal solution on statevector_simulator, but I used there SLSQP optimizer, and this parameters don't give me the right solution on qasm_simulator. $\endgroup$ – gosia123 Mar 6 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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