class_docstr: Tests for the state function
class_docstr_tok: ["Tests","for","the","state","function"]
docstr: Test that the returned state is equal to the expected returned state for all of
  PennyLane's built in statevector devices
docstr_tok: ["Test","that","the","returned","state","is","equal","to","the","expected","returned","state","for","all","of","PennyLane","'s","built","in","statevector","devices"]
code: def test_default_qubit_autograd(self, diff_method):
      """Test that the returned state is equal to the expected returned state for all of
      PennyLane's built in statevector devices"""
  
      dev = qml.device("default.qubit.autograd", wires=4)
  
      @qml.qnode(dev, diff_method=diff_method)
      def func():
          for i in range(4):
              qml.Hadamard(i)
          return state()
  
      state_val = func()
      state_expected = 0.25 * np.ones(16)
  
      assert np.allclose(state_val, state_expected)
      assert np.allclose(state_val, dev.state)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.devices import DefaultQubitLegacy
  from pennylane.measurements import State, Shots, density_matrix, expval, state
label_desc: Use image node_id 13 for calling the TestState obj's underlying member method code with example usage: obj.test_default_qubit_autograd(diff_method) and returns: state