class_docstr: An arbitrary Hermitian observable for qutrits.
  
  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:`3^N\times 3^N`.
  
  **Details:**
  
  * Number of wires: Any
  * Number of parameters: 1
  * Gradient recipe: None
  
  Args:
      A (array): square Hermitian matrix
      wires (Sequence[int] or int): the wire(s) the operation acts on
      id (str or None): String representing the operation (optional)
  
  .. note::
      :class:`Hermitian` cannot be used with qutrit devices due to its use of
      :class:`QubitUnitary` in :meth:`~.Hermitian.compute_diagonalizing_gates`.
class_docstr_tok: ["An","arbitrary","Hermitian","observable","for","qutrits",".","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",":","`","3^N\\times","3^N","`",".","*","*","Details",":","*","*","*","Number","of","wires",":","Any","*","Number","of","parameters",":","1","*","Gradient","recipe",":","None","Args",":","A","(","array",")",":","square","Hermitian","matrix","wires","(","Sequence","[","int","]","or","int",")",":","the","wire","(","s",")","the","operation","acts","on","id","(","str","or","None",")",":","String","representing","the","operation","(","optional",")","..","note",":",":",":","class",":","`","Hermitian","`","can","not","be","used","with","qutrit","devices","due","to","its","use","of",":","class",":","`","QubitUnitary","`","in",":","meth",":","`","~.Hermitian.compute_diagonalizing_gates","`","."]
docstr: Sequence of gates that diagonalize the operator in the computational basis (static method).
  
  Given the eigendecomposition :math:`O = U \Sigma U^{\dagger}` where
  :math:`\Sigma` is a diagonal matrix containing the eigenvalues,
  the sequence of diagonalizing gates implements the unitary :math:`U^{\dagger}`.
  
  The diagonalizing gates rotate the state into the eigenbasis
  of the operator.
  
  .. seealso:: :meth:`~.THermitian.diagonalizing_gates`.
  
  Args:
      eigenvectors (array): eigenvectors of the operator, as extracted from op.eigendecomposition["eigvec"]
      wires (Iterable[Any], Wires): wires that the operator acts on
  Returns:
      list[.Operator]: list of diagonalizing gates
  
  **Example**
  
  >>> A = np.array([[-6, 2 + 1j, 0], [2 - 1j, 0, 0], [0, 0, 1]])
  >>> _, evecs = np.linalg.eigh(A)
  >>> qml.THermitian.compute_diagonalizing_gates(evecs, wires=[0])
  [QutritUnitary(tensor([[-0.94915323-0.j    0.1407893 +0.2815786j  -0.        -0.j  ]
                         [ 0.31481445-0.j    0.42447423+0.84894846j  0.        -0.j  ]
                         [ 0.        -0.j    0.        -0.j          1.        -0.j  ]], requires_grad=True), wires=[0])]
docstr_tok: ["Sequence","of","gates","that","diagonalize","the","operator","in","the","computational","basis","(","static","method",")",".","Given","the","eigendecomposition",":","math",":","`","O","=","U","\\Sigma","U^","{","\\dagger","}","`","where",":","math",":","`","\\Sigma","`","is","a","diagonal","matrix","containing","the","eigenvalues",",","the","sequence","of","diagonalizing","gates","implements","the","unitary",":","math",":","`","U^","{","\\dagger","}","`",".","The","diagonalizing","gates","rotate","the","state","into","the","eigenbasis","of","the","operator",".","..","seealso",":",":",":","meth",":","`","~.THermitian.diagonalizing_gates","`",".","Args",":","eigenvectors","(","array",")",":","eigenvectors","of","the","operator",",","as","extracted","from","op.eigendecomposition","[","``","eigvec","''","]","wires","(","Iterable","[","Any","]",",","Wires",")",":","wires","that","the","operator","acts","on","Returns",":","list","[",".Operator","]",":","list","of","diagonalizing","gates","*","*","Example","*","*",">",">",">","A","=","np.array","(","[","[","-6",",","2","+","1j",",","0","]",",","[","2","-","1j",",","0",",","0","]",",","[","0",",","0",",","1","]","]",")",">",">",">","_",",","evecs","=","np.linalg.eigh","(","A",")",">",">",">","qml.THermitian.compute_diagonalizing_gates","(","evecs",",","wires=","[","0","]",")","[","QutritUnitary","(","tensor","(","[","[","-0.94915323-0.j","0.1407893","+0.2815786j","-0",".","-0.j","]","[","0.31481445-0.j","0.42447423+0.84894846j","0",".","-0.j","]","[","0",".","-0.j","0",".","-0.j","1",".","-0.j","]","]",",","requires_grad=True",")",",","wires=","[","0","]",")","]"]
code: def compute_diagonalizing_gates(
      eigenvectors, wires
  ):  # pylint: disable=arguments-differ
      r"""Sequence of gates that diagonalize the operator in the computational basis (static method).
  
      Given the eigendecomposition :math:`O = U \Sigma U^{\dagger}` where
      :math:`\Sigma` is a diagonal matrix containing the eigenvalues,
      the sequence of diagonalizing gates implements the unitary :math:`U^{\dagger}`.
  
      The diagonalizing gates rotate the state into the eigenbasis
      of the operator.
  
      .. seealso:: :meth:`~.THermitian.diagonalizing_gates`.
  
      Args:
          eigenvectors (array): eigenvectors of the operator, as extracted from op.eigendecomposition["eigvec"]
          wires (Iterable[Any], Wires): wires that the operator acts on
      Returns:
          list[.Operator]: list of diagonalizing gates
  
      **Example**
  
      >>> A = np.array([[-6, 2 + 1j, 0], [2 - 1j, 0, 0], [0, 0, 1]])
      >>> _, evecs = np.linalg.eigh(A)
      >>> qml.THermitian.compute_diagonalizing_gates(evecs, wires=[0])
      [QutritUnitary(tensor([[-0.94915323-0.j    0.1407893 +0.2815786j  -0.        -0.j  ]
                             [ 0.31481445-0.j    0.42447423+0.84894846j  0.        -0.j  ]
                             [ 0.        -0.j    0.        -0.j          1.        -0.j  ]], requires_grad=True), wires=[0])]
  
      """
      return [QutritUnitary(eigenvectors.conj().T, wires=wires)]
  
file_path: pennylane/pennylane/ops/qutrit/observables.py
imports: import numpy
  import pennylane
  from pennylane.operation import Observable
  from pennylane.ops.qubit import Hermitian
  from pennylane.ops.qutrit import QutritUnitary
label_desc: Use image node_id 3 for calling the THermitian obj's underlying member method code with example usage: obj.compute_diagonalizing_gates(eigenvectors, wires) and returns: list