class_docstr: Tests for the qfunc_transform decorator
class_docstr_tok: ["Tests","for","the","qfunc_transform","decorator"]
docstr: Test that an unparametrized transform can be applied
  to a quantum function via a decorator
docstr_tok: ["Test","that","an","unparametrized","transform","can","be","applied","to","a","quantum","function","via","a","decorator"]
code: def test_unparametrized_transform_decorator(self):
      """Test that an unparametrized transform can be applied
      to a quantum function via a decorator"""
  
      @qml.qfunc_transform
      def my_transform(tape):
          for op in tape:
              if op.name == "CRX":
                  wires = op.wires
                  param = op.parameters[0]
                  qml.RX(param, wires=wires[1])
                  qml.RY(param / 2, wires=wires[1])
                  qml.CZ(wires=[wires[1], wires[0]])
              else:
                  op.queue()
  
      @my_transform
      def qfunc(x):
          qml.Hadamard(wires=0)
          qml.CRX(x, wires=[0, 1])
  
      x = 0.543
      ops = qml.tape.make_qscript(qfunc)(x).operations
      assert len(ops) == 4
      assert ops[0].name == "Hadamard"
  
      assert ops[1].name == "RX"
      assert ops[1].parameters == [x]
  
      assert ops[2].name == "RY"
      assert ops[2].parameters == [x / 2]
  
      assert ops[3].name == "CZ"
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 5 for calling the TestQFuncTransforms obj's underlying member method code with example usage: obj.test_unparametrized_transform_decorator() without return types