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 preprocess integrates with default qubit when we start with a batch of circuits.
docstr_tok: ["Test","preprocess","integrates","with","default","qubit","when","we","start","with","a","batch","of","circuits","."]
code: def test_preprocess_batch_circuit(self, max_workers):
      """Test preprocess integrates with default qubit when we start with a batch of circuits."""
  
      # pylint: disable=too-few-public-methods
      class CustomIsingXX(qml.operation.Operation):
          """Temp operator."""
  
          num_wires = 2
  
          # pylint: disable=missing-function-docstring
          def decomposition(self):
              return [qml.IsingXX(self.data[0], self.wires)]
  
      x = 0.692
  
      measurements1 = [qml.density_matrix("a"), qml.vn_entropy("a")]
      qs1 = qml.tape.QuantumScript(
          [CustomIsingXX(x, ("a", "b"))], measurements1
      )
  
      y = -0.923
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.PauliX(wires=1)
          m_0 = qml.measure(1)
          qml.cond(m_0, qml.RY)(y, wires=0)
          qml.expval(qml.PauliZ(0))
  
      qs2 = qml.tape.QuantumScript.from_queue(q)
  
      initial_batch = [qs1, qs2]
  
      dev = DefaultQubit(max_workers=max_workers)
  
      program, config = dev.preprocess()
      batch, pre_processing_fn = program(initial_batch)
  
      results = dev.execute(batch, config)
      processed_results = pre_processing_fn(results)
  
      assert len(processed_results) == 2
      assert len(processed_results[0]) == 2
  
      expected_density_mat = np.array(
          [[np.cos(x / 2) ** 2, 0], [0, np.sin(x / 2) ** 2]]
      )
      assert qml.math.allclose(
          processed_results[0][0], expected_density_mat
      )
  
      eig_1 = (
          1 + np.sqrt(1 - 4 * np.cos(x / 2) ** 2 * np.sin(x / 2) ** 2)
      ) / 2
      eig_2 = (
          1 - np.sqrt(1 - 4 * np.cos(x / 2) ** 2 * np.sin(x / 2) ** 2)
      ) / 2
      eigs = [eig_1, eig_2]
      eigs = [eig for eig in eigs if eig > 0]
  
      expected_entropy = -np.sum(eigs * np.log(eigs))
      assert qml.math.allclose(
          processed_results[0][1], expected_entropy
      )
  
      expected_expval = np.cos(y)
      assert qml.math.allclose(expected_expval, processed_results[1])
  
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 13 for calling the TestPreprocessingIntegration obj's underlying member method code with example usage: obj.test_preprocess_batch_circuit(max_workers) and returns: list