I am running variational algorithms using QuasmSimulator, which means I am performing a classical optimization where the cost function is computed running a quantum circuit. Moreover, for the optimizer to converge I need high accuracy, which implies a large number of shots.
These two things combined make a run last for days on my laptop, even for a few qubits. Thus, I am trying to run shots in parallel to save some time. Qiskit has a backend option for this:
from qiskit.providers.aer import QasmSimulator backend = QasmSimulator(method="automatic", max_parallel_threads=6, max_parallel_shots=6) ... the rest of the code... job = execute(circ, backend, shots=nshots)
However, when setting this option I see no difference, neither in runtime nor in CPU usage from Window's task manager. I think the problem could be that normally a python script just uses one core, so when Qiskit runs it "thinks" that indeed you have one core only. Any suggestion?
I am using Qiskit 0.23.0
(Note that I asking specifically about parallel shots and not parallel circuits, although that might also help with another issue I have)