Skip to content

Commit

Permalink
Deprecate circuit-library Jupyter magic (#9940)
Browse files Browse the repository at this point in the history
* Deprecate circuit-library Jupyter magic

This has not been used since the switch away from using
`jupyter-execute` in gh-9346, so is neither maintained nor necessary.
Any improvements to styling should be made to the new paths, not to
these.  These objects were originally intended only for the
documentation so we expect user impact to be minimal, and the objects
are not maintained anyway.

* Correct versions for deprecation

* Add missing import
  • Loading branch information
jakelishman authored May 12, 2023
1 parent e924ea9 commit 5177db6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qiskit/tools/jupyter/jupyter_magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from IPython.core.magic import cell_magic, line_magic, Magics, magics_class, register_line_magic

from qiskit.utils import optionals as _optionals
from qiskit.utils.deprecation import deprecate_func
import qiskit
from qiskit.tools.events.progressbar import TextProgressBar
from .progressbar import HTMLProgressBar
Expand Down Expand Up @@ -174,6 +175,10 @@ def qiskit_progress_bar(self, line="", cell=None): # pylint: disable=unused-arg
if _optionals.HAS_MATPLOTLIB and get_ipython():

@register_line_magic
@deprecate_func(
since="0.25.0",
additional_msg="This was originally only for internal documentation and is no longer used.",
)
def circuit_library_info(circuit: qiskit.QuantumCircuit) -> None:
"""Displays library information for a quantum circuit.
Expand Down
21 changes: 21 additions & 0 deletions qiskit/tools/jupyter/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from qiskit import QuantumCircuit
from qiskit.exceptions import MissingOptionalLibraryError
from qiskit.utils import optionals as _optionals
from qiskit.utils.deprecation import deprecate_func

try:
import pygments
Expand Down Expand Up @@ -49,6 +50,10 @@ def _generate_circuit_library_visualization(circuit: QuantumCircuit):
plt.show()


@deprecate_func(
since="0.25.0",
additional_msg="This is unused by Qiskit, and no replacement will be publicly provided.",
)
def circuit_data_table(circuit: QuantumCircuit) -> wid.HTML:
"""Create a HTML table widget for a given quantum circuit.
Expand Down Expand Up @@ -114,6 +119,10 @@ def circuit_data_table(circuit: QuantumCircuit) -> wid.HTML:
)


@deprecate_func(
since="0.25.0",
additional_msg="This is unused by Qiskit, and no replacement will be publicly provided.",
)
def properties_widget(circuit: QuantumCircuit) -> wid.VBox:
"""Create a HTML table widget with header for a given quantum circuit.
Expand All @@ -130,6 +139,10 @@ def properties_widget(circuit: QuantumCircuit) -> wid.VBox:
return properties


@deprecate_func(
since="0.25.0",
additional_msg="This is unused by Qiskit, and no replacement will be publicly provided.",
)
def qasm_widget(circuit: QuantumCircuit) -> wid.VBox:
"""Generate a QASM widget with header for a quantum circuit.
Expand Down Expand Up @@ -190,6 +203,10 @@ def qasm_widget(circuit: QuantumCircuit) -> wid.VBox:
return qasm


@deprecate_func(
since="0.25.0",
additional_msg="This is unused by Qiskit, and no replacement will be publicly provided.",
)
def circuit_diagram_widget() -> wid.Box:
"""Create a circuit diagram widget.
Expand All @@ -212,6 +229,10 @@ def circuit_diagram_widget() -> wid.Box:
return top


@deprecate_func(
since="0.25.0",
additional_msg="This is unused by Qiskit, and no replacement will be publicly provided.",
)
def circuit_library_widget(circuit: QuantumCircuit) -> None:
"""Create a circuit library widget.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
deprecations:
- |
The Jupyter magic ``%circuit_library_info`` and the objects in ``qiskit.tools.jupyter.library``
it calls in turn:
- ``circuit_data_table``
- ``properties_widget``
- ``qasm_widget``
- ``circuit_digram_widget``
- ``circuit_library_widget``
are deprecated and will be removed in Terra 0.27. These objects were only intended for use in
the documentation build. They are no longer used there, so are no longer supported or maintained.

0 comments on commit 5177db6

Please sign in to comment.