class_docstr: Integration tests for default.mixed.autograd. This test ensures it integrates
  properly with the PennyLane UI, in particular the QNode.
class_docstr_tok: ["Integration","tests","for","default.mixed.autograd",".","This","test","ensures","it","integrates","properly","with","the","PennyLane","UI",",","in","particular","the","QNode","."]
docstr: Test that the device state is correct after evaluating a
  quantum function on the device
docstr_tok: ["Test","that","the","device","state","is","correct","after","evaluating","a","quantum","function","on","the","device"]
code: def test_correct_state(self, tol):
      """Test that the device state is correct after evaluating a
      quantum function on the device"""
  
      dev = qml.device("default.mixed", wires=2)
  
      state = dev.state
      expected = np.zeros((4, 4))
      expected[0, 0] = 1
      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 / 4) / 2
      expected = np.array(
          [
              [0.5, 0, amplitude, 0],
              [0, 0, 0, 0],
              [np.conj(amplitude), 0, 0.5, 0],
              [0, 0, 0, 0],
          ]
      )
  
      assert np.allclose(state, expected, atol=tol, rtol=0)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.devices.default_mixed import DefaultMixed
  from pennylane import DeviceError
label_desc: Use image node_id 4 for calling the TestQNodeIntegration obj's underlying member method code with example usage: obj.test_correct_state(tol) and returns: qml