class_docstr: Test creating expansion functions from stopping criteria.
class_docstr_tok: ["Test","creating","expansion","functions","from","stopping","criteria","."]
docstr: Test that passing a depth simply expands to that depth
docstr_tok: ["Test","that","passing","a","depth","simply","expands","to","that","depth"]
code: def test_depth_only_expansion(self):
      """Test that passing a depth simply expands to that depth"""
      with qml.queuing.AnnotatedQueue() as q:
          qml.RX(0.2, wires=0)
          qml.RY(qml.numpy.array(2.1, requires_grad=True), wires=1)
          qml.Rot(
              *qml.numpy.array([0.5, 0.2, -0.1], requires_grad=True),
              wires=0,
          )
          qml.templates.StronglyEntanglingLayers(
              qml.numpy.ones([2, 2, 3], requires_grad=True),
              wires=[0, 1],
          )
  
      tape = qml.tape.QuantumScript.from_queue(q)
      expand_fn = qml.transforms.create_expand_fn(depth=0)
      new_tape = expand_fn(tape)
      assert new_tape is tape
  
      expand_fn = qml.transforms.create_expand_fn(depth=10)
      new_tape = expand_fn(tape)
      assert new_tape.operations[0] == tape.operations[0]
      assert new_tape.operations[1] == tape.operations[1]
      assert [op.name for op in new_tape.operations[2:5]] == [
          "RZ",
          "RY",
          "RZ",
      ]
      assert len(new_tape.operations[6:]) == 15
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.wires import Wires
label_desc: Use image node_id 6 for calling the TestCreateExpandFn obj's underlying member method code with example usage: obj.test_depth_only_expansion() without return types