class_docstr: Test the state_vector() method of various state-prep operations.
class_docstr_tok: ["Test","the","state_vector","(",")","method","of","various","state-prep","operations","."]
docstr: Tests that StatePrep state_vector returns kets as expected.
docstr_tok: ["Tests","that","StatePrep","state_vector","returns","kets","as","expected","."]
code: def test_StatePrep_state_vector(
      self, num_wires, wire_order, one_position
  ):
      """Tests that StatePrep state_vector returns kets as expected."""
      qsv_op = qml.StatePrep([0, 0, 1, 0], wires=[1, 2])  # |10>
      ket = qsv_op.state_vector(wire_order=wire_order)
      assert ket[one_position] == 1
      ket[
          one_position
      ] = 0  # everything else should be zero, as we assert below
      assert np.allclose(np.zeros((2,) * num_wires), ket)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.wires import WireError
label_desc: Use image node_id 1 for calling the TestStateVector obj's underlying member method code with example usage: obj.test_StatePrep_state_vector(num_wires, wire_order, one_position) without return types