class_docstr: Test that using vector-valued QNodes with JAX integrate with the
  PennyLane stack
class_docstr_tok: ["Test","that","using","vector-valued","QNodes","with","JAX","integrate","with","the","PennyLane","stack"]
docstr: Test jacobian calculation
docstr_tok: ["Test","jacobian","calculation"]
code: def test_diff_expval_expval(
      self,
      dev,
      diff_method,
      grad_on_execution,
      device_vjp,
      interface,
      tol,
  ):
      """Test jacobian calculation"""
      kwargs = {
          "diff_method": diff_method,
          "interface": interface,
          "grad_on_execution": grad_on_execution,
          "device_vjp": device_vjp,
      }
  
      if diff_method == "spsa":
          kwargs["sampler_rng"] = np.random.default_rng(SEED_FOR_SPSA)
          tol = TOL_FOR_SPSA
      if "lightning" in getattr(dev, "short_name", ""):
          pytest.xfail(
              "lightning device_vjp not compatible with jax.jacobian."
          )
  
      a = jax.numpy.array(0.1)
      b = jax.numpy.array(0.2)
  
      @qnode(dev, **kwargs)
      def circuit(a, b):
          qml.RY(a, wires=0)
          qml.RX(b, wires=1)
          qml.CNOT(wires=[0, 1])
          return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliY(1))
  
      res = circuit(a, b)
  
      assert circuit.qtape.trainable_params == []
      assert isinstance(res, tuple)
      assert len(res) == 2
  
      expected = [np.cos(a), -np.cos(a) * np.sin(b)]
      assert np.allclose(res[0], expected[0], atol=tol, rtol=0)
      assert np.allclose(res[1], expected[1], atol=tol, rtol=0)
  
      res = jax.jacobian(circuit, argnums=[0, 1])(a, b)
      expected = np.array(
          [
              [-np.sin(a), 0],
              [np.sin(a) * np.sin(b), -np.cos(a) * np.cos(b)],
          ]
      )
      assert circuit.qtape.trainable_params == [0, 1]
      assert isinstance(res, tuple)
      assert len(res) == 2
  
      assert isinstance(res[0], tuple)
      assert isinstance(res[0][0], jax.numpy.ndarray)
      assert res[0][0].shape == ()
      assert np.allclose(res[0][0], expected[0][0], atol=tol, rtol=0)
      assert isinstance(res[0][1], jax.numpy.ndarray)
      assert res[0][1].shape == ()
      assert np.allclose(res[0][1], expected[0][1], atol=tol, rtol=0)
  
      assert isinstance(res[1], tuple)
      assert isinstance(res[1][0], jax.numpy.ndarray)
      assert res[1][0].shape == ()
      assert np.allclose(res[1][0], expected[1][0], atol=tol, rtol=0)
      assert isinstance(res[1][1], jax.numpy.ndarray)
      assert res[1][1].shape == ()
      assert np.allclose(res[1][1], expected[1][1], atol=tol, rtol=0)
  
imports: from itertools import product
  import numpy
  import pytest
  import pennylane
  from pennylane import qnode
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 1 for calling the TestVectorValuedQNode obj's underlying member method code with example usage: obj.test_diff_expval_expval(dev, diff_method, grad_on_execution, device_vjp, interface, tol) and returns: qml,  qml