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 - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Physics : Physics/Check

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

withPhysics

`*`,`.`,Annihilation,AntiCommutator,Antisymmetrize,Assume,Bra,Bracket,Check,Christoffel,Coefficients,Commutator,Coordinates,Creation,D_,Dagger,Define,Dgamma,Einstein,Expand,ExteriorDerivative,Factor,FeynmanDiagrams,Fundiff,Geodesics,GrassmannParity,Gtaylor,Intc,Inverse,Ket,KillingVectors,KroneckerDelta,LeviCivita,Library,LieBracket,LieDerivative,Normal,Parameters,PerformOnAnticommutativeSystem,Projector,Psigma,Ricci,Riemann,Setup,Simplify,SpaceTimeVector,SubstituteTensor,SubstituteTensorIndices,SumOverRepeatedIndices,Symmetrize,TensorArray,Tetrads,ToFieldComponents,ToSuperfields,Trace,TransformCoordinates,Vectors,Weyl,`^`,dAlembertian,d_,diff,g_

(1)

Setupmathematicalnotation=true

mathematicalnotation=true

(2)
  

To check the free and repeated indices found in tensor expressions for correctness, first Define the tensor objects of your problem.

DefineA,B,C

Defined objects with tensor properties

A,B,C,γμ,σμ,μ,gμ,ν,δμ,ν,εα,β,μ,ν

(3)
  

Consider now an expression where the (spacetime) tensors A, B, and C appear in products and sums.

exprAμ,νBμ,ρ+Cν,ρ

exprBμ,ρAμνμν+Cν,ρ

(4)
  

By inspecting this expression, you can see that mu is a repeated index, so the sum rule over mu ranging from 1 to the dimension of the spacetime is assumed, and nu and rho 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).

Checkexpr

The repeated and free indices in the given expression check ok.

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

Checkexpr,all

The repeated indices per term are: ...,...,...; the free indices are: ...

μ,,ν,ρ

(6)

Checkexpr,free,quiet

ν,ρ

(7)

Checkexpr,repeated,quiet

μ,

(8)
  

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

Aμ,μBμ,ρ+Cν,ρ

Aμ,μBμ,ρ+Cν,ρ

(9)

Check

Error, (in Physics:-Check) wrong use of the summation rule for repeated indices: `mu repeated 3 times`, in A[mu, mu]*B[mu, rho]

Aμ,νBμ,ρ+Cμ,ρ

Aμ,νBμ,ρ+Cμ,ρ

(10)

Check

Error, (in Physics:-Check) found different free indices in different operands of a sum; in operand 1: [nu, rho], in operand 2: [mu, rho]

  

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)

CheckAμ,νBμ,ρ=Cμ,ρ,all

Error, (in Physics:-Check) free indices in both sides of the equation are different: found {nu, rho} on the left-hand side and {mu, rho} on the right-hand side

CheckAμ,νBμ,ρ=Cν,ρ,all

The repeated indices per term are: ...,...,...; the free indices are: ...

μ,ν,ρ=,ν,ρ

(11)
  

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

CheckAμ,νBμ,ρ+Cν,ρ=0,all

The repeated indices per term are: ...,...,...; the free indices are: ...

μ,,ν,ρ

(12)

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:

unwithPhysics,`*`

macro`&*`=Physics:-`*`:

  

Now set prefixes for identifying anticommutative and noncommutative variables.

Setupanticommutativeprefix=Q,noncommutativeprefix=Z

anticommutativeprefix=Q,_λ,noncommutativeprefix=Z

(13)
  

So in what follows, variables prefixed by Q or Z, 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 `*`

PQ1 &* Q1+Q3 &* Q4 &* 1+Q5Q7 &* Q6

PQ1Q1+Q3Q5Q7+Q4Q6

(14)
  

Although perhaps it is not evident on inspection, this product is ill-formed.

CheckP

Error, (in Physics:-Check) found more than 1 anticommutative object in the commutative product: Q5*Q7

  

Analogously, products can be ill-formed regarding other types of problems.

Q1 &* Q1+Q3 &* Q4 &* 1+Z5Z7 &* Q6

Q1Q1+Q3Z5Z7+Q4Q6

(15)

Check

Error, (in Physics:-Check) found more than 1 noncommutative object in the commutative product: Z5*Z7

Q1 &* Q1+Q3 &* Q4 &* 1+Q5Z7 &* Q6

Q1Q1+Q3Q5Z7+Q4Q6

(16)

Check

Error, (in Physics:-Check) found anticommutative and noncommutative objects in the commutative product Q5*Z7

  

When the products Check okay, a message is displayed.

Q1 &* Q1+Q3 &* Q4 &* 1+A5Q7 &* Q6

Q1Q1+Q3A5Q7+Q4Q6

(17)

Check

The products in the given expression check ok.

(18)

  

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

See Also

Define, Physics, Physics conventions, Physics examples, Physics[`*`], Setup


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam