substitute tensor, sums or products of them, in tensorial expression, matching free indices and automatically taking care of possible collisions between repeated indices - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Physics : Physics/SubstituteTensor

Physics[SubstituteTensor] - substitute tensor, sums or products of them, in tensorial expression, matching free indices and automatically taking care of possible collisions between repeated indices

Calling Sequence

SubstituteTensor(EQ, ..., ee, evaluateexpression, repeatedindicescovariant)

Parameters

EQ

-

a substitution equation, a list or set of them, or a sequence of any of these, typically involving tensors, or sums or products of them, on the left-hand sides, and corresponding tensorial expressions (same free indices) on the right-hand sides

ee

-

the target where the substitutions EQ, ... are to be performed, it is the last argument after the substitution equations; ee can be any Maple object (expression, list, etc.) typically involving tensors or tensorial expressions with free and/or repeated tensor indices, and where subs and eval are able to perform substitutions

evaluateexpression

-

optional, when given, the substitutions in ee are performed using eval instead of subs

repeatedindicescovariant

-

optional, default value is true when the spacetime is Euclidean and false otherwise. When true, all repeated (contracted) indices in the result are returned covariant instead of one covariant and the other contravariant.

Description

  

SubstituteTensor substitutes the equation(s) EQ into ee, taking care of free and repeated indices such that: 1) equations in EQ are interpreted as mappings having the free indices as parameters, so for example substituting A[j] = G[j] into A[k] results in G[k]; 2) repeated indices in EQ do not clash with repeated indices in ee, so for example substituting A[j] = G[j]*F[k,k] into A[i]*G[k]*G[k] or into A[k]*A[k] respectively results in G[i]*F[m,m]*G[k]*G[k], and G[k]*F[j,j] * G[k]*F[m,m]. SubstituteTensor can also substitute sub-expressions of type product or sum, similar to what algsubs does, so for example substituting A[j] * B[k] = F[j, k] into A[i] * B[i] * F[j, k] and into A[i] * B[j] * A[k] * B[m] respectively results in F[i, i] * F[j, k] and F[i, j] * F[k, m]. Note: when the left-hand-side of a substitution equation is a tensor function (of type Library:-PhysicsType:-Tensor and also of type function), say T[j,k](X), then not just the indices j,k but also the functionality X is considered a parameter, so for example substituting T[j, k](X) = F[j, k](X) into T[i, i](Y) results in F[i, i](Y). The functionality is not considered a parameter when the left-hand-side is an algebraic expression.

Examples

withPhysics:

Setupmathematicalnotation=true

mathematicalnotation=true

(1)

DefineA,B,C,F,G:

Defined objects with tensor properties

(2)

EQAμ=Gν,αAαFμ,ν

EQAμ=Gν,αAααFμνμν

(3)

The repeated and free indices of the lhs and rhs of this substitution equation eq

CheckEQ,all

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

,μ=α,ν,μ

(4)

The easy case

SubstituteTensorEQ,Aμ

Gν,αAααFμνμν

(5)

Now the free index in the target expression is now not mu but nu

SubstituteTensorEQ,Aν

Gβ,αAααFνβνβ

(6)

Distinction between covariant and contravariant indices

SubstituteTensorEQ,A`~nu`

Gβ,αAααFν,βν,β

(7)

The index nu found repeated in the rhs of the substitution equation eq also appears repeated in the following target expression

eeAνAν

eeAνAνν

(8)

resSubstituteTensorEQ,ee

resGβ,αAααFνβνβGλ,κAκκFν,λν,λ

(9)

The repeated and free indices of this result

Checkres,all

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

α,β,κ,λ,ν,

(10)

Functionality is also taken as parameters (only when the lhs is a Tensor function)

SubstituteTensorAμX=BμX,AνY

BνY

(11)

Substituting in sub-expressions like algsubs

EQ2AμXBνY=Gμ,νX

EQ2AμXBνY=Gμ,νX

(12)

ee2AαXBβYAρXBρY

ee2AαXBβYAρXBρρY

(13)

When substituting EQ2 into ee2, the sub-expression A . B appears twice, and not in the indets (indeterminates) of ee2:

indetsee2

X,Y,AαX,AρX,BβY,BρρY

(14)

SubstituteTensorEQ2,ee2

Gα,βXGρρρρX

(15)

See Also

algsubs, Check, eval, indets, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, subs, SubstituteTensorIndices

Compatibility

• 

The Physics[SubstituteTensor] command was introduced in Maple 2015.

• 

For more information on Maple 2015 changes, see Updates in Maple 2015.