class_docstr: Test vector-valued jacobian returns for the JAX Python interface.
class_docstr_tok: ["Test","vector-valued","jacobian","returns","for","the","JAX","Python","interface","."]
docstr: Test the jacobian computation with multiple tapes with probability
  and expectation value computations.
docstr_tok: ["Test","the","jacobian","computation","with","multiple","tapes","with","probability","and","expectation","value","computations","."]
code: def test_multi_tape_jacobian_probs_expvals(self, execute_kwargs):
      """Test the jacobian computation with multiple tapes with probability
      and expectation value computations."""
  
      adjoint = (
          execute_kwargs.get("gradient_kwargs", {}).get("method", "")
          == "adjoint_jacobian"
      )
      if adjoint:
          pytest.skip(
              "The adjoint diff method doesn't support probabilities."
          )
  
      def cost(x, y, device, interface, ek):
          with qml.queuing.AnnotatedQueue() as q1:
              qml.RX(x, wires=[0])
              qml.RY(y, wires=[1])
              qml.CNOT(wires=[0, 1])
              qml.expval(qml.PauliZ(0))
              qml.expval(qml.PauliZ(1))
  
          tape1 = qml.tape.QuantumScript.from_queue(q1)
          with qml.queuing.AnnotatedQueue() as q2:
              qml.RX(x, wires=[0])
              qml.RY(y, wires=[1])
              qml.CNOT(wires=[0, 1])
              qml.probs(wires=[0])
              qml.probs(wires=[1])
  
          tape2 = qml.tape.QuantumScript.from_queue(q2)
          return qml.execute(
              [tape1, tape2], device, **ek, interface=interface
          )
  
      dev = qml.device("default.qubit.legacy", wires=2)
      x = jax.numpy.array(0.543)
      y = jax.numpy.array(-0.654)
  
      x_ = np.array(0.543)
      y_ = np.array(-0.654)
  
      exec_jax = cost(
          x, y, dev, interface="jax-python", ek=execute_kwargs
      )
      exec_autograd = cost(
          x_, y_, dev, interface="autograd", ek=execute_kwargs
      )
  
      assert all(
          np.allclose(exec_jax[i][j], exec_autograd[i][j])
          for i in range(2)
          for j in range(2)
      )
  
      res = jax.jacobian(cost, argnums=(0, 1))(
          x, y, dev, interface="jax-python", ek=execute_kwargs
      )
  
      assert isinstance(res, list)
      assert len(res) == 2
  
      for r, exp_shape in zip(res, [(), (2,)]):
          assert isinstance(r, tuple)
          assert len(r) == 2
          assert len(r[0]) == 2
          assert isinstance(r[0][0], jax.numpy.ndarray)
          assert r[0][0].shape == exp_shape
          assert isinstance(r[0][1], jax.numpy.ndarray)
          assert r[0][1].shape == exp_shape
          assert len(r[1]) == 2
          assert isinstance(r[1][0], jax.numpy.ndarray)
          assert r[1][0].shape == exp_shape
          assert isinstance(r[1][1], jax.numpy.ndarray)
          assert r[1][1].shape == exp_shape
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.gradients import param_shift
  from pennylane import execute
label_desc: Use image node_id 5 for calling the TestVectorValued obj's underlying member method code with example usage: obj.test_multi_tape_jacobian_probs_expvals(execute_kwargs) and returns: qml