class_docstr: Test conversion of queues to DAGs
docstr: Test a more complex example containing operations
  that do depend on the result of previous operations
docstr_tok: ["Test","a","more","complex","example","containing","operations","that","do","depend","on","the","result","of","previous","operations"]
code: def test_dependence(self, ops, obs):
      """Test a more complex example containing operations
      that do depend on the result of previous operations"""
  
      circuit = CircuitGraph(ops, obs, Wires([0, 1, 2]))
      graph = circuit.graph
      assert len(graph.node_indexes()) == 9
      assert len(graph.edges()) == 9
  
      queue = ops + obs
  
      # all ops should be nodes in the graph
      for k in queue:
          assert k in graph.nodes()
  
      # all nodes in the graph should be ops
      # for k in graph.nodes:
      for k in graph.nodes():
          assert k is queue[k.queue_idx]
      a = set(
          (graph.get_node_data(e[0]), graph.get_node_data(e[1]))
          for e in graph.edge_list()
      )
      b = set(
          (queue[a], queue[b])
          for a, b in [
              (0, 3),
              (1, 3),
              (2, 4),
              (3, 5),
              (3, 6),
              (4, 5),
              (5, 7),
              (5, 8),
              (6, 8),
          ]
      )
      assert a == b
  
imports: import io
  import contextlib
  import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.resource import ResourcesOperation, Resources
  from pennylane.circuit_graph import CircuitGraph
  from pennylane.wires import Wires
label_desc: Use image node_id 2 for calling the TestCircuitGraph obj's underlying member method code with example usage: obj.test_dependence(ops, obs) without return types