2
$\begingroup$

I am interested to know whether there is a quick and elegant way of increasing the number of shots (more than 8192 shots) on IBM hardware when running variational algorithms like VQE or QAOA.

I know that within Qiskit, I can specify: backend._configuration.max_shots= shots to change the number of max_shots but this only works for simulator. I can't increase the shots parameter to go over 8192 shots when I set my backend as one of the real hardware. That is, if I specify the following:

hardware_backend = provider.get_backend('ibmq_valencia ')
maxshots = 20000
hardware_backend._configuration.max_shots= maxshots
quantum_instance = QuantumInstance(hardware_backend, shots = maxshots, initial_layout = None,
                                   optimization_level = 3)  

then upon executing the circuit, I will have an error message:

Error is : The number of shots in the Qobj (20000) is higher than the number of shots supported by the device (8192). 

Is there a quick and elegant way to overcome this issue within Qiskit? Thank you!

$\endgroup$

1 Answer 1

2
$\begingroup$

According to my knowledge, 8192 is a maximum of shots. I think that the reason is fair timesharing as nowadays there are many users of IBM Q.

To get better results from VQE, I can only recommend to run your task several times and then pick up the best solution, i.e. the one wiht the lowest (highest) value of the optimized function.

$\endgroup$
3
  • 1
    $\begingroup$ I am interested to increase the shots in each evaluation to increase the accuracy of the expectation. To get within the chemical precision, one would need in the order of million shots.. I am just trying to increase my shots to says 100,000 and see how thing goes first. What I can do is to write my own VQE function where I can run multiple jobs and combine the results but I am feeling a little lazy about it :) $\endgroup$
    – KAJ226
    Commented Dec 23, 2020 at 16:46
  • 1
    $\begingroup$ @KAJ226: I understood. However, it seems that there are limitation imposed by IBM. Maybe, there is such possibility in commercial version of IBM Q.... $\endgroup$ Commented Dec 24, 2020 at 7:30
  • 1
    $\begingroup$ Like you said, 8192 shots is the max shots threshold... and there is just no way around it. So I decided to stop being lazy and write my own VQE function and to not use VQE module within Aqua to create more flexibility. I understand that the limitation on number of shots and circuits must be imposed to prevent someone from abusing the system. But I think we can agree that shots counts should play an effect in how precise your converged result is in variational quantum algorithms.. It should scales as $O(1/ \epsilon^2)$ to be more specific. Then there is the noise problem.. :( $\endgroup$
    – KAJ226
    Commented Jan 20, 2021 at 20:27

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.