class_docstr: The Gell-Mann observables for qutrits
  
  The Gell-Mann matrices are a set of 8 linearly independent :math:`3 \times 3` traceless, Hermitian matrices which
  naturally generalize the Pauli matrices from :math:`SU(2)` to :math:`SU(3)`.
  
  .. math::
      \displaystyle \begin{align} \lambda_{1} &= \left(\begin{array}{ccc} 0 & 1 & 0 \\ 1 & 0 & 0\\ 0 & 0 & 0\end{array}\right) \;\;\;\;\;\;\;\;\;\;
      \lambda_{2} = \left(\begin{array}{ccc} 0 & -i & 0 \\ i & 0 & 0\\ 0 & 0 & 0\end{array}\right)\;\;\;\;\;\;\;\;\;\;
      \lambda_{3} = \left(\begin{array}{ccc} 1 & 0 & 0 \\ 0 & -1 & 0\\ 0 & 0 & 0\end{array}\right) \\
      \lambda_{4} &= \left(\begin{array}{ccc} 0 & 0 & 1 \\ 0 & 0 & 0\\ 1 & 0 & 0\end{array}\right)\;\;\;\;\;\;\;\;\;\;
      \lambda_{5} = \left(\begin{array}{ccc} 0 & 0 & -i \\ 0 & 0 & 0\\ i & 0 & 0\end{array}\right) \\
      \lambda_{6} &= \left(\begin{array}{ccc} 0 & 0 & 0 \\ 0 & 0 & 1\\ 0 & 1 & 0\end{array}\right)\;\;\;\;\;\;\;\;\;\;
      \lambda_{7} = \left(\begin{array}{ccc} 0 & 0 & 0 \\ 0 & 0 & -i\\ 0 & i & 0\end{array}\right)\;\;\;\;\;\;\;\;\;\;
      \lambda_{8} = \frac{1}{\sqrt{3}}\left(\begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0\\ 0 & 0 & -2\end{array}\right)\\ \end{align}
  
  **Details:**
  
  * Number of wires: 1
  * Number of parameters: 0
  * Gradient recipe: None
  
  Args:
      wires (Sequence[int] or int): the wire(s) the observable acts on
      index (int): The index of the Gell-Mann matrix to be used. Must be between 1
          and 8 inclusive
      id (str or None): String representing the operation (optional)
  
  **Example:**
  
  >>> dev = qml.device("default.qutrit", wires=2)
  >>> @qml.qnode(dev)
  ... def test_qnode():
  ...     qml.TShift(wires=0)
  ...     qml.TClock(wires=0)
  ...     qml.TShift(wires=1)
  ...     qml.TAdd(wires=[0, 1])
  ...     return qml.expval(qml.GellMann(wires=0, index=1))
  >>> print(test_qnode())
  0.0
  >>> print(qml.draw(test_qnode)())
  0: ──TShift──TClock─╭●────┤  <GellMann(1)>
  1: ──TShift─────────╰TAdd─┤
class_docstr_tok: ["The","Gell-Mann","observables","for","qutrits","The","Gell-Mann","matrices","are","a","set","of","8","linearly","independent",":","math",":","`","3","\\times","3","`","traceless",",","Hermitian","matrices","which","naturally","generalize","the","Pauli","matrices","from",":","math",":","`","SU","(","2",")","`","to",":","math",":","`","SU","(","3",")","`",".","..","math",":",":","\\displaystyle","\\begin","{","align","}","\\lambda_","{","1","}","&","=","\\left","(","\\begin","{","array","}","{","ccc","}","0","&","1","&","0","\\\\","1","&","0","&","0\\\\","0","&","0","&","0\\end","{","array","}","\\right",")","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\lambda_","{","2","}","=","\\left","(","\\begin","{","array","}","{","ccc","}","0","&","-i","&","0","\\\\","i","&","0","&","0\\\\","0","&","0","&","0\\end","{","array","}","\\right",")","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\lambda_","{","3","}","=","\\left","(","\\begin","{","array","}","{","ccc","}","1","&","0","&","0","\\\\","0","&","-1","&","0\\\\","0","&","0","&","0\\end","{","array","}","\\right",")","\\\\","\\lambda_","{","4","}","&","=","\\left","(","\\begin","{","array","}","{","ccc","}","0","&","0","&","1","\\\\","0","&","0","&","0\\\\","1","&","0","&","0\\end","{","array","}","\\right",")","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\lambda_","{","5","}","=","\\left","(","\\begin","{","array","}","{","ccc","}","0","&","0","&","-i","\\\\","0","&","0","&","0\\\\","i","&","0","&","0\\end","{","array","}","\\right",")","\\\\","\\lambda_","{","6","}","&","=","\\left","(","\\begin","{","array","}","{","ccc","}","0","&","0","&","0","\\\\","0","&","0","&","1\\\\","0","&","1","&","0\\end","{","array","}","\\right",")","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\lambda_","{","7","}","=","\\left","(","\\begin","{","array","}","{","ccc","}","0","&","0","&","0","\\\\","0","&","0","&","-i\\\\","0","&","i","&","0\\end","{","array","}","\\right",")","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\",";","\\lambda_","{","8","}","=","\\frac","{","1","}","{","\\sqrt","{","3","}","}","\\left","(","\\begin","{","array","}","{","ccc","}","1","&","0","&","0","\\\\","0","&","1","&","0\\\\","0","&","0","&","-2\\end","{","array","}","\\right",")","\\\\","\\end","{","align","}","*","*","Details",":","*","*","*","Number","of","wires",":","1","*","Number","of","parameters",":","0","*","Gradient","recipe",":","None","Args",":","wires","(","Sequence","[","int","]","or","int",")",":","the","wire","(","s",")","the","observable","acts","on","index","(","int",")",":","The","index","of","the","Gell-Mann","matrix","to","be","used",".","Must","be","between","1","and","8","inclusive","id","(","str","or","None",")",":","String","representing","the","operation","(","optional",")","*","*","Example",":","*","*",">",">",">","dev","=","qml.device","(","``","default.qutrit","''",",","wires=2",")",">",">",">","@","qml.qnode","(","dev",")","...","def","test_qnode","(",")",":","...","qml.TShift","(","wires=0",")","...","qml.TClock","(","wires=0",")","...","qml.TShift","(","wires=1",")","...","qml.TAdd","(","wires=","[","0",",","1","]",")","...","return","qml.expval","(","qml.GellMann","(","wires=0",",","index=1",")",")",">",">",">","print","(","test_qnode","(",")",")","0.0",">",">",">","print","(","qml.draw","(","test_qnode",")","(",")",")","0",":","\u2500\u2500TShift\u2500\u2500TClock\u2500\u256d\u25cf\u2500\u2500\u2500\u2500\u2524","<","GellMann","(","1",")",">","1",":","\u2500\u2500TShift\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2570TAdd\u2500\u2524"]
code: def __init__(self, wires, index=1, id=None):
      if not isinstance(index, int) or index < 1 or index > 8:
          raise ValueError(
              "The index of a Gell-Mann observable must be an integer between 1 and 8 inclusive."
          )
  
      self.hyperparameters["index"] = index
  
      super().__init__(wires=wires, id=id)
  
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 to create a new GellMann object from inherited base classes: Observable with example: obj = GellMann(wires, index, id)