Skip to content

Commit

Permalink
Move circuit drawer files to qiskit.visualization.circuit (#8306)
Browse files Browse the repository at this point in the history
* Add graph and circuit dirs

* Move files to new folders

* Finishing transition to circuit and graph dirs

* Finish import changes

* Positioning files and setting init entries

* Final tweaks to compatibility and lint

* Reduce to circuit dir only

* Cleanup

* Add qcstyle stub for docs

* Merge main conflicts fix

* Lint

* Change test message

* Fix _directive change

* Fix op.condition reference

* Change to _utils and cleanup

* Lint

* Fix _trim and dag_drawer test

* Allow direct import of text, etc.

* Add comment explaining backwards-compatibility imports

* Add release note

Co-authored-by: Jake Lishman <[email protected]>
  • Loading branch information
enavarro51 and jakelishman authored Sep 7, 2022
1 parent 6927a8d commit bb52011
Show file tree
Hide file tree
Showing 30 changed files with 1,844 additions and 1,947 deletions.
24 changes: 16 additions & 8 deletions qiskit/visualization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,37 @@
import sys
import warnings

from qiskit.visualization.counts_visualization import plot_histogram
from qiskit.visualization.state_visualization import (
from .array import array_to_latex

from .circuit import circuit_drawer
from .counts_visualization import plot_histogram
from .bloch import Bloch, Arrow3D
from .state_visualization import (
plot_state_hinton,
plot_bloch_vector,
plot_bloch_multivector,
plot_state_city,
plot_state_paulivec,
plot_state_qsphere,
state_drawer,
)
from qiskit.visualization.transition_visualization import visualize_transition
from qiskit.visualization.array import array_to_latex

from .circuit_visualization import circuit_drawer
from .transition_visualization import visualize_transition
from .dag_visualization import dag_drawer
from .exceptions import VisualizationError
from .gate_map import plot_gate_map, plot_circuit_layout, plot_error_map, plot_coupling_map
from .pass_manager_visualization import pass_manager_drawer

from .pulse.interpolation import step_wise, linear, cubic_spline
from .pulse.qcstyle import PulseStyle, SchedStyle
from .pulse_visualization import pulse_drawer
from .pulse_v2 import draw as pulse_drawer_v2

from .timeline import draw as timeline_drawer

from .exceptions import VisualizationError

# These modules aren't part of the public interface, and were moved in Terra 0.22. They're
# re-imported here to allow a backwards compatible path, and should be deprecated in Terra 0.23.
from .circuit import text, matplotlib, latex

_DEPRECATED_NAMES = {
"HAS_MATPLOTLIB",
"HAS_PYLATEX",
Expand Down
15 changes: 15 additions & 0 deletions qiskit/visualization/circuit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

""" Init for circuit visualizations """

from .circuit_visualization import circuit_drawer
Loading

0 comments on commit bb52011

Please sign in to comment.