qiskit.visualization.pass_manager_drawer
qiskit.visualization.pass_manager_drawer(pass_manager, filename=None, style=None, raw=False)
Draws the pass manager.
This function needs pydot, which in turn needs Graphviz to be installed.
Parameters
- pass_manager (PassManager) – the pass manager to be drawn
- filename (str) – file path to save image to
- style (dict or OrderedDict) – keys are the pass classes and the values are the colors to make them. An example can be seen in the DEFAULT_STYLE. An ordered dict can be used to ensure a priority coloring when pass falls into multiple categories. Any values not included in the provided dict will be filled in from the default dict
- raw (Bool) – True if you want to save the raw Dot output not an image. The default is False.
Returns
an in-memory representation of the pass manager. Or None if no image was generated or PIL is not installed.
Return type
PIL.Image or None
Raises
- MissingOptionalLibraryError – when nxpd or pydot not installed.
- VisualizationError – If raw=True and filename=None.
Example
from qiskit import QuantumCircuit
from qiskit.transpiler import generate_preset_pass_manager
from qiskit.visualization import pass_manager_drawer
pm = generate_preset_pass_manager(optimization_level=0)
pass_manager_drawer(pm)
Was this page helpful?
Report a bug or request content on GitHub.