2
$\begingroup$

I am using QAOA to solve maxcut problem. It takes a very long time to simulate 10 qubits and I never get the results. Is there a way to simulate faster for larger qubit?

Here is my code

backend = provider.get_backend('ibmq_qasm_simulator')
seed = 50

cobyla = COBYLA()
cobyla.set_options(maxiter=250)
qaoa = QAOA(qubitOp, cobyla, 3)
qaoa.random_seed = seed

quantum_instance = QuantumInstance(backend=backend,seed_transpiler=seed,skip_qobj_validation=False)

result = qaoa.run(quantum_instance)
$\endgroup$
  • $\begingroup$ How long is "very long"? Some of these algorithms can take a decent chunk of time to complete simply because of the amount of calculations they must go through. $\endgroup$ – Matthew Stypulkoski Sep 30 at 20:06
  • $\begingroup$ For a 10 node graph, it took 654 seconds for just one shot $\endgroup$ – user8586 Oct 1 at 15:27
3
$\begingroup$

There are a few ways to speed up this execution in Aqua. One way in the case of noiseless simulation is to use SLSQP instead of Cobyla, which we've noticed empirically seems to converge faster in noiseless environments. Another is to set skip_qobj_validation=True in the QuantumInstance init. I would start with these two and see how they do. QAOA in general can be tricky because the initial values can have a big impact on the execution time, and a graph as large as 10 nodes can have many singular values (saddle points). If you enable logging in Aqua, you can see whether the bottleneck is the circuit simulation or the number of iterations before convergence.

$\endgroup$

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.