Skip to content

Commit

Permalink
fixes #9355 deprecate visualize_transition (#12287)
Browse files Browse the repository at this point in the history
* added deprecation warnings and decorators to transition_visualization.py

* fixed style with tox -epy310 -eblack

* added release notes

* added to warning category=DeprecationWarning and stacklevel=2

* Update releasenotes/notes/deprecate-visualize_transition-8c1d257b7f37aa58.yaml

Co-authored-by: atharva-satpute <55058959+atharva-satpute@users.noreply.github.com>

* Update releasenotes/notes/deprecate-visualize_transition-8c1d257b7f37aa58.yaml

Co-authored-by: atharva-satpute <55058959+atharva-satpute@users.noreply.github.com>

* Apply suggestions from code review

* Fix lint complaint

---------

Co-authored-by: atharva-satpute <55058959+atharva-satpute@users.noreply.github.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
  • Loading branch information
4 people authored Jul 26, 2024
1 parent c40ce83 commit 4ec51d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qiskit/visualization/transition_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import numpy as np

from qiskit.exceptions import MissingOptionalLibraryError
from qiskit.utils.deprecation import deprecate_func


def _normalize(v, tolerance=0.00001):
Expand Down Expand Up @@ -121,6 +122,10 @@ def vector_norm(self):
return np.linalg.norm(v)


@deprecate_func(
since="1.2.0",
removal_timeline="in the 2.0 release",
)
def visualize_transition(circuit, trace=False, saveas=None, fpg=100, spg=2):
"""
Creates animation showing transitions between states of a single
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
deprecations_visualization:
- |
The :func:`.transition_visualization` function has been deprecated and will
be removed in the 2.0.0 release. This function had a number of limitations
which limited it's utility to only very specific use cases and didn't fit in with
the rest of the Qiskit visualization module.

0 comments on commit 4ec51d1

Please sign in to comment.