class_docstr: The standard commutator, in an unevaluated state.
  
  Explanation
  ===========
  
  Evaluating a commutator is defined [1]_ as: ``[A, B] = A*B - B*A``. This
  class returns the commutator in an unevaluated form. To evaluate the
  commutator, use the ``.doit()`` method.
  
  Canonical ordering of a commutator is ``[A, B]`` for ``A < B``. The
  arguments of the commutator are put into canonical order using ``__cmp__``.
  If ``B < A``, then ``[B, A]`` is returned as ``-[A, B]``.
  
  Parameters
  ==========
  
  A : Expr
      The first argument of the commutator [A,B].
  B : Expr
      The second argument of the commutator [A,B].
  
  Examples
  ========
  
  >>> from sympy.physics.quantum import Commutator, Dagger, Operator
  >>> from sympy.abc import x, y
  >>> A = Operator('A')
  >>> B = Operator('B')
  >>> C = Operator('C')
  
  Create a commutator and use ``.doit()`` to evaluate it:
  
  >>> comm = Commutator(A, B)
  >>> comm
  [A,B]
  >>> comm.doit()
  A*B - B*A
  
  The commutator orders it arguments in canonical order:
  
  >>> comm = Commutator(B, A); comm
  -[A,B]
  
  Commutative constants are factored out:
  
  >>> Commutator(3*x*A, x*y*B)
  3*x**2*y*[A,B]
  
  Using ``.expand(commutator=True)``, the standard commutator expansion rules
  can be applied:
  
  >>> Commutator(A+B, C).expand(commutator=True)
  [A,C] + [B,C]
  >>> Commutator(A, B+C).expand(commutator=True)
  [A,B] + [A,C]
  >>> Commutator(A*B, C).expand(commutator=True)
  [A,C]*B + A*[B,C]
  >>> Commutator(A, B*C).expand(commutator=True)
  [A,B]*C + B*[A,C]
  
  Adjoint operations applied to the commutator are properly applied to the
  arguments:
  
  >>> Dagger(Commutator(A, B))
  -[Dagger(A),Dagger(B)]
  
  References
  ==========
  
  .. [1] https://en.wikipedia.org/wiki/Commutator
class_docstr_tok: ["The","standard","commutator",",","in","an","unevaluated","state",".","Explanation","===========","Evaluating","a","commutator","is","defined","[","1","]","_","as",":","``","[","A",",","B","]","=","A","*","B","-","B","*","A","``",".","This","class","returns","the","commutator","in","an","unevaluated","form",".","To","evaluate","the","commutator",",","use","the","``",".doit","(",")","``","method",".","Canonical","ordering","of","a","commutator","is","``","[","A",",","B","]","``","for","``","A","<","B","``",".","The","arguments","of","the","commutator","are","put","into","canonical","order","using","``","__cmp__","``",".","If","``","B","<","A","``",",","then","``","[","B",",","A","]","``","is","returned","as","``","-","[","A",",","B","]","``",".","Parameters","==========","A",":","Expr","The","first","argument","of","the","commutator","[","A",",","B","]",".","B",":","Expr","The","second","argument","of","the","commutator","[","A",",","B","]",".","Examples","========",">",">",">","from","sympy.physics.quantum","import","Commutator",",","Dagger",",","Operator",">",">",">","from","sympy.abc","import","x",",","y",">",">",">","A","=","Operator","(","'","A","'",")",">",">",">","B","=","Operator","(","'","B","'",")",">",">",">","C","=","Operator","(","'","C","'",")","Create","a","commutator","and","use","``",".doit","(",")","``","to","evaluate","it",":",">",">",">","comm","=","Commutator","(","A",",","B",")",">",">",">","comm","[","A",",","B","]",">",">",">","comm.doit","(",")","A","*","B","-","B","*","A","The","commutator","orders","it","arguments","in","canonical","order",":",">",">",">","comm","=","Commutator","(","B",",","A",")",";","comm","-","[","A",",","B","]","Commutative","constants","are","factored","out",":",">",">",">","Commutator","(","3","*","x","*","A",",","x","*","y","*","B",")","3","*","x","*","*","2","*","y","*","[","A",",","B","]","Using","``",".expand","(","commutator=True",")","``",",","the","standard","commutator","expansion","rules","can","be","applied",":",">",">",">","Commutator","(","A+B",",","C",")",".expand","(","commutator=True",")","[","A",",","C","]","+","[","B",",","C","]",">",">",">","Commutator","(","A",",","B+C",")",".expand","(","commutator=True",")","[","A",",","B","]","+","[","A",",","C","]",">",">",">","Commutator","(","A","*","B",",","C",")",".expand","(","commutator=True",")","[","A",",","C","]","*","B","+","A","*","[","B",",","C","]",">",">",">","Commutator","(","A",",","B","*","C",")",".expand","(","commutator=True",")","[","A",",","B","]","*","C","+","B","*","[","A",",","C","]","Adjoint","operations","applied","to","the","commutator","are","properly","applied","to","the","arguments",":",">",">",">","Dagger","(","Commutator","(","A",",","B",")",")","-","[","Dagger","(","A",")",",","Dagger","(","B",")","]","References","==========","..","[","1","]","https",":","\/\/en.wikipedia.org\/wiki\/Commutator"]
code: def _pretty(self, printer, *args):
      pform = printer._print(self.args[0], *args)
      pform = prettyForm(*pform.right(prettyForm(",")))
      pform = prettyForm(
          *pform.right(printer._print(self.args[1], *args))
      )
      pform = prettyForm(*pform.parens(left="[", right="]"))
      return pform
  
imports: from sympy.core.add import Add
  from sympy.core.expr import Expr
  from sympy.core.mul import Mul
  from sympy.core.power import Pow
  from sympy.core.singleton import S
  from sympy.printing.pretty.stringpict import prettyForm
  from sympy.physics.quantum.dagger import Dagger
  from sympy.physics.quantum.operator import Operator
label_desc: Use image node_id 9 for calling the Commutator obj's underlying member method code with example usage: obj._pretty(printer) and returns: pform