class_docstr: Test conversion of queues to DAGs
class_docstr_tok: ["Test","conversion","of","queues","to","DAGs"]
docstr: A test of the different layers, their successors and ancestors using a simple circuit
docstr_tok: ["A","test","of","the","different","layers",",","their","successors","and","ancestors","using","a","simple","circuit"]
code: def test_iterate_layers(self, parameterized_circuit_gaussian, wires):
      """A test of the different layers, their successors and ancestors using a simple circuit"""
  
      dev = qml.device("default.gaussian", wires=wires)
      qnode = qml.QNode(parameterized_circuit_gaussian, dev)
      qnode(
          *pnp.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], requires_grad=True)
      )
      circuit = qnode.qtape.graph
      result = list(circuit.iterate_parametrized_layers())
  
      assert len(result) == 3
      assert set(result[0][0]) == set([])
      assert set(result[0][1]) == set(circuit.operations[:3])
      assert result[0][2] == (0, 1, 2)
      assert set(result[0][3]) == set(
          circuit.operations[3:] + circuit.observables
      )
  
      assert set(result[1][0]) == set(circuit.operations[:2])
      assert set(result[1][1]) == set([circuit.operations[3]])
      assert result[1][2] == (3,)
      assert set(result[1][3]) == set(
          circuit.operations[4:6] + circuit.observables[:2]
      )
  
      assert set(result[2][0]) == set(circuit.operations[:4])
      assert set(result[2][1]) == set(circuit.operations[5:])
      assert result[2][2] == (6, 7)
      assert set(result[2][3]) == set(circuit.observables[1:])
  
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 11 for calling the TestCircuitGraph obj's underlying member method code with example usage: obj.test_iterate_layers(parameterized_circuit_gaussian, wires) without return types