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

Deprecate circuit-library Jupyter magic #9940

Merged
merged 3 commits into from
May 12, 2023
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
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.