class_docstr: Observable corresponding to the state projector :math:`P=\ket{\phi}\bra{\phi}`, where
  :math:`\phi` denotes a state.
class_docstr_tok: ["Observable","corresponding","to","the","state","projector",":","math",":","`","P=\\ket","{","\\phi","}","\\bra","{","\\phi","}","`",",","where",":","math",":","`","\\phi","`","denotes","a","state","."]
docstr: Representation of the operator as a canonical matrix in the computational basis (static method).
  
  The canonical matrix is the textbook matrix representation that does not consider wires.
  Implicitly, this assumes that the wires of the operator correspond to the global wire order.
  
  .. seealso:: :meth:`~.Projector.matrix`
  
  Args:
      state_vector (Iterable): state vector to project on
  
  Returns:
      ndarray: matrix
  
  **Example**
  
  The projector of the state :math:`\frac{1}{\sqrt{2}}(\ket{01}+\ket{10})`
  
  >>> StateVectorProjector.compute_matrix([0, 1/np.sqrt(2), 1/np.sqrt(2), 0])
  [[0. 0.  0.  0.]
   [0. 0.5 0.5 0.]
   [0. 0.5 0.5 0.]
   [0. 0.  0.  0.]]
docstr_tok: ["Representation","of","the","operator","as","a","canonical","matrix","in","the","computational","basis","(","static","method",")",".","The","canonical","matrix","is","the","textbook","matrix","representation","that","does","not","consider","wires",".","Implicitly",",","this","assumes","that","the","wires","of","the","operator","correspond","to","the","global","wire","order",".","..","seealso",":",":",":","meth",":","`","~.Projector.matrix","`","Args",":","state_vector","(","Iterable",")",":","state","vector","to","project","on","Returns",":","ndarray",":","matrix","*","*","Example","*","*","The","projector","of","the","state",":","math",":","`","\\frac","{","1","}","{","\\sqrt","{","2","}","}","(","\\ket","{","01","}","+\\ket","{","10","}",")","`",">",">",">","StateVectorProjector.compute_matrix","(","[","0",",","1\/np.sqrt","(","2",")",",","1\/np.sqrt","(","2",")",",","0","]",")","[","[","0",".","0",".","0",".","0",".","]","[","0",".","0.5","0.5","0",".","]","[","0",".","0.5","0.5","0",".","]","[","0",".","0",".","0",".","0",".","]","]"]
code: def compute_matrix(
      state_vector,
  ):  # pylint: disable=arguments-differ,arguments-renamed
      r"""Representation of the operator as a canonical matrix in the computational basis (static method).
  
      The canonical matrix is the textbook matrix representation that does not consider wires.
      Implicitly, this assumes that the wires of the operator correspond to the global wire order.
  
      .. seealso:: :meth:`~.Projector.matrix`
  
      Args:
          state_vector (Iterable): state vector to project on
  
      Returns:
          ndarray: matrix
  
      **Example**
  
      The projector of the state :math:`\frac{1}{\sqrt{2}}(\ket{01}+\ket{10})`
  
      >>> StateVectorProjector.compute_matrix([0, 1/np.sqrt(2), 1/np.sqrt(2), 0])
      [[0. 0.  0.  0.]
       [0. 0.5 0.5 0.]
       [0. 0.5 0.5 0.]
       [0. 0.  0.  0.]]
      """
      return qml.math.outer(state_vector, qml.math.conj(state_vector))
  
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 4 for calling the StateVectorProjector obj's underlying member method code with example usage: obj.compute_matrix(state_vector) and returns: qml