class_docstr: Tests for integration with the PassthruQNode
docstr: Test that the device state can be differentiated
code: def test_state_differentiability(
      self, decorator, op, wire_ids, exp_fn, tol
  ):
      """Test that the device state can be differentiated"""
      # pylint: disable=too-many-arguments
      config.config.update("jax_enable_x64", True)
  
      dev = qml.device("default.mixed", wires=1)
  
      @qml.qnode(dev, interface="jax", diff_method="backprop")
      def circuit(a):
          qml.PauliX(dev.wires[wire_ids[0]])
          op(a, wires=[dev.wires[idx] for idx in wire_ids])
          return qml.state()
  
      a = jnp.array(0.54)
  
      def cost(a):
          res = jnp.abs(circuit(a)) ** 2
          return res[1][1] - res[0][0]
  
      grad = decorator(jax.grad(cost))(a)
      expected = exp_fn(a)
  
      assert np.allclose(grad, expected, atol=tol, rtol=0)
  
imports: from functools import partial
  import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.devices.default_mixed import DefaultMixed
label_desc: Use image node_id 4 for calling the TestPassthruIntegration obj's underlying member method code with example usage: obj.test_state_differentiability(decorator, op, wire_ids, exp_fn, tol) and returns: qml, unknown