class_docstr: Observable corresponding to the state projector :math:`P=\ket{\phi}\bra{\phi}`, where
  :math:`\phi` denotes a basis state.
class_docstr_tok: ["Observable","corresponding","to","the","state","projector",":","math",":","`","P=\\ket","{","\\phi","}","\\bra","{","\\phi","}","`",",","where",":","math",":","`","\\phi","`","denotes","a","basis","state","."]
code: def __init__(self, state, wires, id=None):
      wires = Wires(wires)
      state = list(qml.math.toarray(state).astype(int))
  
      if not set(state).issubset({0, 1}):
          raise ValueError(
              f"Basis state must only consist of 0s and 1s; got {state}"
          )
  
      super().__init__(state, wires=wires, id=id)
  
imports: from copy import copy
  from collections.abc import Sequence
  import numpy
  from scipy.sparse import csr_matrix
  import pennylane
  from pennylane.operation import AnyWires, Observable, Operation
  from pennylane.wires import Wires
  from .matrix_ops import QubitUnitary
label_desc: Use image node_id 1 to create a new BasisStateProjector object from inherited base classes: Projector, Operation with example: obj = BasisStateProjector(state, wires, id)