class_docstr: Tests for calling a TransformProgram on a batch of quantum tapes.
docstr: Basic test with a single transform that only modifies the tape but not the results.
docstr_tok: ["Basic","test","with","a","single","transform","that","only","modifies","the","tape","but","not","the","results","."]
code: def test_single_transform_program(self):
      """Basic test with a single transform that only modifies the tape but not the results."""
  
      def single_null_postprocessing(results):
          return results[0]
  
      def remove_operation_at_index(
          tape: qml.tape.QuantumTape, index: int
      ) -> (Sequence[qml.tape.QuantumTape], Callable):
          """A valid transform."""
          new_ops = list(tape.operations)
          new_ops.pop(index)  # pylint:disable=protected-access
          return (
              qml.tape.QuantumScript(
                  new_ops, tape.measurements, shots=tape.shots
              ),
          ), single_null_postprocessing
  
      container = TransformContainer(
          remove_operation_at_index, kwargs={"index": 1}
      )
      prog = TransformProgram((container,))
  
      tape0 = qml.tape.QuantumScript(
          [qml.S(0), qml.T(1), qml.SX(2)],
          [qml.expval(qml.PauliZ(0))],
          shots=100,
      )
      batch = (tape0,)
      new_batch, fn = prog(batch)
  
      assert len(new_batch) == 1
      expected = [qml.S(0), qml.SX(2), qml.expval(qml.PauliZ(0))]
      for op1, op2 in zip(expected, new_batch[0]):
          assert qml.equal(op1, op2)
      assert new_batch[0].shots == qml.measurements.Shots(100)
  
      assert fn.func is _apply_postprocessing_stack
      assert fn.args == tuple()
  
      assert len(fn.keywords["postprocessing_stack"]) == 1
      postprocessing0 = fn.keywords["postprocessing_stack"][0]
      assert postprocessing0.func is _batch_postprocessing
      assert postprocessing0.args == tuple()
      assert postprocessing0.keywords["individual_fns"] == [
          single_null_postprocessing
      ]
      assert postprocessing0.keywords["slices"] == [slice(0, 1)]
  
      results = (2.0,)
      assert fn(results) == (2.0,)
  
imports: from typing import Sequence, Callable
  import pytest
  import pennylane
  from pennylane.tape import QuantumScript
  from pennylane.transforms.core import transform, TransformProgram, TransformError, TransformContainer
  from pennylane.transforms.core.transform_program import _batch_postprocessing, _apply_postprocessing_stack, null_postprocessing
  from pennylane.typing import ResultBatch, Result
label_desc: Use image node_id 2 for calling the TestTransformProgramCall obj's underlying member method code with example usage: obj.test_single_transform_program() and returns: results, qml,  single_null_postprocessing