class_docstr: Test preprocess produces output that can be executed by the device.
class_docstr_tok: ["Test","preprocess","produces","output","that","can","be","executed","by","the","device","."]
docstr: Test integration between preprocessing and execution with numpy parameters.
docstr_tok: ["Test","integration","between","preprocessing","and","execution","with","numpy","parameters","."]
code: def test_preprocess_single_circuit(self, max_workers):
      """Test integration between preprocessing and execution with numpy parameters."""
  
      # pylint: disable=too-few-public-methods
      class MyTemplate(qml.operation.Operation):
          """Temp operator."""
  
          num_wires = 2
  
          # pylint: disable=missing-function-docstring
          def decomposition(self):
              return [
                  qml.RX(self.data[0], self.wires[0]),
                  qml.RY(self.data[1], self.wires[1]),
                  qml.CNOT(self.wires),
              ]
  
      x = 0.928
      y = -0.792
      qscript = qml.tape.QuantumScript(
          [MyTemplate(x, y, ("a", "b"))],
          [
              qml.expval(qml.PauliY("a")),
              qml.expval(qml.PauliZ("a")),
              qml.expval(qml.PauliX("b")),
          ],
      )
  
      dev = DefaultQubit(max_workers=max_workers)
      tapes = tuple([qscript])
      program, config = dev.preprocess()
      tapes, pre_processing_fn = program(tapes)
  
      assert len(tapes) == 1
      execute_circuit = tapes[0]
      assert qml.equal(execute_circuit[0], qml.RX(x, "a"))
      assert qml.equal(execute_circuit[1], qml.RY(y, "b"))
      assert qml.equal(execute_circuit[2], qml.CNOT(("a", "b")))
      assert qml.equal(execute_circuit[3], qml.expval(qml.PauliY("a")))
      assert qml.equal(execute_circuit[4], qml.expval(qml.PauliZ("a")))
      assert qml.equal(execute_circuit[5], qml.expval(qml.PauliX("b")))
  
      results = dev.execute(tapes, config)
      assert len(results) == 1
      assert len(results[0]) == 3
  
      processed_results = pre_processing_fn(results)
      processed_result = processed_results[0]
      assert len(processed_result) == 3
      assert qml.math.allclose(
          processed_result[0], -np.sin(x) * np.sin(y)
      )
      assert qml.math.allclose(processed_result[1], np.cos(x))
      assert qml.math.allclose(processed_result[2], np.sin(y))
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.devices import DefaultQubit, ExecutionConfig
  from pennylane.devices.default_qubit import stopping_condition
label_desc: Use image node_id 12 for calling the TestPreprocessingIntegration obj's underlying member method code with example usage: obj.test_preprocess_single_circuit(max_workers) and returns: list