class_docstr: An arbitrary Hermitian observable.
  
  For a Hermitian matrix :math:`A`, the expectation command returns the value
  
  .. math::
      \braket{A} = \braketT{\psi}{\cdots \otimes I\otimes A\otimes I\cdots}{\psi}
  
  where :math:`A` acts on the requested wires.
  
  If acting on :math:`N` wires, then the matrix :math:`A` must be of size
  :math:`2^N\times 2^N`.
  
  **Details:**
  
  * Number of wires: Any
  * Number of parameters: 1
  * Gradient recipe: None
  
  Args:
      A (array or Sequence): square hermitian matrix
      wires (Sequence[int] or int): the wire(s) the operation acts on
      id (str or None): String representing the operation (optional)
class_docstr_tok: ["An","arbitrary","Hermitian","observable",".","For","a","Hermitian","matrix",":","math",":","`","A","`",",","the","expectation","command","returns","the","value","..","math",":",":","\\braket","{","A","}","=","\\braketT","{","\\psi","}","{","\\cdots","\\otimes","I\\otimes","A\\otimes","I\\cdots","}","{","\\psi","}","where",":","math",":","`","A","`","acts","on","the","requested","wires",".","If","acting","on",":","math",":","`","N","`","wires",",","then","the","matrix",":","math",":","`","A","`","must","be","of","size",":","math",":","`","2^N\\times","2^N","`",".","*","*","Details",":","*","*","*","Number","of","wires",":","Any","*","Number","of","parameters",":","1","*","Gradient","recipe",":","None","Args",":","A","(","array","or","Sequence",")",":","square","hermitian","matrix","wires","(","Sequence","[","int","]","or","int",")",":","the","wire","(","s",")","the","operation","acts","on","id","(","str","or","None",")",":","String","representing","the","operation","(","optional",")"]
docstr: Return the eigendecomposition of the matrix specified by the Hermitian observable.
  
  This method uses pre-stored eigenvalues for standard observables where
  possible and stores the corresponding eigenvectors from the eigendecomposition.
  
  It transforms the input operator according to the wires specified.
  
  Returns:
      dict[str, array]: dictionary containing the eigenvalues and the eigenvectors of the Hermitian observable
docstr_tok: ["Return","the","eigendecomposition","of","the","matrix","specified","by","the","Hermitian","observable",".","This","method","uses","pre-stored","eigenvalues","for","standard","observables","where","possible","and","stores","the","corresponding","eigenvectors","from","the","eigendecomposition",".","It","transforms","the","input","operator","according","to","the","wires","specified",".","Returns",":","dict","[","str",",","array","]",":","dictionary","containing","the","eigenvalues","and","the","eigenvectors","of","the","Hermitian","observable"]
code: def eigendecomposition(self):
      """Return the eigendecomposition of the matrix specified by the Hermitian observable.
  
      This method uses pre-stored eigenvalues for standard observables where
      possible and stores the corresponding eigenvectors from the eigendecomposition.
  
      It transforms the input operator according to the wires specified.
  
      Returns:
          dict[str, array]: dictionary containing the eigenvalues and the eigenvectors of the Hermitian observable
      """
      Hmat = self.matrix()
      Hmat = qml.math.to_numpy(Hmat)
      Hkey = tuple(Hmat.flatten().tolist())
      if Hkey not in Hermitian._eigs:
          w, U = np.linalg.eigh(Hmat)
          Hermitian._eigs[Hkey] = {"eigvec": U, "eigval": w}
  
      return Hermitian._eigs[Hkey]
  
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 5 for calling the Hermitian obj's underlying member method code with example usage: obj.eigendecomposition() and returns: Hermitian