class_docstr: Test that tapes ending with expectations
  of Hamiltonians provide correct results and gradients
class_docstr_tok: ["Test","that","tapes","ending","with","expectations","of","Hamiltonians","provide","correct","results","and","gradients"]
docstr: Analytic jacobian of cost_fn above
docstr_tok: ["Analytic","jacobian","of","cost_fn","above"]
code: def cost_fn_jacobian(weights, coeffs1, coeffs2):
      """Analytic jacobian of cost_fn above"""
      a, b, c = coeffs1
      d = coeffs2[0]
      x, y = weights
      return np.array(
          [
              [
                  -c * np.cos(x) * np.sin(y)
                  - np.sin(x) * (a + b * np.sin(y)),
                  b * np.cos(x) * np.cos(y) - c * np.cos(y) * np.sin(x),
                  np.cos(x),
                  np.cos(x) * np.sin(y),
                  -(np.sin(x) * np.sin(y)),
                  0,
              ],
              [-d * np.sin(x), 0, 0, 0, 0, np.cos(x)],
          ]
      )
  
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 TestHamiltonianWorkflows obj's underlying member method code with example usage: obj.cost_fn_jacobian(weights, coeffs1, coeffs2) and returns: np