class_docstr: Class to represent a quantum circuit as a directed acyclic graph (DAG). This class is useful to build the
  commutation DAG and set up all nodes attributes. The construction of the DAG should be used through the
  transform :class:`qml.transforms.commutation_dag`.
  
  Args:
      tape (.QuantumTape): PennyLane quantum tape representing a quantum circuit.
  
  **Reference:**
  
  [1] Iten, R., Moyard, R., Metger, T., Sutter, D. and Woerner, S., 2020.
  Exact and practical pattern matching for quantum circuit optimization.
  `doi.org/10.1145/3498325 <https://dl.acm.org/doi/abs/10.1145/3498325>`_
class_docstr_tok: ["Class","to","represent","a","quantum","circuit","as","a","directed","acyclic","graph","(","DAG",")",".","This","class","is","useful","to","build","the","commutation","DAG","and","set","up","all","nodes","attributes",".","The","construction","of","the","DAG","should","be","used","through","the","transform",":","class",":","`","qml.transforms.commutation_dag","`",".","Args",":","tape","(",".QuantumTape",")",":","PennyLane","quantum","tape","representing","a","quantum","circuit",".","*","*","Reference",":","*","*","[","1","]","Iten",",","R.",",","Moyard",",","R.",",","Metger",",","T.",",","Sutter",",","D.","and","Woerner",",","S.",",","2020",".","Exact","and","practical","pattern","matching","for","quantum","circuit","optimization",".","`","doi.org\/10.1145\/3498325","<","https",":","\/\/dl.acm.org\/doi\/abs\/10.1145\/3498325",">","`","_"]
docstr: Draw the DAG object.
  
  Args:
      filename (str): The file name which is in PNG format. Default = 'dag.png'
docstr_tok: ["Draw","the","DAG","object",".","Args",":","filename","(","str",")",":","The","file","name","which","is","in","PNG","format",".","Default","=","'dag.png","'"]
code: def draw(self, filename="dag.png"):  # pragma: no cover
      """Draw the DAG object.
  
      Args:
          filename (str): The file name which is in PNG format. Default = 'dag.png'
      """
      draw_graph = nx.MultiDiGraph()
  
      for node in self.get_nodes():
          wires = ",".join(
              [" " + str(elem) for elem in node[1].op.wires.tolist()]
          )
          label = (
              "ID: "
              + str(node[0])
              + "\n"
              + "Op: "
              + node[1].op.name
              + "\n"
              + "Wires: ["
              + wires[1::]
              + "]"
          )
          draw_graph.add_node(
              node[0],
              label=label,
              color="blue",
              style="filled",
              fillcolor="lightblue",
          )
  
      for edge in self.get_edges():
          draw_graph.add_edge(edge[0], edge[1])
  
      dot = to_pydot(draw_graph)
      dot.write_png(filename)
  
imports: import heapq
  from collections import OrderedDict
  from functools import partial
  from typing import Sequence, Callable
  import networkx
  from networkx.drawing.nx_pydot import to_pydot
  import pennylane
  from pennylane.tape import QuantumTape
  from pennylane.wires import Wires
  from pennylane.transforms import transform
label_desc: Use image node_id 15 for calling the CommutationDAG obj's underlying member method code with example usage: obj.draw(filename) without return types