Physics[SubstituteTensorIndices] - perform substitution of covariant/contravariant tensor indices in tensorial expressions
Calling Sequence
SubstituteTensorIndices(mu = .., ... expression)
Parameters
expression
-
any algebraic tensorial expression typically having some free and some repeated indices
mu = ...
the substitution equation, or a set {...} or list [...] of them
evaluatetensor = ...
optional - can be true (default) or false, to indicate whether to evaluate the tensors after substituting on them
evaluateexpression = ...
optional - can be true or false (default), to indicate whether to evaluate expression after substituting the indices in its tensors
covariantandcontravariant = ...
optional - can be true (default) or false, to indicate whether to substitute both covariant and contravariant indices when only one of them is given on the left-hand sides of the substitution equations
Description
The SubstituteTensorIndices substitutes indices in tensors - the ones displayed when you enter Define(); see Define to define one. Nowhere else are the indices substituted, and the substitution can be performed on a covariant index, the corresponding contravariant one, or on both.
The first argument is a substitution equation with an index on the left-hand side, or a set or list of them. All the substitution equations are expected in this first argument. The second argument is the target, where the substitutions are to be performed.
The tensors where indices are substituted are re-evaluated after substitution; this re-evaluation can optionally be suppressed giving the argument evaluatetensor = false. The expression where these re-evaluated tensors are introduce is by default not re-evaluated; you can change that passing the optional argument evaluateexpression = true.
By default both covariant and contravariant indices are substituted, even if the substitution equation has only one of them on the left-hand side; this behavior is convenient both when substituting contracted or free indices. To substitute only the kind of index found on the left-hand side of the substitution equation use covariantandcontravariant = false.
To check and determine the free and repeated indices of an expression use Check.
When substituting indices by numerical values, contravariant values are prefixed with ~, say as in ~1; otherwise, say as in 1, the value is interpreted as covariant. Hence, the equation ~nu = 1 will also transform ~nu into covariant. Substituting the natural way, say as in nu = 1, will automatically substitute both nu = 1 and also ~nu = ~1 keeping the covariant/contravariant character unchanged.
When the right-hand side of a substitution equation is a contravariant index, so suffixed with ~, say as in ~nu = ~1, note the separation between = and ~; that separation is important because ~ is also the element-wise operator and so =~ has other specific meaning.
Examples
with⁡Physics:
Setup⁡mathematicalnotation=true
mathematicalnotation=true
Define a couple of arbitrary spacetime tensors for exploration purposes
Define⁡A,B
Defined objects with tensor properties
A,B,γμ,σμ,∂μ,gμ,ν,εα,β,μ,ν
Enter, for example, this tensorial expression, with a contravariant free index ρ
g_α,μ⁢A~mu⁢g_~alpha,~nu⁢Bν,σ,~rho
gα,μ⁢A⁢μ⁢μ⁢g⁢α,ν⁢α,ν⁢Bν,σρν,σρ
To check the repeated and free indices in an expression use Check
Check⁡,all
The repeated indices per term are: ...,...,..., the free indices are: ...
α,μ,ν,σ,~ρ
So (3) has α and the contravariant ρ as free indices. Substitute now α=β: the standard subs command will only substitute the covariant α
subs⁡α=β,
gβ,μ⁢A⁢μ⁢μ⁢g⁢α,ν⁢α,ν⁢Bν,σρν,σρ
Consequently, the resulting expression is not equivalent to (3): it now has four free indices
μ,ν,β,σ,~α,~ρ
To substitute both covariant and contravariant repeated indices obtaining an expression equivalent to original one use
SubstituteTensorIndices⁡α=β,
gβ,μ⁢A⁢μ⁢μ⁢g⁢β,ν⁢β,ν⁢Bν,σρν,σρ
β,μ,ν,σ,~ρ
Substitute now the contravariant ρ by τ; the standard subs command will fail because contravariant indices are prefixed by ~, so this returns (3) as given
subs⁡ρ=β,
To make it work with subs you would need to substitute ~rho = ~beta instead. Using SubstituteTensorIndices you get the desired result regardless of this subtlety
SubstituteTensorIndices⁡ρ=β,
gα,μ⁢A⁢μ⁢μ⁢g⁢α,ν⁢α,ν⁢Bν,σβν,σβ
α,μ,ν,σ,~β
To substitute several indices at once, enclose the substitution equations in a set or a list
SubstituteTensorIndices⁡ρ=β,α=γ,
gγ,μ⁢A⁢μ⁢μ⁢g⁢γ,ν⁢γ,ν⁢Bν,σβν,σβ
After substituting, tensors are re-evaluated; in this example, ν becomes 1 and the normalized form of g_ is presented with it in the first place, so switching places with μ
g_μ,ν
gμ,ν
SubstituteTensorIndices⁡ν=1,
g1,μ
To avoid this re-evaluation of tensors in the result use evaluatetensor = false
SubstituteTensorIndices⁡ν=1,,evaluatetensor=false
gμ,1
See Also
Check, Define, element-wise operator, g_, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, SubstituteTensor
References
Landau, L.D., and Lifshitz, E.M. The Classical Theory of Fields, Course of Theoretical Physics Volume 2, fourth revised English edition. Elsevier, 1975.
Compatibility
The Physics[SubstituteTensorIndices] command was introduced in Maple 16.
For more information on Maple 16 changes, see Updates in Maple 16.
Download Help Document