Physics/ToCovariant - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Physics/ToCovariant

Physics[ToCovariant] - rewrite in covariant form the indices of the tensors of a given expression

Physics[ToContravariant] - rewrite in covariant form the indices of the tensors of a given expression

Calling Sequence

ToCovariant(tensorial_expression, optional ...)

ToContravariant(tensorial_expression, optional ...)

Parameters

tensorial_expression

-

any tensorial expression, or a set, list, equation or matrix of them, onto which the operation is performed

Options

• 

changecharacteroffreeindices = ... : synonym changecharacteroffreeindices, the right-hand side can be true or false (default), to change or not (flip covariant <-> contravariant) the character of the free indices

• 

evaluateexpression = ... : can be true or false (default); to evaluate or not the expression after having manipulated its tensor indices

• 

evaluatetensor = ... : can be true or false (default); to evaluate or not the tensors after manipulating their indices

• 

onlytheseindices = ... : can be any symbol representing a tensor index, or a set or list of them possibly found in tensorial_expressions, to restrict the operation to only those indices

• 

changerepeatedindices = ... : can be true (default) or false, in which case the repeated indices are returned unchanged

• 

quiet = ... : the right-hand side can be true or false (default), to display or not information related to matching keywords

Description

• 

When working with tensors in spaces where the covariant and contravariant tensors' components have a different value (the underlying metric is not Euclidean) one frequently wants to express formulations with some or all of the tensors's indices expressed either in covariant or contravariant form. In previous Maple releases, also in Maple 2021, you can raise or lower free indices multiplying by the metric and performing the contraction. That, however, involves a whole simplification process not always desired, and does not result in flipping the character of repeated indices. The SubstituteTensorIndices is also useful for that purpose but requires changing the indices one by one. Instead, to handle the whole manipulation operation, you can use ToCovariant and ToContravariant.

• 

Several options are available to adjust the operation in different ways, as explained in the Options section above. Perhaps two more relevant ones are changecharacteroffreeindices (default value is false), that can be used to receive an expression where you get all free indices flipping their character, and onlytheseindices = ... to restrict the operation to only some of the indices.

• 

Note that closely related to ToCovariant and ToContravariant, the Physics package includes a SubstituteTensorIndices command.

Examples

withPhysics&colon;

Set coordinates and a tensor for experimentation; avoid redundant display of functionality using CompactDisplay

Setupcoordinates&equals;Cartesian&comma;tensors&equals;A&mu;

Systems of spacetime coordinates are:X=x&comma;y&comma;z&comma;t

_______________________________________________________

coordinatesystems=X&comma;tensors=Aμ&comma;γμ&comma;σμ&comma;μ&comma;gμ,ν&comma;εα,β,μ,ν&comma;Xμ

(1)

CompactDisplayAX

Ax&comma;y&comma;z&comma;twill now be displayed asA

(2)

Consider the following tensorial expression, define it as the components of a new tensor Fμ,ν

F&mu;&comma;&nu;&equals;d_&mu;A&nu;Xd_&nu;A&mu;X

F&mu;&comma;&nu;&equals;d_&mu;A&nu;X&comma;Xd_&nu;A&mu;X&comma;X

(3)

Define

Defined objects with tensor properties

Aμ&comma;γμ&comma;Fμ,ν&comma;σμ&comma;μ&comma;gμ,ν&comma;εα,β,μ,ν&comma;Xμ

(4)

The covariant components of Fμ,ν are

F&lsqb;&rsqb;

F&mu;&comma;&nu;&equals;0xA2x&comma;y&comma;z&comma;tyA1x&comma;y&comma;z&comma;txA3x&comma;y&comma;z&comma;tzA1x&comma;y&comma;z&comma;txA4x&comma;y&comma;z&comma;ttA1x&comma;y&comma;z&comma;tyA1x&comma;y&comma;z&comma;txA2x&comma;y&comma;z&comma;t0yA3x&comma;y&comma;z&comma;tzA2x&comma;y&comma;z&comma;tyA4x&comma;y&comma;z&comma;ttA2x&comma;y&comma;z&comma;tzA1x&comma;y&comma;z&comma;txA3x&comma;y&comma;z&comma;tzA2x&comma;y&comma;z&comma;tyA3x&comma;y&comma;z&comma;t0zA4x&comma;y&comma;z&comma;ttA3x&comma;y&comma;z&comma;ttA1x&comma;y&comma;z&comma;txA4x&comma;y&comma;z&comma;ttA2x&comma;y&comma;z&comma;tyA4x&comma;y&comma;z&comma;ttA3x&comma;y&comma;z&comma;tzA4x&comma;y&comma;z&comma;t0

(5)

Related to the character of indices, note first that, since Maple 2021, when you request the contravariant components of a tensor definition as Fμ,ν, the output is already expressed using the contravariant components of the tensors involved, in this case Aμ

F`~`

