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: 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:`~.THermitian.matrix`
  
  Args:
      A (tensor_like): Hermitian matrix
  
  Returns:
      tensor_like: canonical matrix
  
  **Example**
  
  >>> A = np.array([[6+0j, 1-2j, 0],[1+2j, -1, 0], [0, 0, 1]])
  >>> qml.THermitian.compute_matrix(A)
  [[ 6.+0.j  1.-2.j  0.+0.j]
   [ 1.+2.j -1.+0.j  0.+0.j]
   [ 0.+0.j  0.+0.j  1.+0.j]]
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",":","`","~.THermitian.matrix","`","Args",":","A","(","tensor_like",")",":","Hermitian","matrix","Returns",":","tensor_like",":","canonical","matrix","*","*","Example","*","*",">",">",">","A","=","np.array","(","[","[","6+0j",",","1-2j",",","0","]",",","[","1+2j",",","-1",",","0","]",",","[","0",",","0",",","1","]","]",")",">",">",">","qml.THermitian.compute_matrix","(","A",")","[","[","6.+0.j","1.-2.j","0.+0.j","]","[","1.+2.j","-1.+0.j","0.+0.j","]","[","0.+0.j","0.+0.j","1.+0.j","]","]"]
code: def compute_matrix(A):
      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:`~.THermitian.matrix`
  
      Args:
          A (tensor_like): Hermitian matrix
  
      Returns:
          tensor_like: canonical matrix
  
      **Example**
  
      >>> A = np.array([[6+0j, 1-2j, 0],[1+2j, -1, 0], [0, 0, 1]])
      >>> qml.THermitian.compute_matrix(A)
      [[ 6.+0.j  1.-2.j  0.+0.j]
       [ 1.+2.j -1.+0.j  0.+0.j]
       [ 0.+0.j  0.+0.j  1.+0.j]]
      """
      return Hermitian.compute_matrix(A)
  
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 1 for calling the THermitian obj's underlying member method code with example usage: obj.compute_matrix(A) and returns: Hermitian