Qiskit / qiskit-ibm-runtime

IBM Client for Qiskit Runtime
https://docs.quantum.ibm.com/api/qiskit-ibm-runtime
Apache License 2.0
150 stars 154 forks source link

Using FakeBackend in local testing mode fails if trying to access job metrics #1939

Open nonhermitian opened 3 weeks ago

nonhermitian commented 3 weeks ago

Describe the bug Jobs from real QPUs have a metrics method that allows for grabbing timing information. However this is not the case if passing a simulator where one gets the error:

AttributeError: 'PrimitiveJob' object has no attribute 'metrics'

Steps to reproduce Try to calll the methods attribute on a PrimitiveJob

Expected behavior I would expect the jobs to have the same attributes and methods given that local testing mode is supposed to verify that code sent to the real systems works as it should

Suggested solutions Unify the job types

Additional Information

kt474 commented 2 weeks ago

PrimitiveJob is imported from Qiskit so if we wanted to add methods like metrics we'd have to make updates there first.