class_docstr: Integration tests for default.qubit.autograd. This test ensures it integrates
  properly with the PennyLane UI, in particular the new QNode.
class_docstr_tok: ["Integration","tests","for","default.qubit.autograd",".","This","test","ensures","it","integrates","properly","with","the","PennyLane","UI",",","in","particular","the","new","QNode","."]
docstr: Test that the device state is correct after applying a
  quantum function on the device
docstr_tok: ["Test","that","the","device","state","is","correct","after","applying","a","quantum","function","on","the","device"]
code: def test_correct_state(self, tol):
      """Test that the device state is correct after applying a
      quantum function on the device"""
  
      dev = qml.device("default.qubit.autograd", wires=2)
  
      state = dev.state
      expected = np.array([1, 0, 0, 0])
      assert np.allclose(state, expected, atol=tol, rtol=0)
  
      @qml.qnode(dev, interface="autograd", diff_method="backprop")
      def circuit():
          qml.Hadamard(wires=0)
          qml.RZ(np.pi / 4, wires=0)
          return qml.expval(qml.PauliZ(0))
  
      circuit()
      state = dev.state
  
      amplitude = np.exp(-1j * np.pi / 8) / np.sqrt(2)
  
      expected = np.array([amplitude, 0, np.conj(amplitude), 0])
      assert np.allclose(state, 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 5 for calling the TestQNodeIntegration obj's underlying member method code with example usage: obj.test_correct_state(tol) and returns: qml