From 7122a8c6af9199695466ae4cda815ab663525924 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 28 Nov 2023 20:42:55 -0500 Subject: [PATCH] Update DAGCircuit.draw() docstring with current requirements (#11337) * 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) --- 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 4233144c86f..e4911805f8f 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