Physics[Check] - check the occurrence of more than one noncommutative or anticommutative object in commutative products and the correctness of the free and repeated spacetime indices in a mathematical expression
|
Calling Sequence
|
|
Check(expression, indices = truefalse, kind_of_indices, products = truefalse, quiet)
|
|
Parameters
|
|
expression
|
-
|
any mathematical expression or relation between expressions
|
indices = truefalse
|
-
|
(optional) boolean value indicating whether to check the free and repeated indices in expression for correctness (default value is true)
|
kind_of_indices
|
-
|
(optional) one of the keywords free, repeated, or all; return a list or set with the specified kind of indices found
|
products = truefalse
|
-
|
(optional) boolean value indicating whether to check commutative products regarding incorrect presence of anti or noncommutative objects (default value is true)
|
quiet
|
-
|
(optional) indicates that the check should proceed without displaying messages on the screen
|
|
|
|
|
Description
|
|
•
|
The Check command receives a mathematical expression or a relation between expressions (such as an equation) and checks for incorrect free or repeated spacetime indices or ill-formed commutative products involving noncommutative or anticommutative objects.
|
|
NOTE: when the tensorial indices of a relation are being checked and the left-hand side or right-hand side is equal to 0, the relation is first transformed into the left-hand minus right-hand sides, then processed, and the output is returned accordingly, not as a relation - see the Examples section.
|
•
|
When checking the repeated and free indices of tensor objects (see Physics,Define), Check takes into account the sum rule for repeated indices. That is, it gives an error when the same index appears more than once in a product, or when the free indices of the summands of a given expression or that of the sides of a relation (for example, of an equation), are not the same.
|
•
|
If only the expression to be checked is given, Check makes the check of the indices mentioned and either returns NULL, displaying the message The repeated and free indices in the given expression check ok., or interrupts with an error pointing to the problem detected.
|
•
|
To avoid this checking of indices, use the optional argument indices = false.
|
•
|
When any of the optional keywords free, repeated, or all are given, instead of NULL, Check returns all, the free, or the repeated indices per term, respectively, as explained in the following examples.
|
•
|
When the Physics package is loaded, a more general `*` product operator is also loaded. Unlike the default Maple product operator (herein called the commutative product operator), the operator loaded with Physics does not assume commutativity of its operands, and instead operates like a commutative, anticommutative, or noncommutative product operator, depending on the operands. However, after loading Physics, the original commutative product operator is still available as :-`*`, and can be invoked as a function.
|
•
|
Regarding commutative products constructed by :-`*`, Check scans the received expression for incorrect occurrences with more than one noncommutative or anticommutative operand.
|
•
|
If the expression checks okay, a related message is displayed. Otherwise, an error message is triggered, and the commutative product involving not commutative objects is pointed out.
|
•
|
To avoid this checking of products, use the optional argument products = false.
|
|
|
Examples
|
|
|
Check free and repeated indices found in tensor expressions
|
|
| (1) |
>
|
|
| (2) |
|
To check the free and repeated indices found in tensor expressions for correctness, first Define the tensor objects of your problem.
|
>
|
|
| |
| (3) |
|
Consider now an expression where the (spacetime) tensors , , and appear in products and sums.
|
|
By inspecting this expression, you can see that is a repeated index, so the sum rule over ranging from 1 to the dimension of the spacetime is assumed, and and are free indices, the same in both terms of the sum. So everything is correct, and the Check command returns NULL (that is, it just displays the message).
|
| (5) |
|
To avoid displaying the message, use the optional keyword quiet, as in Check(expr, quiet). To actually return the free and repeated indices, use the optional parameter kind_of_indices.
|
| |
>
|
|
>
|
|
|
When the free or repeated indices are incorrect, an error interruption points to the problem found.
|
| |
|
When checking indices in equations (more generally, relations), the free indices of the left-hand and right-hand sides are expected to be the same, or an error message interrupting the computation is displayed, and the output is presented also as an equation (relation)
|
>
|
|
| |
>
|
|
| |
| (10) |
|
For practical reasons, this request of having the same free indices on both sides of an equation (more generally, a relation) is disregarded when one of these two sides is equal to 0, in which case the equation is first transformed into the left-hand minus right-hand sides, then processed, and the output is returned accordingly, not as a relation. So, for example, the output for the following equation is the same as the one you obtain for Check(A[mu,nu]*B[mu,rho] + C[nu,rho], all).
|
>
|
|
| |
|
|
Check noncommutative products
|
|
|
Note that when loading Physics at the beginning of this Examples section we have loaded the `*` operator that comes with the package, designed to handle anticommutative and noncommutative operands in products. For the purpose of illustrating Check with noncommutative variables, unload that command, and set a macro to refer to it instead:
|
>
|
|
>
|
|
>
|
|
| (12) |
|
So in what follows, variables prefixed by or , followed by a positive integer, are considered anticommutative and noncommutative, respectively.
|
|
Now consider the following product constructed by the generalized product operator of the Physics package (in what follows, `&*` represents this operator, due to the macro used), and also using the global product operator `*`
|
>
|
|
| (13) |
|
Although perhaps it is not evident on inspection, this product is ill-formed.
|
|
Analogously, products can be ill-formed regarding other types of problems.
|
>
|
|
| (14) |
>
|
|
| (15) |
|
When the products Check okay, a message is displayed.
|
>
|
|
| (16) |
| (17) |
|
To avoid displaying the message, use the optional keyword quiet, as in Check(%, quiet).
|
|
|
|