class_docstr: For registering a tape transform that takes a tape and outputs a single new tape.
  
  .. warning::
  
      Use of ``single_tape_transform`` to create a custom transform is deprecated. Instead
      switch to using the new :func:`transform` function. Follow the instructions
      `here <https://docs.pennylane.ai/en/stable/code/qml_transforms.html#custom-transforms>`_
      for further details
  
  Examples of such transforms include circuit compilation.
  
  Args:
      transform_fn (function): The function to register as the single tape transform.
          It can have an arbitrary number of arguments, but the first argument
          **must** be the input tape.
  
  **Example**
  
  A valid single tape transform is a quantum function that satisfies the following:
  
  - The first argument must be an input tape
  
  - Depending on the structure of this input tape, various quantum operations, functions,
    and templates may be called.
  
  - Any internal classical processing should use the ``qml.math`` module to ensure
    the transform is differentiable.
  
  - There is no return statement.
  
  For example:
  
  .. code-block:: python
  
      @qml.single_tape_transform
      def my_transform(tape, x, y):
          # loop through all operations on the input tape
          for op in tape:
              if op.name == "CRX":
                  wires = op.wires
                  param = op.parameters[0]
  
                  qml.RX(x * qml.math.abs(param), wires=wires[1])
                  qml.RY(y * qml.math.abs(param), wires=wires[1])
                  qml.CZ(wires=[wires[1], wires[0]])
              else:
                  op.queue()
  
  This transform iterates through the input tape, and replaces any :class:`~.CRX` operation with
  two single qubit rotations and a :class:`~.CZ` operation. These newly queued operations will
  form the output transformed tape.
  
  We can apply this transform to a quantum tape:
  
  >>> with qml.tape.QuantumTape() as tape:
  ...     qml.Hadamard(wires=0)
  ...     qml.CRX(-0.5, wires=[0, 1])
  >>> new_tape = my_transform(tape, 1., 2.)
  >>> print(qml.drawer.tape_text(new_tape, decimals=1))
  0: ──H────────────────╭Z─┤
  1: ──RX(0.5)──RY(1.0)─╰●─┤
class_docstr_tok: ["For","registering","a","tape","transform","that","takes","a","tape","and","outputs","a","single","new","tape",".","..","warning",":",":","Use","of","``","single_tape_transform","``","to","create","a","custom","transform","is","deprecated",".","Instead","switch","to","using","the","new",":","func",":","`","transform","`","function",".","Follow","the","instructions","`","here","<","https",":","\/\/docs.pennylane.ai\/en\/stable\/code\/qml_transforms.html","#","custom-transforms",">","`","_","for","further","details","Examples","of","such","transforms","include","circuit","compilation",".","Args",":","transform_fn","(","function",")",":","The","function","to","register","as","the","single","tape","transform",".","It","can","have","an","arbitrary","number","of","arguments",",","but","the","first","argument","*","*","must","*","*","be","the","input","tape",".","*","*","Example","*","*","A","valid","single","tape","transform","is","a","quantum","function","that","satisfies","the","following",":","-","The","first","argument","must","be","an","input","tape","-","Depending","on","the","structure","of","this","input","tape",",","various","quantum","operations",",","functions",",","and","templates","may","be","called",".","-","Any","internal","classical","processing","should","use","the","``","qml.math","``","module","to","ensure","the","transform","is","differentiable",".","-","There","is","no","return","statement",".","For","example",":","..","code-block",":",":","python","@","qml.single_tape_transform","def","my_transform","(","tape",",","x",",","y",")",":","#","loop","through","all","operations","on","the","input","tape","for","op","in","tape",":","if","op.name","==","``","CRX","''",":","wires","=","op.wires","param","=","op.parameters","[","0","]","qml.RX","(","x","*","qml.math.abs","(","param",")",",","wires=wires","[","1","]",")","qml.RY","(","y","*","qml.math.abs","(","param",")",",","wires=wires","[","1","]",")","qml.CZ","(","wires=","[","wires","[","1","]",",","wires","[","0","]","]",")","else",":","op.queue","(",")","This","transform","iterates","through","the","input","tape",",","and","replaces","any",":","class",":","`","~.CRX","`","operation","with","two","single","qubit","rotations","and","a",":","class",":","`","~.CZ","`","operation",".","These","newly","queued","operations","will","form","the","output","transformed","tape",".","We","can","apply","this","transform","to","a","quantum","tape",":",">",">",">","with","qml.tape.QuantumTape","(",")","as","tape",":","...","qml.Hadamard","(","wires=0",")","...","qml.CRX","(","-0.5",",","wires=","[","0",",","1","]",")",">",">",">","new_tape","=","my_transform","(","tape",",","1.",",","2",".",")",">",">",">","print","(","qml.drawer.tape_text","(","new_tape",",","decimals=1",")",")","0",":","\u2500\u2500H\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256dZ\u2500\u2524","1",":","\u2500\u2500RX","(","0.5",")","\u2500\u2500RY","(","1.0",")","\u2500\u2570\u25cf\u2500\u2524"]
code: def __call__(self, tape, *args, **kwargs):
      with qml.queuing.AnnotatedQueue() as q:
          self.transform_fn(tape, *args, **kwargs)
      qs = qml.tape.QuantumScript.from_queue(q, shots=tape.shots)
      for obj, info in q.items():
          qml.queuing.QueuingManager.append(obj, **info)
      return qs
  
file_path: pennylane/pennylane/transforms/qfunc_transforms.py
imports: from copy import deepcopy
  import functools
  import inspect
  import os
  import warnings
  import pennylane
  from pennylane.tape import make_qscript
label_desc: Use image node_id 2 for calling the single_tape_transform obj's underlying member method code with example usage: obj.__call__(tape) and returns: qs