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 for a simple single input single output.
docstr_tok: ["Test","execute_and_compute_jvp","for","a","simple","single","input","single","output","."]
code: def test_execute_jvp_basic(self, jpc, shots):
      """Test execute_and_compute_jvp for a simple single input single output."""
      if shots and not _accepts_finite_shots(jpc):
          pytest.skip("jpc does not work with finite shots.")
  
      x = 0.92
      tape = qml.tape.QuantumScript(
          [qml.RX(x, 0)], [qml.expval(qml.PauliZ(0))], shots=shots
      )
      tangents = ((0.5,),)
      res, jvp = jpc.execute_and_compute_jvp((tape,), tangents)
  
      if tape.shots.has_partitioned_shots:
          assert len(res[0]) == 2
          assert len(jvp[0]) == 2
      else:
          assert qml.math.shape(res[0]) == tuple()
          assert qml.math.shape(jvp[0]) == tuple()
  
      assert qml.math.allclose(
          res[0], np.cos(x), atol=_tol_for_shots(shots)
      )
      assert qml.math.allclose(
          jvp[0], -0.5 * np.sin(x), atol=_tol_for_shots(shots)
      )
  
      if tape.shots.has_partitioned_shots:
          assert qml.math.allclose(
              res[0][1], np.cos(x), atol=_tol_for_shots(shots)
          )
          assert qml.math.allclose(
              jvp[0][1], -0.5 * np.sin(x), 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 1 for calling the TestJacobianProductResults obj's underlying member method code with example usage: obj.test_execute_jvp_basic(jpc, shots) without return types