Improve handling of circuit execution providers #1502
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change improves several aspects about the way
ExperimentData
works with "providers." Here "provider" is generalized beyondqiskit.providers.Provider
to any object which can provide aJob
-like object with data about an experiment's circuit execution. This generalization is needed becauseqiskit-ibm-runtime
, the main provider that Experiments integrates with, does not use theProvider
class, soqiskit.providers.Provider
andqiskit.providers.Job
with custom interface definitions usingtyping.Protocol
. The new interfaces document the API Experiments needs for working with these objects.IBMExperimentService
authentication parameters from aqiskit_ibm_runtime.QiskitRuntimeService
instance in the same way that the inference used to work withqiskit_ibm_provider.IBMProvider
.IBMExperimentService
from a backend or provider untilExperimentData
tries to communicate with the experiment service. With the fix to infer the authentication parameters fromQiskitRuntimeService
, this delay is needed to avoid breaking existing code that creates anExperimentData
instance and then tries to set a custom experiment service for it, relying on the fact that inferrence did not work forQiskitRuntimeService
, since setting the service onExperimentData
after it has already been set once raises an exception.time_per_step()
. Sinceqiskit-ibm-provider
has long been deprecated and unsupported by IBM Quantum, removing support for it is not treated as a breaking change.metadata
attribute).