class_docstr: Generic Trace operation than can trace over:
  
  a) SymPy matrix
  b) operators
  c) outer products
  
  Parameters
  ==========
  o : operator, matrix, expr
  i : tuple/list indices (optional)
  
  Examples
  ========
  
  # TODO: Need to handle printing
  
  a) Trace(A+B) = Tr(A) + Tr(B)
  b) Trace(scalar*Operator) = scalar*Trace(Operator)
  
  >>> from sympy.physics.quantum.trace import Tr
  >>> from sympy import symbols, Matrix
  >>> a, b = symbols('a b', commutative=True)
  >>> A, B = symbols('A B', commutative=False)
  >>> Tr(a*A,[2])
  a*Tr(A)
  >>> m = Matrix([[1,2],[1,1]])
  >>> Tr(m)
  2
class_docstr_tok: ["Generic","Trace","operation","than","can","trace","over",":","a",")","SymPy","matrix","b",")","operators","c",")","outer","products","Parameters","==========","o",":","operator",",","matrix",",","expr","i",":","tuple\/list","indices","(","optional",")","Examples","========","#","TODO",":","Need","to","handle","printing","a",")","Trace","(","A+B",")","=","Tr","(","A",")","+","Tr","(","B",")","b",")","Trace","(","scalar","*","Operator",")","=","scalar","*","Trace","(","Operator",")",">",">",">","from","sympy.physics.quantum.trace","import","Tr",">",">",">","from","sympy","import","symbols",",","Matrix",">",">",">","a",",","b","=","symbols","(","'","a","b","'",",","commutative=True",")",">",">",">","A",",","B","=","symbols","(","'","A","B","'",",","commutative=False",")",">",">",">","Tr","(","a","*","A",",","[","2","]",")","a","*","Tr","(","A",")",">",">",">","m","=","Matrix","(","[","[","1,2","]",",","[","1,1","]","]",")",">",">",">","Tr","(","m",")","2"]
docstr: Permute the arguments cyclically.
  
  Parameters
  ==========
  
  pos : integer, if positive, shift-right, else shift-left
  
  Examples
  ========
  
  >>> from sympy.physics.quantum.trace import Tr
  >>> from sympy import symbols
  >>> A, B, C, D = symbols('A B C D', commutative=False)
  >>> t = Tr(A*B*C*D)
  >>> t.permute(2)
  Tr(C*D*A*B)
  >>> t.permute(-2)
  Tr(C*D*A*B)
docstr_tok: ["Permute","the","arguments","cyclically",".","Parameters","==========","pos",":","integer",",","if","positive",",","shift-right",",","else","shift-left","Examples","========",">",">",">","from","sympy.physics.quantum.trace","import","Tr",">",">",">","from","sympy","import","symbols",">",">",">","A",",","B",",","C",",","D","=","symbols","(","'","A","B","C","D","'",",","commutative=False",")",">",">",">","t","=","Tr","(","A","*","B","*","C","*","D",")",">",">",">","t.permute","(","2",")","Tr","(","C","*","D","*","A","*","B",")",">",">",">","t.permute","(","-2",")","Tr","(","C","*","D","*","A","*","B",")"]
code: def permute(self, pos):
      """Permute the arguments cyclically.
  
      Parameters
      ==========
  
      pos : integer, if positive, shift-right, else shift-left
  
      Examples
      ========
  
      >>> from sympy.physics.quantum.trace import Tr
      >>> from sympy import symbols
      >>> A, B, C, D = symbols('A B C D', commutative=False)
      >>> t = Tr(A*B*C*D)
      >>> t.permute(2)
      Tr(C*D*A*B)
      >>> t.permute(-2)
      Tr(C*D*A*B)
  
      """
      if pos > 0:
          pos = pos % len(self.args[0].args)
      else:
          pos = -(abs(pos) % len(self.args[0].args))
  
      args = list(self.args[0].args[-pos:] + self.args[0].args[0:-pos])
  
      return Tr(Mul(*(args)))
  
file_path: sympy/sympy/physics/quantum/trace.py
imports: from sympy.core.add import Add
  from sympy.core.containers import Tuple
  from sympy.core.expr import Expr
  from sympy.core.mul import Mul
  from sympy.core.power import Pow
  from sympy.core.sorting import default_sort_key
  from sympy.core.sympify import sympify
  from sympy.matrices import Matrix
label_desc: Use image node_id 5 for calling the Tr obj's underlying member method code with example usage: obj.permute(pos) and returns: Tr