class_docstr: Tests that ensure various qubit circuits integrate correctly
class_docstr_tok: ["Tests","that","ensure","various","qubit","circuits","integrate","correctly"]
docstr: Tests correct output shape and evaluation for a tape
  with multiple prob outputs
docstr_tok: ["Tests","correct","output","shape","and","evaluation","for","a","tape","with","multiple","prob","outputs"]
code: def test_multiple_probability_differentiation(
      self,
      interface,
      dev,
      diff_method,
      grad_on_execution,
      device_vjp,
      tol,
  ):
      """Tests correct output shape and evaluation for a tape
      with multiple prob outputs"""
      if "lightning" in getattr(dev, "short_name", ""):
          pytest.xfail(
              "lightning does not support measuring probabilities with adjoint."
          )
      kwargs = dict(
          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
  
      x = np.array(0.543, requires_grad=True)
      y = np.array(-0.654, requires_grad=True)
  
      @qnode(dev, **kwargs)
      def circuit(x, y):
          qml.RX(x, wires=[0])
          qml.RY(y, wires=[1])
          qml.CNOT(wires=[0, 1])
          return qml.probs(wires=[0]), qml.probs(wires=[1])
  
      res = circuit(x, y)
  
      expected = np.array(
          [
              [np.cos(x / 2) ** 2, np.sin(x / 2) ** 2],
              [
                  (1 + np.cos(x) * np.cos(y)) / 2,
                  (1 - np.cos(x) * np.cos(y)) / 2,
              ],
          ]
      )
      assert np.allclose(res, expected, atol=tol, rtol=0)
  
      def cost(x, y):
          return autograd.numpy.hstack(circuit(x, y))
  
      res = qml.jacobian(cost)(x, y)
  
      assert isinstance(res, tuple) and len(res) == 2
      assert res[0].shape == (4,)
      assert res[1].shape == (4,)
  
      expected = (
          np.array(
              [
                  [
                      -np.sin(x) / 2,
                      np.sin(x) / 2,
                      -np.sin(x) * np.cos(y) / 2,
                      np.sin(x) * np.cos(y) / 2,
                  ],
              ]
          ),
          np.array(
              [
                  [
                      0,
                      0,
                      -np.cos(x) * np.sin(y) / 2,
                      np.cos(x) * np.sin(y) / 2,
                  ],
              ]
          ),
      )
      assert all(
          np.allclose(r, e, atol=tol, rtol=0)
          for r, e in zip(res, expected)
      )
  
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 2 for calling the TestQubitIntegration obj's underlying member method code with example usage: obj.test_multiple_probability_differentiation(interface, dev, diff_method, grad_on_execution, device_vjp, tol) and returns: qml,  qml, autograd