class_docstr: Commutation DAG tests.
docstr: Test a simple DAG on 1 wire with a quantum function.
docstr_tok: ["Test","a","simple","DAG","on","1","wire","with","a","quantum","function","."]
code: def test_dag_transform_simple_dag_function(self):
      """Test a simple DAG on 1 wire with a quantum function."""
  
      def circuit():
          qml.PauliZ(wires=0)
          qml.PauliX(wires=0)
  
      dag = qml.transforms.commutation_dag(circuit)()
  
      a = qml.PauliZ(wires=0)
      b = qml.PauliX(wires=0)
  
      nodes = [a, b]
      edges = [(0, 1, {"commute": False})]
  
      assert dag.get_node(0).op.compare(a)
      assert dag.get_node(1).op.compare(b)
      assert dag.get_edge(0, 1) == {0: {"commute": False}}
      assert dag.get_edge(0, 2) is None
      assert dag.observables == []
      for i, node in enumerate(dag.get_nodes()):
          assert node[1].op.compare(nodes[i])
      for i, edge in enumerate(dag.get_edges()):
          assert edges[i] == edge
  
file_path: pennylane/tests/transforms/test_commutation_dag.py
imports: from collections import OrderedDict
  import pytest
  from pennylane.wires import Wires
  import pennylane.numpy
  import pennylane
label_desc: Use image node_id 2 for calling the TestCommutationDAG obj's underlying member method code with example usage: obj.test_dag_transform_simple_dag_function() without return types