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 BasisState state_vector returns kets as expected.
docstr_tok: ["Tests","that","BasisState","state_vector","returns","kets","as","expected","."]
code: def test_BasisState_state_vector(
      self, num_wires, wire_order, one_position
  ):
      """Tests that BasisState state_vector returns kets as expected."""
      basis_op = qml.BasisState([0, 1], wires=[1, 2])
      ket = basis_op.state_vector(wire_order=wire_order)
      assert qml.math.shape(ket) == (2,) * num_wires
      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 15 for calling the TestStateVector obj's underlying member method code with example usage: obj.test_BasisState_state_vector(num_wires, wire_order, one_position) without return types