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
|
|
>
|
|
| (1) |
Define a couple of arbitrary spacetime tensors for exploration purposes
| |
| (2) |
Enter, for example, this tensorial expression, with a contravariant free index
>
|
|
| (3) |
To check the repeated and free indices in an expression use Check
| |
| (4) |
So (3) has and the contravariant as free indices. Substitute now : the standard subs command will only substitute the covariant
| (5) |
Consequently, the resulting expression is not equivalent to (3): it now has four free indices
| |
| (6) |
To substitute both covariant and contravariant repeated indices obtaining an expression equivalent to original one use
>
|
|
| (7) |
| |
| (8) |
Substitute now the contravariant by ; the standard subs command will fail because contravariant indices are prefixed by ~, so this returns (3) as given
| (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
>
|
|
| (10) |
| |
| (11) |
To substitute several indices at once, enclose the substitution equations in a set or a list
>
|
|
| (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
>
|
|
To avoid this re-evaluation of tensors in the result use evaluatetensor = false
>
|
|
|
|
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.
|
|
|