class_docstr: Tests for the basis state projector observable.
class_docstr_tok: ["Tests","for","the","basis","state","projector","observable","."]
docstr: Tests that the projector construction raises the proper errors on incorrect inputs.
docstr_tok: ["Tests","that","the","projector","construction","raises","the","proper","errors","on","incorrect","inputs","."]
code: def test_projector_exceptions(self):
      """Tests that the projector construction raises the proper errors on incorrect inputs."""
      dev = qml.device("default.qubit", wires=2)
  
      @qml.qnode(dev)
      def circuit(basis_state):
          obs = qml.Projector(basis_state, wires=range(2))
          return qml.expval(obs)
  
      with pytest.raises(
          ValueError, match="Basis state must only consist of 0s"
      ):
          basis_state = np.array([0, 2])
          circuit(basis_state)
  
imports: import functools
  import pickle
  import pytest
  import numpy
  from gate_data import I, X, Y, Z, H
  import pennylane
  from pennylane.ops.qubit.observables import BasisStateProjector, StateVectorProjector
label_desc: Use image node_id 3 for calling the TestBasisStateProjector obj's underlying member method code with example usage: obj.test_projector_exceptions() and returns: qml