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

(fix): deprecate class qiskit_ibm_runtime.IBMSampler for the next release #342

Merged
merged 5 commits into from Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions qiskit_ibm_runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ def result_callback(job_id, result):
RuntimeDecoder
IBMRuntimeService
IBMEstimator
IBMSampler
"""

import logging
Expand All @@ -245,7 +244,6 @@ def result_callback(job_id, result):
from .version import __version__

from .ibm_estimator import IBMEstimator
from .ibm_sampler import IBMSampler
from .estimator import Estimator
from .sampler import Sampler

Expand Down
69 changes: 0 additions & 69 deletions qiskit_ibm_runtime/ibm_sampler.py

This file was deleted.

3 changes: 1 addition & 2 deletions qiskit_ibm_runtime/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
from .qiskit_runtime_service import QiskitRuntimeService
from .runtime_session import RuntimeSession


class Sampler(BaseSampler):
rathishcholarajan marked this conversation as resolved.
Show resolved Hide resolved
rathishcholarajan marked this conversation as resolved.
Show resolved Hide resolved
"""Class for interacting with Qiskit Runtime Sampler primitive service.
"""Class for interacting with Qiskit Runtime Sampler primitive service. Additionally, the successor of deprecated ``IBMSampler`` class.
rathishcholarajan marked this conversation as resolved.
Show resolved Hide resolved
rathishcholarajan marked this conversation as resolved.
Show resolved Hide resolved

Qiskit Runtime Sampler primitive service calculates probabilities or quasi-probabilities
of bitstrings from quantum circuits.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ deprecations:
and :class:`~qiskit_ibm_runtime.IBMSampler` classes have been deprecated and will be removed
in a future release. Use :class:`~qiskit_ibm_runtime.QiskitRuntimeService`,
:class:`~qiskit_ibm_runtime.Estimator` and :class:`~qiskit_ibm_runtime.Sampler` classes
instead. See upgrade notes section for a detailed explanation with examples.
instead. See upgrade notes section for a detailed explanation with examples.
35 changes: 35 additions & 0 deletions releasenotes/notes/remove-ibm-sampler-7779165095fd2a5f.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
upgrade:
- |
:class:`~qiskit_ibm_runtime.IBMSampler` class is now deprecated and removed
with this `remove-ibm-sampler` release. Use
:class:`~qiskit_ibm_runtime.Sampler` class going forward.
rathishcholarajan marked this conversation as resolved.
Show resolved Hide resolved

Example:

Before::

from qiskit_ibm_runtime import IBMRuntimeService, IBMSampler
service = IBMRuntimeService(channel="ibm_cloud", token="...", instance="...")

sampler_factory = IBMSampler(service=service, backend="ibmq_qasm_simulator")

with sampler_factory(circuits=[qc], parameters="...") as sampler:
result = sampler(circuit_indices=[0], ...)

After::

from qiskit_ibm_runtime import QiskitRuntimeService, Sampler
service = QiskitRuntimeService(channel="ibm_cloud", token="...", instance="...")

with Sampler(
circuits=[qc],
parameters="...",
service=service,
options={ "backend": "ibmq_qasm_simulator" }, # or IBMBackend<"ibmq_qasm_simulator">
) as sampler:
result = sampler(circuit_indices=[0], ...)
deprecations:
- |
Deprecated :class:`~qiskit_ibm_runtime.IBMSampler` class has been removed with its dependencies.
Use :class:`~qiskit_ibm_runtime.Sampler` class instead. See upgrade notes section for a detailed explanation with examples.
rathishcholarajan marked this conversation as resolved.
Show resolved Hide resolved
104 changes: 0 additions & 104 deletions test/integration/test_ibm_sampler.py

This file was deleted.