class_docstr: Tests that the debugger works for a simple circuit
docstr: Tests debugger with autograd
docstr_tok: ["Tests","debugger","with","autograd"]
code: def test_debugger_autograd(self):
      """Tests debugger with autograd"""
      phi = qml.numpy.array(-0.52)
      debugger = self.Debugger()
  
      def f(x):
          ops = [
              qml.Snapshot(),
              qml.RX(x, wires=0),
              qml.Snapshot("final_state"),
          ]
          qs = qml.tape.QuantumScript(
              ops,
              [qml.expval(qml.PauliY(0)), qml.expval(qml.PauliZ(0))],
          )
          return qml.numpy.array(simulate(qs, debugger=debugger))
  
      result = f(phi)
      expected = np.array([-np.sin(phi), np.cos(phi)])
      assert qml.math.allclose(result, expected)
  
      assert list(debugger.snapshots.keys()) == [0, "final_state"]
      assert qml.math.allclose(debugger.snapshots[0], [1, 0])
      assert qml.math.allclose(
          debugger.snapshots["final_state"],
          [np.cos(phi / 2), -np.sin(phi / 2) * 1j],
      )
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.devices.qubit import simulate, get_final_state, measure_final_state
label_desc: Use image node_id 2 for calling the TestDebugger obj's underlying member method code with example usage: obj.test_debugger_autograd() and returns: qml