Skip to content

Commit

Permalink
Update DAGCircuit.draw() docstring with current requirements (#11337)
Browse files Browse the repository at this point in the history
* Update DAGCircuit.draw() docstring with current requirements

Since #8162 the dag drawer hasn't required pydot to run. It now uses
rustworkx's graphviz_draw() function which directly calls graphviz.
However, in #8162 the docstring for the DAGCircuit.draw() method was not
updated to reflect this and the method documentation still said that
pydot was required. This commit fixes this oversight and updates the
docstring to correctly state that only graphviz is required (as
rustworkx is a hard dependency for Qiskit it's not anything that needs
to be documented). It also includes more details on how to install
graphviz as this is often a potential source of confusion for users.

* Update qiskit/dagcircuit/dagcircuit.py

Co-authored-by: Jake Lishman <jake@binhbar.com>

---------

Co-authored-by: Jake Lishman <jake@binhbar.com>
(cherry picked from commit c3a7d40)
  • Loading branch information
mtreinish authored and mergify[bot] committed Nov 29, 2023
1 parent 58f8d24 commit 7122a8c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions qiskit/dagcircuit/dagcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2099,8 +2099,12 @@ def draw(self, scale=0.7, filename=None, style="color"):
"""
Draws the dag circuit.
This function needs `pydot <https://github.com/erocarrera/pydot>`_, which in turn needs
`Graphviz <https://www.graphviz.org/>`_ to be installed.
This function needs `Graphviz <https://www.graphviz.org/>`_ to be
installed. Graphviz is not a python package and can't be pip installed
(the ``graphviz`` package on PyPI is a Python interface library for
Graphviz and does not actually install Graphviz). You can refer to
`the Graphviz documentation <https://www.graphviz.org/download/>`__ on
how to install it.
Args:
scale (float): scaling factor
Expand Down

0 comments on commit 7122a8c

Please sign in to comment.