class_docstr: Test first order results for the matrix of jpc options.
class_docstr_tok: ["Test","first","order","results","for","the","matrix","of","jpc","options","."]
docstr: Test execute_and_compute_jvp on a batch with ragged observables and parameters..
docstr_tok: ["Test","execute_and_compute_jvp","on","a","batch","with","ragged","observables","and","parameters",".."]
code: def test_batch_execute_jvp(self, jpc, shots):
      """Test execute_and_compute_jvp on a batch with ragged observables and parameters.."""
      if shots and not _accepts_finite_shots(jpc):
          pytest.skip("jpc does not work with finite shots.")
      x = -0.92
      y = 0.84
      phi = 1.62
  
      tape1 = qml.tape.QuantumScript(
          [qml.RX(x, 0), qml.RY(y, 1), qml.CNOT((0, 1))],
          [qml.expval(qml.PauliX(1)), qml.expval(qml.PauliY(0))],
      )
      tape2 = qml.tape.QuantumScript(
          [qml.Hadamard(0), qml.IsingXX(phi, wires=(0, 1))],
          [qml.expval(qml.PauliZ(1))],
          shots=shots,
      )
  
      tangents = ((2.0, 3.0), (0.5,))
  
      res, jvps = jpc.execute_and_compute_jvp((tape1, tape2), tangents)
  
      assert qml.math.allclose(
          res[0][0], np.sin(y), atol=_tol_for_shots(shots)
      )
      assert qml.math.allclose(
          res[0][1], -np.sin(x) * np.sin(y), atol=_tol_for_shots(shots)
      )
      assert qml.math.allclose(
          res[1], np.cos(phi), atol=_tol_for_shots(shots)
      )
  
      assert qml.math.allclose(
          jvps[0][0], 3.0 * np.cos(y), atol=_tol_for_shots(shots)
      )
      assert qml.math.allclose(
          jvps[0][1],
          -2.0 * np.cos(x) * np.sin(y) - 3.0 * np.sin(x) * np.cos(y),
          atol=_tol_for_shots(shots),
      )
      assert qml.math.allclose(
          jvps[1], -0.5 * np.sin(phi), atol=_tol_for_shots(shots)
      )
  
imports: import pytest
  from cachetools import LRUCache
  from param_shift_dev import ParamShiftDerivativesDevice
  import numpy
  import pennylane
  from pennylane.workflow.jacobian_products import JacobianProductCalculator, TransformJacobianProducts, DeviceDerivatives, DeviceJacobianProducts, LightningVJPs
label_desc: Use image node_id 5 for calling the TestJacobianProductResults obj's underlying member method code with example usage: obj.test_batch_execute_jvp(jpc, shots) without return types