class_docstr: Test the autograd interface execute function
  integrates well for both forward and backward execution
class_docstr_tok: ["Test","the","autograd","interface","execute","function","integrates","well","for","both","forward","and","backward","execution"]
docstr: Test jacobian calculation
docstr_tok: ["Test","jacobian","calculation"]
code: def test_jacobian(self, execute_kwargs, shots, device):
      """Test jacobian calculation"""
      a = np.array(0.1, requires_grad=True)
      b = np.array(0.2, requires_grad=True)
  
      def cost(a, b):
          ops = [
              qml.RY(a, wires=0),
              qml.RX(b, wires=1),
              qml.CNOT(wires=[0, 1]),
          ]
          m = [qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliY(1))]
          tape = qml.tape.QuantumScript(ops, m, shots=shots)
          return autograd.numpy.hstack(
              execute([tape], device, **execute_kwargs)[0]
          )
  
      res = cost(a, b)
      expected = [np.cos(a), -np.cos(a) * np.sin(b)]
      if shots.has_partitioned_shots:
          assert np.allclose(
              res[:2], expected, atol=atol_for_shots(shots), rtol=0
          )
          assert np.allclose(
              res[2:], expected, atol=atol_for_shots(shots), rtol=0
          )
      else:
          assert np.allclose(
              res, expected, atol=atol_for_shots(shots), rtol=0
          )
  
      res = qml.jacobian(cost)(a, b)
      assert isinstance(res, tuple) and len(res) == 2
      if shots.has_partitioned_shots:
          assert res[0].shape == (4,)
          assert res[1].shape == (4,)
  
          expected = (
              [-np.sin(a), np.sin(a) * np.sin(b)],
              [0, -np.cos(a) * np.cos(b)],
          )
          for _r, _e in zip(res, expected):
              assert np.allclose(_r[:2], _e, atol=atol_for_shots(shots))
              assert np.allclose(_r[2:], _e, atol=atol_for_shots(shots))
      else:
          assert res[0].shape == (2,)
          assert res[1].shape == (2,)
  
          expected = (
              [-np.sin(a), np.sin(a) * np.sin(b)],
              [0, -np.cos(a) * np.cos(b)],
          )
          for _r, _e in zip(res, expected):
              assert np.allclose(_r, _e, atol=atol_for_shots(shots))
  
imports: import autograd
  import pytest
  from param_shift_dev import ParamShiftDerivativesDevice
  from pennylane import numpy
  import pennylane
  from pennylane.devices import DefaultQubit
  from pennylane.gradients import param_shift
  from pennylane import execute
  from pennylane.measurements import Shots
label_desc: Use image node_id 3 for calling the TestAutogradExecuteIntegration obj's underlying member method code with example usage: obj.test_jacobian(execute_kwargs, shots, device) and returns: autograd