From 4ee4481e590b34b3fde9df55812ecae06e0749e3 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 08:27:22 +0000 Subject: [PATCH] Update DAGCircuit.draw() docstring with current requirements (#11337) (#11338) * 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 --------- Co-authored-by: Jake Lishman (cherry picked from commit c3a7d409323b67dcb66c8e9c7af2b8e33cf8b928) Co-authored-by: Matthew Treinish --- qiskit/dagcircuit/dagcircuit.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qiskit/dagcircuit/dagcircuit.py b/qiskit/dagcircuit/dagcircuit.py index 4233144c86fe..e4911805f8f5 100644 --- a/qiskit/dagcircuit/dagcircuit.py +++ b/qiskit/dagcircuit/dagcircuit.py @@ -2099,8 +2099,12 @@ def draw(self, scale=0.7, filename=None, style="color"): """ Draws the dag circuit. - This function needs `pydot `_, which in turn needs - `Graphviz `_ to be installed. + This function needs `Graphviz `_ 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 `__ on + how to install it. Args: scale (float): scaling factor