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 one stored in dev.state for a template
  circuit
docstr_tok: ["Test","that","the","returned","state","is","equal","to","the","one","stored","in","dev.state","for","a","template","circuit"]
code: def test_state_equal_to_dev_state(self, wires):
      """Test that the returned state is equal to the one stored in dev.state for a template
      circuit"""
  
      dev = qml.device("default.qubit.legacy", wires=wires)
  
      weights = np.random.random(
          qml.templates.StronglyEntanglingLayers.shape(
              n_layers=3, n_wires=wires
          )
      )
  
      @qml.qnode(dev)
      def func():
          qml.templates.StronglyEntanglingLayers(
              weights, wires=range(wires)
          )
          return state()
  
      state_val = func()
      assert np.allclose(state_val, func.device.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 5 for calling the TestState obj's underlying member method code with example usage: obj.test_state_equal_to_dev_state(wires) and returns: state