Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Deprecate qiskit-ibm-provider #832

Merged
merged 5 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Qiskit IBM Quantum Provider
# Qiskit IBM Quantum Provider (_NOW DEPRECATED_)

[![License](https://img.shields.io/github/license/Qiskit/qiskit-ibm-provider.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)
[![CI](https://github.com/Qiskit/qiskit-ibm-provider/actions/workflows/ci.yml/badge.svg)](https://github.com/Qiskit/qiskit-ibm-provider/actions/workflows/ci.yml)
Expand All @@ -7,6 +7,16 @@
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Coverage Status](https://coveralls.io/repos/github/Qiskit/qiskit-ibm-provider/badge.svg?branch=main)](https://coveralls.io/github/Qiskit/qiskit-ibm-provider?branch=main)

---

**_PLEASE NOTE:_** _As of version 0.11.0, released in April 2024, `qiskit-ibm-provider` has been deprecated
with its support ending and eventual archival being no sooner than 3 months from that date. The
function provided by `qiskit-ibm-provider` has been moved to [qiskit-ibm-runtime](https://github.com/Qiskit/qiskit-ibm-runtime).
Please see the [Runtime migration Guide] for more details. We encourage you
to migrate over at your earliest convenience._

---

**Qiskit** is an open-source SDK for working with quantum computers at the level of circuits, algorithms, and application modules.

This project contains a provider that allows accessing the **[IBM Quantum]**
Expand Down Expand Up @@ -112,3 +122,4 @@ project at different levels. If you use Qiskit, please cite as per the included
[BibTeX file]: https://github.com/Qiskit/qiskit/blob/master/Qiskit.bib
[Apache License 2.0]: https://github.com/Qiskit/qiskit-ibm-provider/blob/main/LICENSE.txt
[migration guide]: https://github.com/Qiskit/qiskit-ibm-provider/blob/6be5f3297ede75bb062b20601058b55a397668e3/docs/tutorials/Migration_Guide_from_qiskit-ibmq-provider.ipynb
[Runtime migration guide]: https://docs.quantum.ibm.com/api/migration-guides/qiskit-runtime
11 changes: 11 additions & 0 deletions qiskit_ibm_provider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"""

import logging
import warnings
from typing import List, Optional, Union
from datetime import datetime, timedelta

Expand All @@ -100,6 +101,16 @@
QISKIT_IBM_PROVIDER_LOG_FILE = "QISKIT_IBM_PROVIDER_LOG_FILE"
"""The environment variable name that is used to set the file for the IBM Quantum logger."""

warnings.warn(
f"The package {__name__} is being deprecated. "
"Please see "
"https://docs.quantum.ibm.com/api/migration-guides/qiskit-runtime"
" to get instructions on how to migrate to "
"qiskit-ibm-runtime (https://github.com/Qiskit/qiskit-ibm-runtime).",
DeprecationWarning,
stacklevel=2,
)


def least_busy(backends: List[Backend]) -> Backend:
"""Return the least busy backend from a list.
Expand Down
12 changes: 4 additions & 8 deletions qiskit_ibm_provider/jupyter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,24 @@
Detailed information on a single backend
========================================

.. jupyter-execute::
:hide-code:
:hide-output:
.. code-block:: python

from qiskit_ibm_provider.test.ibm_provider_mock import mock_get_backend
mock_get_backend('Fake1Q')

.. jupyter-execute::
.. code-block:: python

from qiskit_ibm_provider import IBMProvider
import qiskit_ibm_provider.jupyter

provider = IBMProvider(hub='ibm-q')
backend = provider.get_backend('ibmq_vigo')

.. jupyter-execute::
:hide-code:
:hide-output:
.. code-block:: python

backend.jobs = lambda *args, **kwargs: []

.. jupyter-execute::
.. code-block:: python

backend

Expand Down
2 changes: 1 addition & 1 deletion qiskit_ibm_provider/jupyter/dashboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

The dashboard can be instantiated using

.. jupyter-execute::
.. code-block:: python

from qiskit_ibm_provider import IBMProvider
import qiskit_ibm_provider.jupyter
Expand Down
36 changes: 17 additions & 19 deletions qiskit_ibm_provider/transpiler/passes/scheduling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@
Below we demonstrate how to schedule and pad a teleportation circuit with delays
for a dynamic circuit backend's execution model:

.. jupyter-execute::
:hide-code:
:hide-output:
.. code-block:: python

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)

.. jupyter-execute::
.. code-block:: python

from qiskit.circuit import ClassicalRegister, QuantumCircuit, QuantumRegister
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
Expand Down Expand Up @@ -96,7 +94,7 @@
Instead of padding with delays we may also insert a dynamical decoupling sequence
using the :class:`PadDynamicalDecoupling` pass as shown below:

.. jupyter-execute::
.. code-block:: python

from qiskit.circuit.library import XGate

Expand Down Expand Up @@ -129,7 +127,7 @@

Scheduling with old format ``c_if`` conditioned gates is not supported.

.. jupyter-execute::
.. code-block:: python

qc_c_if = QuantumCircuit(1, 1)
qc_c_if.x(0).c_if(0, 1)
Expand All @@ -142,7 +140,7 @@
conditioned gates to new-style control-flow.
We may then schedule the transpiled circuit without further modification.

.. jupyter-execute::
.. code-block:: python

# Temporary workaround for mock backends. For real backends this is not required.
backend.get_translation_stage_plugin = lambda: "ibm_dynamic_circuits"
Expand All @@ -164,7 +162,7 @@
:class:`qiskit.transpiler.passes.ConvertConditionsToIfOps`
prior to your scheduling pass.

.. jupyter-execute::
.. code-block:: python

from qiskit.transpiler.passes import ConvertConditionsToIfOps

Expand Down Expand Up @@ -193,7 +191,7 @@
as the measurements flow directly into the conditional blocks which in turn only apply
gates to the same measurement qubit.

.. jupyter-execute::
.. code-block:: python

qc = QuantumCircuit(2, 2)
qc.measure(0, 0)
Expand All @@ -210,7 +208,7 @@
The circuit below will not use the fast-path as the conditional gate is
on a different qubit than the measurement qubit.

.. jupyter-execute::
.. code-block:: python

qc = QuantumCircuit(2, 2)
qc.measure(0, 0)
Expand All @@ -222,7 +220,7 @@
Similarly, the circuit below contains gates on multiple qubits
and will not be performed using the fast-path.

.. jupyter-execute::
.. code-block:: python

qc = QuantumCircuit(2, 2)
qc.measure(0, 0)
Expand All @@ -236,7 +234,7 @@
If there are multiple fast-path blocks being performed in parallel each block will be
padded out to the duration of the longest block.

.. jupyter-execute::
.. code-block:: python

qc = QuantumCircuit(2, 2)
qc.measure(0, 0)
Expand All @@ -252,7 +250,7 @@

This behavior is also applied to the else condition of a fast-path eligible branch.

.. jupyter-execute::
.. code-block:: python

qc = QuantumCircuit(1, 1)
qc.measure(0, 0)
Expand All @@ -270,7 +268,7 @@
eligible block it will be applied followed by the non-fast-path blocks which will execute with
the standard higher latency conditional branch.

.. jupyter-execute::
.. code-block:: python

qc = QuantumCircuit(2, 2)
qc.measure(0, 0)
Expand All @@ -287,7 +285,7 @@
If you wish to prevent the usage of the fast-path you may insert a barrier between the measurement and
the conditional branch.

.. jupyter-execute::
.. code-block:: python

qc = QuantumCircuit(1, 2)
qc.measure(0, 0)
Expand All @@ -300,7 +298,7 @@

Conditional measurements are not eligible for the fast-path.

.. jupyter-execute::
.. code-block:: python

qc = QuantumCircuit(1, 2)
qc.measure(0, 0)
Expand All @@ -312,7 +310,7 @@

Similarly nested control-flow is not eligible.

.. jupyter-execute::
.. code-block:: python

qc = QuantumCircuit(1, 1)
qc.measure(0, 0)
Expand All @@ -331,7 +329,7 @@
there are fast-path blocks that will be performed in parallel they currently *will not*
be padded out by the scheduler to ensure they are of the same duration in Qiskit

.. jupyter-execute::
.. code-block:: python

dd_sequence = [XGate(), XGate()]

Expand Down Expand Up @@ -369,7 +367,7 @@

For example:

.. jupyter-execute::
.. code-block:: python

qc = QuantumCircuit(3, 2)
qc.x(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class PadDynamicalDecoupling(BlockBasePadder):
This pass ensures that the inserted sequence preserves the circuit exactly
(including global phase).

.. jupyter-execute::
.. code-block:: python

import numpy as np
from qiskit.circuit import QuantumCircuit
Expand All @@ -75,7 +75,7 @@ class PadDynamicalDecoupling(BlockBasePadder):
("x", None, 50), ("measure", None, 1000)]
)

.. jupyter-execute::
.. code-block:: python

# balanced X-X sequence on all qubits
dd_sequence = [XGate(), XGate()]
Expand All @@ -84,7 +84,7 @@ class PadDynamicalDecoupling(BlockBasePadder):
circ_dd = pm.run(circ)
circ_dd.draw()

.. jupyter-execute::
.. code-block:: python

# Uhrig sequence on qubit 0
n = 8
Expand Down
6 changes: 2 additions & 4 deletions qiskit_ibm_provider/visualization/interactive/error_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,15 @@ def iplot_error_map(
VisualizationTypeError: If the specified `backend` is a simulator.

Example:
.. jupyter-execute::
:hide-code:
:hide-output:
.. code-block:: python

from qiskit_ibm_provider.test.ibm_provider_mock import mock_get_backend
# Generate a mock provider for the sake of this example.
# This line will allow the mocked ``IBMProvider`` to return
# a fake backend in the following cell.
mock_get_backend('FakeOpenPulse2Q')

.. jupyter-execute::
.. code-block:: python

from qiskit_ibm_provider import IBMProvider
from qiskit_ibm_provider.visualization import iplot_error_map
Expand Down
6 changes: 2 additions & 4 deletions qiskit_ibm_provider/visualization/interactive/gate_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,15 @@ def iplot_gate_map(

Example:

.. jupyter-execute::
:hide-code:
:hide-output:
.. code-block:: python

from qiskit_ibm_provider.test.ibm_provider_mock import mock_get_backend
# Generate a mock provider for the sake of this example.
# This line will allow the mocked ``IBMProvider`` to return
# a fake backend in the following cell.
mock_get_backend('FakeOpenPulse2Q')

.. jupyter-execute::
.. code-block:: python

from qiskit_ibm_provider import IBMProvider
from qiskit_ibm_provider.visualization import iplot_gate_map
Expand Down
Loading