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 gives a clear error if a value other than 0 or 1 is given.
docstr_tok: ["Tests","that","BasisState","gives","a","clear","error","if","a","value","other","than","0","or","1","is","given","."]
code: def test_BasisState_explicitly_checks_0_1(self):
      """Tests that BasisState gives a clear error if a value other than 0 or 1 is given."""
      op = qml.BasisState([2, 1], wires=[0, 1])
      with pytest.raises(
          ValueError,
          match="BasisState parameter must consist of 0 or 1 integers.",
      ):
          _ = op.state_vector()
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.wires import WireError
label_desc: Use image node_id 19 for calling the TestStateVector obj's underlying member method code with example usage: obj.test_BasisState_explicitly_checks_0_1() without return types