class_docstr: Tests that the template defines the correct decomposition.
class_docstr_tok: ["Tests","that","the","template","defines","the","correct","decomposition","."]
docstr: Checks that the correct state is prepared.
docstr_tok: ["Checks","that","the","correct","state","is","prepared","."]
code: def test_state(self, state):
      """Checks that the correct state is prepared."""
  
      n_qubits = 2
      dev = qml.device("default.qubit", wires=n_qubits)
  
      @qml.qnode(dev)
      def circuit(x=None):
          qml.BasisEmbedding(features=x, wires=range(2))
          return [qml.expval(qml.PauliZ(i)) for i in range(n_qubits)]
  
      res = circuit(x=state)
      expected = [1 if s == 0 else -1 for s in state]
      assert np.allclose(res, expected)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 2 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_state(state) and returns: unknown