Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qiskit IBM Runtime EstimatorV2 changes the user specified default number of shots #1657

Open
DilhanM opened this issue May 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@DilhanM
Copy link

DilhanM commented May 7, 2024

Describe the bug
Related SE post.

While I am running some simulations on IBM hardware, I've noticed that the number of shots recorded in the metadata of the job is different from the number of shots I've specified.

Steps to reproduce

For example, I've run three circuits (with no gates, equivalent to Hartree Fock states in the Fermionic space) to calculate the expectation value of some Hamiltonian (which contains about 5000 Pauli words). I'm specifying the number of shots by

from qiskit_ibm_runtime import EstimatorV2 as Estimator
from qiskit_ibm_runtime import QiskitRuntimeService


shots = 4096
service = QiskitRuntimeService()
backend = service.backend("ibm_cusco")

estimator = Estimator(backend=backend) 
estimator.options.default_shots = shots

Looking at the metadata of the completed job, I see that the number of shots stored in job.result()[0].metadata['shots'] is different from the shots I specify. For instance, on IBM_cusco, I notice the job is executed with 8192, 4096, and 4096 shots respectively for a job where the number of shots I've specified is 4096.

Expected behavior

I would expect job.result()[0].metadata['shots'] to have the same number I specify as estimator.options.default_shots.

Suggested solutions

Additional Information

I observe the following trends, even though I've admittedly only performed a handful of calculations on each device.

This seems to occur only on the Eagle processors.
Number of shots performed only has increased (doubled) or stayed the same. It has not decreased.
If the number of shots have doubled, the number of randomisations have doubled as well. The default value for randomisations is 32, but it has been increased to 64 in all the calculations where the shots have doubled.

  • qiskit-ibm-runtime version: 0.23.0
  • Python version: 3.11.9
  • Operating system: MacOS Sonoma 14.4.1
@DilhanM DilhanM added the bug Something isn't working label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant