Set coordinates and a tensor for experimentation; avoid redundant display of functionality using CompactDisplay
Consider the following tensorial expression, define it as the components of a new tensor
The covariant components of are
Related to the character of indices, note first that, since Maple 2021, when you request the contravariant components of a tensor definition as , the output is already expressed using the contravariant components of the tensors involved, in this case
The definition of involves only free and covariant indices; make all the tensors be expressed using covariant indices without changing the mathematical value of the expression
Restrict that operation to only
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
An expression that has free and repeated indices:
There are several tensors with covariant indices, and the free and repeated indices can be determined using Check
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
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
In addition to the onlytheseindices option, to perform these operations only on the free indices, you can also use changerepeatedindices = false