F~mu&comma;~nu&equals;0xA~2x&comma;y&comma;z&comma;t&plus;yA~1x&comma;y&comma;z&comma;txA~3x&comma;y&comma;z&comma;t&plus;zA~1x&comma;y&comma;z&comma;txA~4x&comma;y&comma;z&comma;ttA~1x&comma;y&comma;z&comma;tyA~1x&comma;y&comma;z&comma;t&plus;xA~2x&comma;y&comma;z&comma;t0yA~3x&comma;y&comma;z&comma;t&plus;zA~2x&comma;y&comma;z&comma;tyA~4x&comma;y&comma;z&comma;ttA~2x&comma;y&comma;z&comma;tzA~1x&comma;y&comma;z&comma;t&plus;xA~3x&comma;y&comma;z&comma;tzA~2x&comma;y&comma;z&comma;t&plus;yA~3x&comma;y&comma;z&comma;t0zA~4x&comma;y&comma;z&comma;ttA~3x&comma;y&comma;z&comma;ttA~1x&comma;y&comma;z&comma;t&plus;xA~4x&comma;y&comma;z&comma;ttA~2x&comma;y&comma;z&comma;t&plus;yA~4x&comma;y&comma;z&comma;ttA~3x&comma;y&comma;z&comma;t&plus;zA~4x&comma;y&comma;z&comma;t0

(6)

The definition of Fμ,ν involves only free and covariant indices; make all the tensors be expressed using covariant indices without changing the mathematical value of the expression

ToContravariant

g_&alpha;&comma;&mu;g_&beta;&comma;&nu;F~alpha&comma;~beta&equals;g_&alpha;&comma;&mu;g_&beta;&comma;&nu;d_~alphaA~betaX&comma;Xg_&alpha;&comma;&nu;g_&beta;&comma;&mu;d_~alphaA~betaX&comma;X

(7)

indets&comma;OrspecindexF&comma;specfuncA

F~alpha&comma;~beta&comma;A~betaX

(8)

Restrict that operation to only μ

ToContravariant&comma;only&equals;&mu;

* Partial match of 'only' against keyword 'onlytheseindices'

g_&alpha;&comma;&mu;F~alpha&comma;&nu;&equals;g_&alpha;&comma;&mu;d_~alphaA&nu;X&comma;Xg_&alpha;&comma;&mu;d_&nu;A~alphaX&comma;X

(9)

indets&comma;OrspecindexF&comma;specfuncA

F&nu;&comma;~alpha&comma;A&nu;X&comma;A~alphaX

(10)

In the above we see the tensors originally having μ covariant, now with the index in that position contravariant. To achieve the other possible meaning of to contravariant use the option changecharacteroffreeindices

ToContravariant&comma;only&equals;&mu;&comma;changecharacter

* Partial match of 'only' against keyword 'onlytheseindices'

* Partial match of 'changecharacter' against keyword 'changecharacteroffreeindices'

F~mu&comma;&nu;&equals;d_~muA&nu;X&comma;Xd_&nu;A~muX&comma;X

(11)

indets&comma;OrspecindexF&comma;specfuncA

F&nu;&comma;~mu&comma;A&nu;X&comma;A~muX

(12)

An expression that has free and repeated indices:

DefineA&comma;B&comma;G

Defined objects with tensor properties

B&comma;G&comma;Aμ&comma;γμ&comma;Fμ,ν&comma;σμ&comma;μ&comma;gμ,ν&comma;εα,β,μ,ν&comma;Xμ

(13)

A&alpha;B&beta;F&mu;&comma;&nu;G&nu;&comma;&alpha;&plus;A&beta;B&alpha;F&mu;&comma;&rho;G&rho;&comma;&alpha;

AβGρ,αFμρμρBαα+BβGν,αAααFμνμν

(14)

There are several tensors with covariant indices, and the free and repeated indices can be determined using Check

Check&comma;all

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

α&comma;ρ&comma;α&comma;ν,β&comma;μ

(15)

We see the free indices are μ and β, both covariant. To have all the tensors of this expression (but for the metric) with all their indices contravariant, use

ToContravariant

gβ,κBκκgν,σgα,τGσ,τσ,τAααgλ,μFλ,νλ,ν+gβ,νAννgλ,ρgα,σGλ,σλ,σgκ,μFκ,ρκ,ρBαα

(16)

indets&comma;specindexA&comma;B&comma;F&comma;G

Aαα&comma;Aνν&comma;Bαα&comma;Bκκ&comma;Fκ,ρκ,ρ&comma;Fλ,νλ,ν&comma;Gλ,σλ,σ&comma;Gσ,τσ,τ

(17)

This result is mathematically equal to the starting expression - all that happened is that the covariant versions of the indices were replaced by the contravariant ones at the cost of adding metric factors, so

Simplify

0

(18)

In addition to the onlytheseindices option, to perform these operations only on the free indices, you can also use changerepeatedindices = false

ToContravariant&comma;changerepeatedindices&equals;false

gβ,κBκκGν,αAααgλ,μFλ,νλ,ν+gβ,νAννGρ,αgκ,μFκ,ρκ,ρBαα

(19)

See Also

`.`, CompactDisplay, Coordinates, g_, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Setup, SubstituteTensor, SubstituteTensorIndices, TensorArray

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[ToCovariant] command was introduced in Maple 2021.

• 

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