class_docstr: Tests for integration with the PassthruQNode
class_docstr_tok: ["Tests","for","integration","with","the","PassthruQNode"]
docstr: Tests correct output shape and evaluation for a tape
  with prob and expval outputs
docstr_tok: ["Tests","correct","output","shape","and","evaluation","for","a","tape","with","prob","and","expval","outputs"]
code: def test_ragged_differentiation(
      self, dev_name, diff_method, grad_on_execution, tol
  ):
      """Tests correct output shape and evaluation for a tape
      with prob and expval outputs"""
  
      dev = qml.device(dev_name, wires=2)
      x = torch.tensor(0.543, dtype=torch.float64)
      y = torch.tensor(-0.654, dtype=torch.float64)
  
      @qml.qnode(
          dev,
          diff_method=diff_method,
          grad_on_execution=grad_on_execution,
          interface="torch",
      )
      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.probs(wires=[1])
  
      res = circuit(x, y)
  
      expected = torch.tensor(
          [
              torch.cos(x),
              (1 + torch.cos(x) * torch.cos(y)) / 2,
              (1 - torch.cos(x) * torch.cos(y)) / 2,
          ]
      )
      assert torch.allclose(
          qml.math.hstack(res), expected, atol=tol, rtol=0
      )
  
      res_x, res_y = torch.autograd.functional.jacobian(circuit, (x, y))
      expected_x = torch.tensor(
          [
              -torch.sin(x),
              -torch.sin(x) * torch.cos(y) / 2,
              torch.cos(y) * torch.sin(x) / 2,
          ]
      )
      expected_y = torch.tensor(
          [
              0,
              -torch.cos(x) * torch.sin(y) / 2,
              torch.cos(x) * torch.sin(y) / 2,
          ]
      )
  
      assert torch.allclose(
          expected_x,
          qml.math.hstack([res_x[0], res_y[0]]),
          atol=tol,
          rtol=0,
      )
      assert torch.allclose(
          expected_y,
          qml.math.hstack([res_x[1], res_y[1]]),
          atol=tol,
          rtol=0,
      )
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.devices.default_mixed import DefaultMixed
label_desc: Use image node_id 13 for calling the TestPassthruIntegration obj's underlying member method code with example usage: obj.test_ragged_differentiation(dev_name, diff_method, grad_on_execution, tol) and returns: qml,  qml