AntiCommutator - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Physics : AntiCommutator

Physics[Commutator] - the commutator A B - B A

Physics[AntiCommutator] - the anti-commutator A B + B A

Calling Sequence

Commutator(A, B)

AntiCommutator(A, B)

Parameters

A, B

-

any two algebraic expressions

Description

• 

The Commutator and AntiCommutator commands represent ABBA and AB+BA, respectively, where A and B may be non commutative objects. The output of AntiCommutator(A, B) and Commutator(A, B) is:

– 

If A and B commute, Anticommutator returns 2AB and Commutator returns 0.

– 

You can indicate the result for the Commutator or AntiCommutator by setting algebra rules.

– 

The entered function call may return unevaluated.

• 

The %Commutator and %AntiCommutator commands are the inert forms of Commutator and AntiCommutator; that is, they represent the same mathematical operations while displaying the operations unevaluated. To evaluate the operations, use the value or expand commands.

• 

Commutators and AntiCommutators can also be expanded by using the expand or Physics[Expand] command. When the output is expanded, it is normalized and any repeated indices in products of tensors (defined as such by Define) are automatically simplified by the Simplify command.

• 

Activating the inert operation by using value is the same as expanding it by using expand, except when the result of the Commutator is 0 or the result of the AntiCommutator is 2AB. Otherwise, evaluating just replaces the inert % operators by the active ones in the output.

• 

When the Physics package is loaded, two routines for the enhanced display of unevaluated and inert Commutators and AntiCommutators are loaded together, so that Commutators are shown as a "list" of two operands, subscripted with the `-` sign. AntiCommutators are shown also as a list of two operands, subscripted with the `+` sign. In the literature, AntiCommutators are displayed as two operands inside curly brackets { }. This notation is not used in Maple to avoid potential confusion with Maple sets, displayed using curly brackets, where the order of the operators is not fixed.

Examples

As with the other commands in the Physics package, you can use the inert form, which is the command's name prefixed by the % character.

withPhysics:

Setupmathematicalnotation=true

mathematicalnotation=true

(1)

e1%CommutatorZ1,Z2

e1Z1,Z2

(2)

Note that the display above is obtained by using a `print/Commutator` routine (see print). The actual computational structure above is visible by using the lprint command.

lprint

%Commutator(Z[1],Z[2])

e2%AntiCommutatorθ1,θ2

e2θ1,θ2+

(3)

lprint

%AntiCommutator(theta[1],theta[2])

At this point, Z and θ are just any two commutative symbols, so by expanding or evaluating the Commutator and AntiCommutator above, you get:

expande1=valuee1

0=0

(4)

expande2=valuee2

2θ1θ2=2θ1θ2

(5)

Compare these results with the active forms of Commutator and AntiCommutator: (only) the automatic simplifications Commutator(A, B) -> 0 and AntiCommutatorA,B2AB, when A or B is commutative, are performed.

CommutatorZ1,Z2

0

(6)

AntiCommutatorθ1,θ2

2θ1θ2

(7)

Set Z and θ to be the prefix of noncommutative and anticommutative variables, respectively, and compute the expanded form of e1 and e2 again. In this example, evaluating the operation is different from expanding; they are only equal for the Anticommutator e2 when they result in 0 or 2AB.

Setupanticommutativeprefix=θ,noncommutativeprefix=Z

anticommutativeprefix=θ,noncommutativeprefix=Z

(8)

e1

Z1,Z2

(9)

expand=value

Z1Z2Z2Z1=Z1,Z2

(10)

e2

θ1,θ2+

(11)

expand=value

0=0

(12)

Some normalization of noncommutative products is performed before returning.

e3θ1+θ2

e3θ1+θ2

(13)

e4θ1θ2

e4θ1θ2

(14)

e5%Commutatorθ1e3,θ2e4

e5θ1θ1+θ2,θ2θ1θ2

(15)

expande5

0

(16)

Here again, the active form recognizes the zero; you can activate the inert form to see this, by using the value command.

valuee5

0

(17)

Define two quantum operators and a commutator algebra for them.

Setupquantumop=P,R,algebrarule=%CommutatorRj,Pk=IKroneckerDeltaj,k

* Partial match of 'quantumop' against keyword 'quantumoperators'

* Partial match of 'algebrarule' against keyword 'algebrarules'

_______________________________________________________

algebrarules=Rj,Pk=Iδj,k,quantumoperators=P,R

(18)

CommutatorR1,P2

0

(19)

CommutatorR2,P2

I

(20)

CommutatorRn,Pm

Iδm,n

(21)

With few restrictions, Commutator algebras can also be set for powers of quantum operators. Consider two conjugate operators; that is, satisfying:

Setupquantumop=P,Q,algebrarule=%CommutatorQ,P=I

* Partial match of 'quantumop' against keyword 'quantumoperators'

* Partial match of 'algebrarule' against keyword 'algebrarules'

_______________________________________________________

algebrarules=Q,P=I,Rj,Pk=Iδj,k,quantumoperators=P,Q,R

(22)

CommutatorQ,P

I

(23)

After setting the algebra as in the input line above, you have:

CommutatorQ,P2

2IP

(24)

CommutatorQ2,P3

3IQ,P2+

(25)

Simplify

6IQP2+6P

(26)

CommutatorQ,Pm

Q,Pm

(27)

So the Commutator rule set suffices to compute when the power of the operator is an integer but not when it is a symbol, as in Pm. For these cases, you can set a rule for the power directly that will also work when the exponent is equal to 1.

Setupredo,algebra=%CommutatorQ,Pm=ImPm1

* Partial match of 'algebra' against keyword 'algebrarules'

_______________________________________________________

algebrarules=Q,Pm=ImPm1

(28)

CommutatorQ,P

I

(29)

CommutatorQ2,P3

3I2IP+2P2Q

(30)

CommutatorQ2,Ps

IsIs1Ps2+2Ps1Q

(31)

See Also

Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Setup, Simplify, SortProducts, type/algebraic, type/anticommutative, type/commutative, type/noncommutative, value