class_docstr: Tests that ensure various qubit circuits integrate correctly
class_docstr_tok: ["Tests","that","ensure","various","qubit","circuits","integrate","correctly"]
docstr: Test hessian calculation of a scalar valued QNode
docstr_tok: ["Test","hessian","calculation","of","a","scalar","valued","QNode"]
code: def test_hessian_unused_parameter(
      self,
      interface,
      dev,
      diff_method,
      grad_on_execution,
      device_vjp,
      tol,
  ):
      """Test hessian calculation of a scalar valued QNode"""
      if diff_method not in {"parameter-shift", "backprop"}:
          pytest.skip("Test only supports parameter-shift or backprop")
  
      @qnode(
          dev,
          diff_method=diff_method,
          interface=interface,
          grad_on_execution=grad_on_execution,
          device_vjp=device_vjp,
          max_diff=2,
      )
      def circuit(x):
          qml.RY(x[0], wires=0)
          return qml.expval(qml.PauliZ(0))
  
      x = np.array([1.0, 2.0], requires_grad=True)
      res = circuit(x)
  
      a, _ = x
  
      expected_res = np.cos(a)
      assert np.allclose(res, expected_res, atol=tol, rtol=0)
  
      grad_fn = qml.grad(circuit)
  
      hess = qml.jacobian(grad_fn)(x)
  
      expected_hess = [
          [-np.cos(a), 0],
          [0, 0],
      ]
  
      if diff_method in {"finite-diff"}:
          tol = 10e-2
  
      assert np.allclose(hess, expected_hess, atol=tol, rtol=0)
  
imports: import autograd
  import autograd.numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane import qnode
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 9 for calling the TestQubitIntegration obj's underlying member method code with example usage: obj.test_hessian_unused_parameter(interface, dev, diff_method, grad_on_execution, device_vjp, tol) and returns: qml