class_docstr: Class to test the shape of the Grad/Jacobian/Hessian with different return types.
class_docstr_tok: ["Class","to","test","the","shape","of","the","Grad\/Jacobian\/Hessian","with","different","return","types","."]
docstr: The hessian of multiple measurements with multiple params return a tuple of arrays.
docstr_tok: ["The","hessian","of","multiple","measurements","with","multiple","params","return","a","tuple","of","arrays","."]
code: def test_hessian_probs_expval_multiple_params(
      self, dev_name, diff_method, grad_on_execution, shots, interface
  ):
      """The hessian of multiple measurements with multiple params return a tuple of arrays."""
  
      num_wires = 2
  
      if diff_method == "hadamard":
          num_wires = 4
  
      dev = qml.device(dev_name, wires=num_wires, shots=shots)
      if diff_method == "adjoint":
          pytest.skip(
              "Test does not supports adjoint because second order diff."
          )
      elif diff_method == "hadamard":
          pytest.skip(
              "Test does not supports diff of non commuting obs."
          )
  
      if shots is not None and diff_method in ("backprop", "adjoint"):
          pytest.skip(
              "Test does not support finite shots and adjoint/backprop"
          )
  
      par_0 = jax.numpy.array(0.1)
      par_1 = jax.numpy.array(0.2)
  
      @qnode(
          dev,
          interface=interface,
          diff_method=diff_method,
          max_diff=2,
          grad_on_execution=grad_on_execution,
      )
      def circuit(x, y):
          qml.RX(x, wires=[0])
          qml.RY(y, wires=[1])
          qml.CNOT(wires=[0, 1])
          return qml.expval(qml.PauliZ(0) @ qml.PauliX(1)), qml.probs(
              wires=[0]
          )
  
      hess = jax.hessian(circuit, argnums=[0, 1])(par_0, par_1)
  
      assert isinstance(hess, tuple)
      assert len(hess) == 2
  
      assert isinstance(hess[0], tuple)
      assert len(hess[0]) == 2
      assert isinstance(hess[0][0], tuple)
      assert len(hess[0][0]) == 2
      assert isinstance(hess[0][0][0], jax.numpy.ndarray)
      assert hess[0][0][0].shape == ()
      assert isinstance(hess[0][0][1], jax.numpy.ndarray)
      assert hess[0][0][1].shape == ()
      assert isinstance(hess[0][1], tuple)
      assert len(hess[0][1]) == 2
      assert isinstance(hess[0][1][0], jax.numpy.ndarray)
      assert hess[0][1][0].shape == ()
      assert isinstance(hess[0][1][1], jax.numpy.ndarray)
      assert hess[0][1][1].shape == ()
  
      assert isinstance(hess[1], tuple)
      assert len(hess[1]) == 2
      assert isinstance(hess[1][0], tuple)
      assert len(hess[1][0]) == 2
      assert isinstance(hess[1][0][0], jax.numpy.ndarray)
      assert hess[1][0][0].shape == (2,)
      assert isinstance(hess[1][0][1], jax.numpy.ndarray)
      assert hess[1][0][1].shape == (2,)
      assert isinstance(hess[1][1], tuple)
      assert len(hess[1][1]) == 2
      assert isinstance(hess[1][1][0], jax.numpy.ndarray)
      assert hess[1][1][0].shape == (2,)
      assert isinstance(hess[1][1][1], jax.numpy.ndarray)
      assert hess[1][1][1].shape == (2,)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane import qnode
  from pennylane.tape import QuantumScript
label_desc: Use image node_id 18 for calling the TestReturn obj's underlying member method code with example usage: obj.test_hessian_probs_expval_multiple_params(dev_name, diff_method, grad_on_execution, shots, interface) and returns: qml,  qml