class_docstr: Tests for integration with the PassthruQNode
class_docstr_tok: ["Tests","for","integration","with","the","PassthruQNode"]
docstr: Test that the device state can be differentiated
docstr_tok: ["Test","that","the","device","state","can","be","differentiated"]
code: def test_state_differentiability(self, wires, tol):
      """Test that the device state can be differentiated"""
      dev = qml.device("default.qubit.autograd", wires=wires)
  
      @qml.qnode(dev, diff_method="backprop", interface="autograd")
      def circuit(a):
          qml.RY(a, wires=wires[0])
          return qml.state()
  
      a = np.array(0.54, requires_grad=True)
  
      def cost(a):
          """A function of the device quantum state, as a function
          of input QNode parameters."""
          res = np.abs(circuit(a)) ** 2
          return res[1] - res[0]
  
      grad = qml.grad(cost)(a)
      expected = np.sin(a)
      assert np.allclose(grad, expected, atol=tol, rtol=0)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.devices.default_qubit_autograd import DefaultQubitAutograd
  from pennylane import DeviceError
label_desc: Use image node_id 6 for calling the TestPassthruIntegration obj's underlying member method code with example usage: obj.test_state_differentiability(wires, tol) and returns: qml, unknown