4.6 Setting symbols to commute or not commute

4.6.1 SetNonCommutative[A, B, C, ]

Aliases: SNC, SetNC
Description: SetNonCommutative[A, B, C, ] sets all the symbols A, B, C, to be noncommutative. The lower case letters a, b, c, are assumed noncommutative by Mathematica default as are functions of noncommutative variables. The functions tp[] and aj[] are set noncommutative by NCAlgebra for any argument, commutative or noncommutative. We may change this.
Arguments: Symbols separated by commas
Comments / Limitations: None

4.6.2 CommuteEverything[expr]

Aliases: CE
Description: It changes NonCommutativeMultiply to Times in expr.
Arguments: expr is an algebraic expression.
Comments / Limitations: Very useful for getting ideas in the middle of a complicated calcuation. If expr has you baffled, type exprcom = CE[expr]. exprcom is commutative and therefore is easy to analyze. Now expr is uneffected, so you can get back to working on it armed with new ideas.

4.6.3 SetCommutative[a, b, c, ]

Aliases: None
Description: SetCommutative[a, b, c, ] sets all the symbols a, b, c, to be commutative.
Arguments: Symbols separated by commas
Comments / Limitations: None

4.6.4 SetCommutingOperators[b,c]

Aliases: None
Description: SetCommutingOperators takes exactly two parameters. SetCommutingOperators[b, c] will implement the definitions which follow. They are in pseudo-code so that the meaning will not be obscured b ** c becomes c ** b if LeftQ[b, c]; and c ** b becomes b ** c if LeftQ[b, c]; ). See SetCommutingFunctions and LeftQ.
Arguments: b, c are symbols.
Comments / Limitations: NOTE: The above implementation will NOT lead to infinite loops.

 WARNING: If one says SetCommutingOperators[b, c] and then sets only LeftQ[c,b], then neither of the above rules will be executed. Therefore, one must remember the order of the two parameters in the statement. One obvious helpful habit would be to use alphabetical order (i.e., say SetCommutingOperators[a,b] and not the reverse).

4.6.5 LeftQ[expr]

Aliases: None
Description: See SetCommutingFunctions and SetCommutingOperators.
Arguments: expr is an algebraic expression.
Comments / Limitations: None

4.6.6 CommutativeQ[X]

Aliases: CQ
Description: CommutativeQ[X] is True if X is commutative, and False if X is noncommutative.
Arguments: X is a symbol.
Comments / Limitations: See the description of SetNonCommutative for the defaults.

4.6.7 CommutativeAllQ[expr]

Aliases: None
Description: CommutativeAllQ[expr] is True if expr does not have any non-commuting sub-expressions, and False otherwise.
Arguments: expr is an algebraic expression.
Comments / Limitations: None