class_docstr: TSWAP(wires)
  The ternary swap operator.
  
  This operation is analogous to the qubit SWAP and acts on two-qutrit computational basis states
  according to :math:`TSWAP\vert i, j\rangle = \vert j, i \rangle`. Its matrix representation is
  
  .. math:: TSWAP = \begin{bmatrix}
              1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
              0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
              0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
              0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
              0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
              0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\
              0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
              0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
              0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
          \end{bmatrix}
  
  **Details:**
  
  * Number of wires: 2
  * Number of parameters: 0
  
  Args:
      wires (Sequence[int]): the wires the operation acts on
class_docstr_tok: ["TSWAP","(","wires",")","The","ternary","swap","operator",".","This","operation","is","analogous","to","the","qubit","SWAP","and","acts","on","two-qutrit","computational","basis","states","according","to",":","math",":","`","TSWAP\\vert","i",",","j\\rangle","=","\\vert","j",",","i","\\rangle","`",".","Its","matrix","representation","is","..","math",":",":","TSWAP","=","\\begin","{","bmatrix","}","1","&","0","&","0","&","0","&","0","&","0","&","0","&","0","&","0","\\\\","0","&","0","&","0","&","1","&","0","&","0","&","0","&","0","&","0","\\\\","0","&","0","&","0","&","0","&","0","&","0","&","1","&","0","&","0","\\\\","0","&","1","&","0","&","0","&","0","&","0","&","0","&","0","&","0","\\\\","0","&","0","&","0","&","0","&","1","&","0","&","0","&","0","&","0","\\\\","0","&","0","&","0","&","0","&","0","&","0","&","0","&","1","&","0","\\\\","0","&","0","&","1","&","0","&","0","&","0","&","0","&","0","&","0","\\\\","0","&","0","&","0","&","0","&","0","&","1","&","0","&","0","&","0","\\\\","0","&","0","&","0","&","0","&","0","&","0","&","0","&","0","&","1","\\\\","\\end","{","bmatrix","}","*","*","Details",":","*","*","*","Number","of","wires",":","2","*","Number","of","parameters",":","0","Args",":","wires","(","Sequence","[","int","]",")",":","the","wires","the","operation","acts","on"]
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:`~.TSWAP.matrix`
  
  Returns:
      ndarray: matrix
  
  **Example**
  
  >>> print(qml.TSWAP.compute_matrix())
  [[1 0 0 0 0 0 0 0 0]
   [0 0 0 1 0 0 0 0 0]
   [0 0 0 0 0 0 1 0 0]
   [0 1 0 0 0 0 0 0 0]
   [0 0 0 0 1 0 0 0 0]
   [0 0 0 0 0 0 0 1 0]
   [0 0 1 0 0 0 0 0 0]
   [0 0 0 0 0 1 0 0 0]
   [0 0 0 0 0 0 0 0 1]]
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",":","`","~.TSWAP.matrix","`","Returns",":","ndarray",":","matrix","*","*","Example","*","*",">",">",">","print","(","qml.TSWAP.compute_matrix","(",")",")","[","[","1","0","0","0","0","0","0","0","0","]","[","0","0","0","1","0","0","0","0","0","]","[","0","0","0","0","0","0","1","0","0","]","[","0","1","0","0","0","0","0","0","0","]","[","0","0","0","0","1","0","0","0","0","]","[","0","0","0","0","0","0","0","1","0","]","[","0","0","1","0","0","0","0","0","0","]","[","0","0","0","0","0","1","0","0","0","]","[","0","0","0","0","0","0","0","0","1","]","]"]
code: def compute_matrix():  # pylint: disable=arguments-differ
      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:`~.TSWAP.matrix`
  
      Returns:
          ndarray: matrix
  
      **Example**
  
      >>> print(qml.TSWAP.compute_matrix())
      [[1 0 0 0 0 0 0 0 0]
       [0 0 0 1 0 0 0 0 0]
       [0 0 0 0 0 0 1 0 0]
       [0 1 0 0 0 0 0 0 0]
       [0 0 0 0 1 0 0 0 0]
       [0 0 0 0 0 0 0 1 0]
       [0 0 1 0 0 0 0 0 0]
       [0 0 0 0 0 1 0 0 0]
       [0 0 0 0 0 0 0 0 1]]
      """
      return np.array(
          [
              [1, 0, 0, 0, 0, 0, 0, 0, 0],
              [0, 0, 0, 1, 0, 0, 0, 0, 0],
              [0, 0, 0, 0, 0, 0, 1, 0, 0],
              [0, 1, 0, 0, 0, 0, 0, 0, 0],
              [0, 0, 0, 0, 1, 0, 0, 0, 0],
              [0, 0, 0, 0, 0, 0, 0, 1, 0],
              [0, 0, 1, 0, 0, 0, 0, 0, 0],
              [0, 0, 0, 0, 0, 1, 0, 0, 0],
              [0, 0, 0, 0, 0, 0, 0, 0, 1],
          ]
      )
  
imports: import numpy
  from pennylane.operation import Operation, AdjointUndefinedError
  from pennylane.wires import Wires
label_desc: Use image node_id 2 for calling the TSWAP obj's underlying member method code with example usage: obj.compute_matrix() and returns: np