qiskit-experiments icon indicating copy to clipboard operation
qiskit-experiments copied to clipboard

Job IDs are not loaded

Open TsafrirA opened this issue 1 year ago • 3 comments

Describe the bug Job IDs are not loaded when loading an experiment from the service.

Steps to reproduce

from qiskit_experiments.library import FineFrequency
from qiskit_ibm_experiment import IBMExperimentService
from qiskit_ibm_provider import IBMProvider

service = IBMExperimentService()
provider = IBMProvider(instance="XXX")
backend = provider.get_backend("XXX")

exp = FineFrequency(physical_qubits=[0],delay_duration=160,backend=backend)
expdata = exp.run().block_for_results()
print(expdata.jobs()) # Job ID exists.

expdata.save()
load_expdata = ExperimentData.load(expdata.experiment_id, service)
print(load_expdata.jobs()) # Prints an empty list

Expected behavior The Job ID should be loaded correctly from the service (the ID appears correctly in IQX)

Additional Information

  • Qiskit IBM Runtime version: 0.11.2
  • Python version: 3.9
  • Operating system: Windows

TsafrirA avatar Aug 06 '23 12:08 TsafrirA

(I am not sure if this bug report really belongs here or in Qiskit Experiments)

TsafrirA avatar Aug 06 '23 12:08 TsafrirA

The current behavior is that jobs will only be loaded if a provider is given, like load_expdata = ExperimentData.load(expdata.experiment_id, service, provider), but this is confusing. We already recommend in the documentation that users do service = ExperimentData.get_service_from_backend(backend) to get the service, in which case there's already a provider involved. Perhaps we should just require a provider when loading.

coruscating avatar Aug 07 '23 16:08 coruscating

Thanks @coruscating ! Adding the provider argument raised an error for some reason, but the get_service_from_backend(backend) did the trick.

TsafrirA avatar Aug 08 '23 07:08 TsafrirA