class_docstr: Tests for integration with the PassthruQNode
class_docstr_tok: ["Tests","for","integration","with","the","PassthruQNode"]
docstr: Test that the device probability vector can be differentiated directly
docstr_tok: ["Test","that","the","device","probability","vector","can","be","differentiated","directly"]
code: def test_prob_vector_differentiability(self, tol):
      """Test that the device probability vector can be differentiated directly"""
      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)
  
      res = circuit(a, b)
  
      expected = torch.tensor(
          [
              torch.cos(a / 2) ** 2 * torch.cos(b / 2) ** 2
              + torch.sin(a / 2) ** 2 * torch.sin(b / 2) ** 2,
              torch.cos(a / 2) ** 2 * torch.sin(b / 2) ** 2
              + torch.sin(a / 2) ** 2 * torch.cos(b / 2) ** 2,
          ]
      )
      assert torch.allclose(res, expected, atol=tol, rtol=0)
  
      grad_a, grad_b = torch.autograd.functional.jacobian(
          circuit, (a, b)
      )
  
      assert torch.allclose(
          grad_a,
          0.5
          * torch.tensor(
              [
                  -torch.sin(a) * torch.cos(b),
                  torch.sin(a) * torch.cos(b),
              ]
          ),
      )
      assert torch.allclose(
          grad_b,
          0.5
          * torch.tensor(
              [
                  -torch.cos(a) * torch.sin(b),
                  torch.cos(a) * torch.sin(b),
              ]
          ),
      )
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.devices.default_mixed import DefaultMixed
label_desc: Use image node_id 8 for calling the TestPassthruIntegration obj's underlying member method code with example usage: obj.test_prob_vector_differentiability(tol) and returns: qml