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.
>
|
|
| (1) |
>
|
|
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.
>
|
|
%AntiCommutator(theta[1],theta[2])
| |
At this point, and are just any two commutative symbols, so by expanding or evaluating the Commutator and AntiCommutator above, you get:
Compare these results with the active forms of Commutator and AntiCommutator: (only) the automatic simplifications Commutator(A, B) -> 0 and , when or is commutative, are performed.
>
|
|
Set and to be the prefix of noncommutative and anticommutative variables, respectively, and compute the expanded form of and again. In this example, evaluating the operation is different from expanding; they are only equal for the Anticommutator when they result in or 2AB.
>
|
|
| (8) |
Some normalization of noncommutative products is performed before returning.
>
|
|
| (15) |
Here again, the active form recognizes the zero; you can activate the inert form to see this, by using the value command.
Define two quantum operators and a commutator algebra for them.
>
|
|
| |
| |
| |
| (18) |
With few restrictions, Commutator algebras can also be set for powers of quantum operators. Consider two conjugate operators; that is, satisfying:
>
|
|
| |
| |
| |
| (22) |
After setting the algebra as in the input line above, you have:
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 . For these cases, you can set a rule for the power directly that will also work when the exponent is equal to 1.
>
|
|
| |
| |
| (28) |
| (31) |