Consider the general form of a transformation of coordinates tr, from to , and its inverse itr from to , expressed in terms of 8 arbitrary functions
For readability, suppress the display of functionality in these 8 functions
The covariant components of a vector transform according to
For the contravariant components of one can replace A[mu] by A[~mu] in the above. In that way, however, the new components will involve the inverse of the Jacobian of the transformation, resulting in a correct but rather large algebraic expression, due to the generality of the transformation tr. In such a case it is more convenient to use a transformation from the new to the old variables, as itr:
Verify that the transformation
transforms the line element of the Schwarzschild metric into one where the line element of spatial distance has conformal euclidean form, i.e.: it is proportional to the euclidean spatial line element in spherical coordinates, .
Set first the metric to be the Schwarzschild metric and the coordinates to be spherical. For that purpose you can use Setup, Coordinates or because Schwarzschild's metric is known to the system you can directly pass the keyword or an abbreviation of it to the metric g_ itself to do all in one step
Transform the coordinates in this metric using the transformation TR. Because the new variables were not set using Coordinates, indicate them as ; request the output to be the corresponding line element:
By inspection, the spatial part of this result is proportional to the euclidean spatial line element mentioned. Compare with the line element of the Schwarzschild metric,
Remark: this transformed metric (12) is not automatically set as the metric. It is for that reason that the line above shows the line element of the original metric, not the changed metric. To set the new metric use , or use the optional argument setmetric, in which case both the metric and the new coordinates will be set. For example, adding the keyword setmetric to the input that resulted in (12),
so that now you see as a label to the new coordinates and the line element as the new line element
Set the metric and coordinates again to be Schwarzschild and spherical
Transform the Schwarzschild metric to Kruskal coordinates. The new coordinates are
The transformation is
Note this is a transformation from new to old variables. The line element of the transformed metric is
By default, repeated indices in expression are returned explicitly summed. For example, consider this expression with free indices and
To perceive the difference with and without the option performsumoverrepeatedindices, perform an identity transformation on (24)
In the above, the sum over is performed. With performsumoverrepeatedindices = false the sum is not performed:
Note that the Matrix assigned in (25) can effectively be used to retrieve the value of (24) for given values of its free indices and . Similar functionality is available using TensorArray.
You can as well transform tensorial expressions that have no free indices; in that case only a change of variables in the scalar expression using PDEtools:-dchange is performed, although in the returned result the repeated indices will appear explicitly summed. To perform only the summation use SumOverRepeatedIndices.
Relative scalars, tensors and tensorial expressions
TransformCoordinates takes into account the relative weight of a tensor or tensorial expression at the time of computing its transformed components - see Chapter 4 of [2]. For example, Define two tensors of one index, one of them with relative weight = 1
Consider the transformation of coordinates TR, from spherical to , introduced lines above and compare how they transform
The transformed components of and are, respectively,
where, when comparing both results, we see that the transformed components for are all multiplied by with and is the determinant of the transformation: