class_docstr: Tests for the qfunc_transform decorator
class_docstr_tok: ["Tests","for","the","qfunc_transform","decorator"]
docstr: Test that nesting multiple transforms works as expected
docstr_tok: ["Test","that","nesting","multiple","transforms","works","as","expected"]
code: def test_nested_transforms(self):
      """Test that nesting multiple transforms works as expected"""
  
      @qml.qfunc_transform
      def convert_cnots(tape):
          for op in tape:
              if op.name == "CNOT":
                  wires = op.wires
                  qml.Hadamard(wires=wires[0])
                  qml.CZ(wires=[wires[0], wires[1]])
              else:
                  op.queue()
  
      @qml.qfunc_transform
      def expand_hadamards(tape, x):
          for op in tape:
              if op.name == "Hadamard":
                  qml.RZ(x, wires=op.wires)
              else:
                  op.queue()
  
      x = 0.5
  
      @expand_hadamards(x)
      @convert_cnots
      def ansatz():
          qml.CNOT(wires=[0, 1])
  
      ops = qml.tape.make_qscript(ansatz)().operations
      assert len(ops) == 2
      assert ops[0].name == "RZ"
      assert ops[0].parameters == [x]
      assert ops[1].name == "CZ"
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 8 for calling the TestQFuncTransforms obj's underlying member method code with example usage: obj.test_nested_transforms() without return types