Skip to content

Commit

Permalink
Allow importing SamplerV1 and EstimatorV1 (#1477) (#1478)
Browse files Browse the repository at this point in the history
Right now, users can't import `qiskit_ibm_runtime.SamplerV1` and `qiskit_ibm_runtime.EstimatorV1` because we only expose the aliases `Sampler` and `Estimator`. That gets in the way of users being explicit about which primitive version they're using.

This also is resulting in the API docs not including the pages for both the V1 and V2 primitives in Qiskit/documentation#973 because we didn't tell autosummary about them.
  • Loading branch information
Eric-Arellano authored Mar 6, 2024
1 parent d99688a commit a2782f1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions qiskit_ibm_runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@
QiskitRuntimeService
Estimator
EstimatorV1
EstimatorV2
Sampler
SamplerV1
SamplerV2
Session
IBMBackend
RuntimeJob
Expand All @@ -169,8 +173,16 @@
from .utils.utils import setup_logger
from .version import __version__

from .estimator import EstimatorV2, EstimatorV1 as Estimator
from .sampler import SamplerV2, SamplerV1 as Sampler
from .estimator import ( # pylint: disable=reimported
EstimatorV2,
EstimatorV1,
EstimatorV1 as Estimator,
)
from .sampler import ( # pylint: disable=reimported
SamplerV2,
SamplerV1,
SamplerV1 as Sampler,
)
from .options import Options, EstimatorOptions, SamplerOptions

# Setup the logger for the IBM Quantum Provider package.
Expand Down

0 comments on commit a2782f1

Please sign in to comment.