class_docstr: Tests for the projector observable.
class_docstr_tok: ["Tests","for","the","projector","observable","."]
docstr: Tests that we obtain a _BasisStateProjector when input is a basis state.
docstr_tok: ["Tests","that","we","obtain","a","_BasisStateProjector","when","input","is","a","basis","state","."]
code: def test_basisstate_projector(self):
      """Tests that we obtain a _BasisStateProjector when input is a basis state."""
      basis_state = [0, 1, 1, 0]
      wires = range(len(basis_state))
      basis_state_projector = qml.Projector(basis_state, wires)
      assert isinstance(basis_state_projector, BasisStateProjector)
  
      second_projector = qml.Projector(basis_state, wires)
      assert qml.equal(second_projector, basis_state_projector)
  
      qml.ops.functions.assert_valid(basis_state_projector)
  
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 1 for calling the TestProjector obj's underlying member method code with example usage: obj.test_basisstate_projector() without return types