class_docstr: Projector(state, wires, id=None)
  Observable corresponding to the state projector :math:`P=\ket{\phi}\bra{\phi}`.
  
  The expectation of this observable returns the value
  
  .. math::
      |\langle \psi | \phi \rangle |^2
  
  corresponding to the probability that :math:`|\psi\rangle` is projected onto :math:`|\phi\rangle` during measurement.
  
  **Details:**
  
  * Number of wires: Any
  * Number of parameters: 1
  * Gradient recipe: None
  
  Args:
      state (tensor-like): Input state of shape ``(n,)`` for a basis-state projector, or ``(2**n,)``
          for a state-vector projector.
      wires (Iterable): wires that the projector acts on.
      id (str or None): String representing the operation (optional).
  
  **Example**
  
  In the following example we consider projectors over two states: the :math:`|00\rangle` and the
  :math:`|++\rangle`. Since the first one is in the computational basis, we create its projector
  directly from its basis state representation, which is, ``zero_state=[0, 0]``. For the latter,
  we need to use its state vector form ``plusplus_state=np.array([1, 1, 1, 1])/2``.
  
  .. code-block::
  
      >>> dev = qml.device("default.qubit", wires=2)
      >>> @qml.qnode(dev)
      ... def circuit(state):
      ...     return qml.expval(qml.Projector(state, wires=[0, 1]))
      >>> zero_state = [0, 0]
      >>> circuit(zero_state)
      1.
      >>> plusplus_state = np.array([1, 1, 1, 1]) / 2
      >>> circuit(plusplus_state)
      0.25
class_docstr_tok: ["Projector","(","state",",","wires",",","id=None",")","Observable","corresponding","to","the","state","projector",":","math",":","`","P=\\ket","{","\\phi","}","\\bra","{","\\phi","}","`",".","The","expectation","of","this","observable","returns","the","value","..","math",":",":","|\\langle","\\psi","|","\\phi","\\rangle","|^2","corresponding","to","the","probability","that",":","math",":","`","|\\psi\\rangle","`","is","projected","onto",":","math",":","`","|\\phi\\rangle","`","during","measurement",".","*","*","Details",":","*","*","*","Number","of","wires",":","Any","*","Number","of","parameters",":","1","*","Gradient","recipe",":","None","Args",":","state","(","tensor-like",")",":","Input","state","of","shape","``","(","n",",",")","``","for","a","basis-state","projector",",","or","``","(","2","*","*","n",",",")","``","for","a","state-vector","projector",".","wires","(","Iterable",")",":","wires","that","the","projector","acts","on",".","id","(","str","or","None",")",":","String","representing","the","operation","(","optional",")",".","*","*","Example","*","*","In","the","following","example","we","consider","projectors","over","two","states",":","the",":","math",":","`","|00\\rangle","`","and","the",":","math",":","`","|++\\rangle","`",".","Since","the","first","one","is","in","the","computational","basis",",","we","create","its","projector","directly","from","its","basis","state","representation",",","which","is",",","``","zero_state=","[","0",",","0","]","``",".","For","the","latter",",","we","need","to","use","its","state","vector","form","``","plusplus_state=np.array","(","[","1",",","1",",","1",",","1","]",")","\/2","``",".","..","code-block",":",":",">",">",">","dev","=","qml.device","(","``","default.qubit","''",",","wires=2",")",">",">",">","@","qml.qnode","(","dev",")","...","def","circuit","(","state",")",":","...","return","qml.expval","(","qml.Projector","(","state",",","wires=","[","0",",","1","]",")",")",">",">",">","zero_state","=","[","0",",","0","]",">",">",">","circuit","(","zero_state",")","1",".",">",">",">","plusplus_state","=","np.array","(","[","1",",","1",",","1",",","1","]",")","\/","2",">",">",">","circuit","(","plusplus_state",")","0.25"]
docstr: Raise this projector to the power ``z``.
docstr_tok: ["Raise","this","projector","to","the","power","``","z","``","."]
code: def pow(self, z):
      """Raise this projector to the power ``z``."""
      return (
          [copy(self)]
          if (isinstance(z, int) and z > 0)
          else super().pow(z)
      )
  
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 2 for calling the Projector obj's underlying member method code with example usage: obj.pow(z) and returns: unknown