The types ac_var, nc_var, commutative, anticommutative, and noncommutative
Calling Sequence
Parameters
Description
Examples
type(expr, xxx)
expr
-
any algebraic expression
xxx
any of: c_symbol, ac_symbol, nc_symbol, c_var, ac_var, nc_var, commutative, anticommutative, and noncommutative
The set of type subroutines `type/xxx`, where xxx is as described above, return true when the expression is of the corresponding type and false otherwise. These types are available only after loading the Physics package, or after having used any of its commands with the long form. These types are of use to recognize the commutative (C), anticommutative (AC), and noncommutative (NC) character of objects concerning products.
There are nine types that, for efficiency reasons, are organized in three sets of tree types each, where each set is a superset of the previous others.
The first set includes the most basic three types c_symbol, ac_symbol, and nc_symbol, which respectively recognize the commutative, anticommutative, or noncommutative character of a symbol (typically used to represent variables).
The second set includes the three types c_var, ac_var, and nc_var, which respectively recognize the commutative, anticommutative, and noncommutative character of names (symbols or indexed objects) and also functions.
CAVEAT: consider A, b, c, ... all of them either commutative or anticommutative symbols. Then indexed objects of the form A[b, ...], are considered commutative when the parity of the product A * b * ... is 1 and anticommutative otherwise; that is: commutative when there is an odd number of anticommutative variables, considering not just the indices but also the name of the indexed object. This is of relevance when computing with derivatives in jet notation.
The third set includes the three types commutative, anticommutative, or noncommutative to recognize the corresponding character of arbitrary Maple expressions of type algebraic.
The type ac_var identified var as anticommutative (AC) according to:
if var is a symbol beginning with an AC identifier followed by a positive number
or var is an indexed object or function with such a name
or var is a linear operation (e.g. differentiation) on a function with such a name
then true (exception made of CAVEAT above)
else false
Type type nc_var works the same way as ac_var but instead of looking for an anticommutative identifier it looks for a noncommutative identifier in the name of the functions or variables used.
The other three types, commutative, anticommutative, and noncommutative address a more complex task: the recognition of the C, AC, and NC character of an expression arbitrarily composed with sums, products, powers, functions, indexed objects, and constants. Note that an algebraic expression is classified here as C, AC, or NC in an exclusive manner; that is, it cannot have two of these characters at the same time. Concerning compositions of objects belonging to different classifications, the conventions adopted here are:
Products:
C * AC = AC * C
is of AC type
C * NC = NC * C
is of NC type
AC * NC <> NC * AC
Sums:
C + AC = AC + C
C + NC = NC + C
AC + NC = NC + AC
with⁡Physics:
Setup⁡mathematicalnotation=true
mathematicalnotation=true
Set first an identifier for anticommutative and noncommutative variables using Setup, for example:
Setup⁡anticommutativeprefix=Q,θ,noncommutativeprefix=Z
anticommutativeprefix=Q,θ,noncommutativeprefix=Z
Consider now the list of objects
ee≔θ,Q,Q⁡θ,x,f⁡x,f⁡θ,x,Z,Z⁡x,Z⁡θ
The first three are anticommutative, the next three are commutative and the last three are noncommutative:
map⁡type,ee,commutative
false,false,false,true,true,true,false,false,false
map⁡type,ee,anticommutative
true,true,true,false,false,false,false,false,false
map⁡type,ee,noncommutative
false,false,false,false,false,false,true,true,true
See Also
PDEtools[ToJet]
Physics
Physics conventions
Physics examples
Physics Updates
Tensors - a complete guide
Mini-Course Computer Algebra for Physicists
Physics/Setup
Physics[*]
Download Help Document