class_docstr: Tests for integration with the PassthruQNode
class_docstr_tok: ["Tests","for","integration","with","the","PassthruQNode"]
docstr: Test that the device probability can be differentiated
docstr_tok: ["Test","that","the","device","probability","can","be","differentiated"]
code: def test_prob_differentiability(self, tol):
      """Test that the device probability can be differentiated"""
      dev = qml.device("default.mixed", wires=2)
  
      @qml.qnode(dev, diff_method="backprop", interface="torch")
      def circuit(a, b):
          qml.RX(a, wires=0)
          qml.RY(b, wires=1)
          qml.CNOT(wires=[0, 1])
          return qml.probs(wires=[1])
  
      a = torch.tensor(0.54, dtype=torch.float64, requires_grad=True)
      b = torch.tensor(0.12, dtype=torch.float64, requires_grad=True)
  
      probs = circuit(a, b)
      res = probs[1] - probs[0]
      res.backward()
  
      expected = -torch.cos(a) * torch.cos(b)
      assert torch.allclose(res, expected, atol=tol, rtol=0)
  
      assert torch.allclose(
          a.grad, torch.sin(a) * torch.cos(b), atol=tol, rtol=0
      )
      assert torch.allclose(
          b.grad, torch.cos(a) * torch.sin(b), 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 7 for calling the TestPassthruIntegration obj's underlying member method code with example usage: obj.test_prob_differentiability(tol) and returns: qml