Close
Close window
SubstituteTensorIndices - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


Home : Support : Online Help : Physics : SubstituteTensorIndices
[フレーム] [フレーム]

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

>

withPhysics:

>

Setupmathematicalnotation=true

mathematicalnotation=true

(1)

Define a couple of arbitrary spacetime tensors for exploration purposes

>

DefineA,B

Defined objects with tensor properties

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

(2)

Enter, for example, this tensorial expression, with a contravariant free index ρ

>

g_α,μA~mug_~alpha,~nuBν,σ,~rho

gα,μAμμgα,να,νBν,σρν,σρ

(3)

To check the repeated and free indices in an expression use Check

>

Check,all

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

α,μ,ν,σ,~ρ

(4)

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ν,σρν,σρ

(5)

Consequently, the resulting expression is not equivalent to (3): it now has four free indices

>

Check,all

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

μ,ν,β,σ,~α,~ρ

(6)

To substitute both covariant and contravariant repeated indices obtaining an expression equivalent to original one use

>

SubstituteTensorIndicesα=β,

gβ,μAμμgβ,νβ,νBν,σρν,σρ

(7)
>

Check,all

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

β,μ,ν,σ,~ρ

(8)

Substitute now the contravariant ρ by τ; the standard subs command will fail because contravariant indices are prefixed by ~, so this returns (3) as given

>

subsρ=β,

gα,μAμμgα,να,νBν,σρν,σρ

(9)

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ν,σβν,σβ

(10)
>

Check,all

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

α,μ,ν,σ,~β

(11)

To substitute several indices at once, enclose the substitution equations in a set or a list

>

SubstituteTensorIndicesρ=β,α=γ,

gγ,μAμμgγ,νγ,νBν,σβν,σβ

(12)

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μ,ν

(13)
>

SubstituteTensorIndicesν=1,

g1,μ

(14)

To avoid this re-evaluation of tensors in the result use evaluatetensor = false

>

SubstituteTensorIndicesν=1,,evaluatetensor=false

gμ,1

(15)

See Also

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

AltStyle によって変換されたページ (->オリジナル) /