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 illformed commutative products involving noncommutative or anticommutative objects.

•

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 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 examples below.

•

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) 
>


 (4) 
>


 (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.

>


 (6) 
>


 (7) 
>


 (8) 

When the free or repeated indices are incorrect, an error interruption points to the problem found.

>


 (9) 
>


>


 (10) 
>




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:

>


>


>


 (11) 

So in what follows, variables prefixed by or , followed by a positive integer, are considered anticommutative and noncommutative, respectively.


Consider now 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 `*`

>


 (12) 

Although perhaps it is not evident on inspection, this product is illformed.

>



Analogously, products can be illformed regarding other types of problems.

>


 (13) 
>


>


 (14) 
>



When the products check okay, a message is displayed.

>


 (15) 
>


 (16) 
>



To avoid displaying the message, use the optional keyword quiet, as in Check(%, quiet).



