Set up a coordinate system to work with - the first one to be set is automatically taken as the differentiation variables for d_, the covariant derivative D_ and the dAlembertian
When Physics is initialized, the default spacetime metric is of Minkowski type. You can see the metric querying Setup, as in Setup(metric);, or directly entering the metric as g_[], with no indices
Check the nonzero components of Christoffel, used to construct the Riemann tensor entering the definition of Riemann: because the default spacetime is of Minkowski type, there are none
Hence
and the same is valid for all the general relativity tensors defined in terms of Christoffel and derivatives of the metric g_. To set the scenario as a curved spacetime set the metric using Setup, for instance indicating the square of the spacetime interval. In this example, we also choose to work in spherical coordinates, so consider for instance the metric defined by
Now when the indices are not numerical, Riemann returns itself after normalizing its indices taking advantage of their symmetry properties, so that different forms of the same tensor enter computations in the same manner, for example, if you interchange the positions as in
To express Riemann in terms of the Christoffel symbols and its derivatives convert to Christoffel
Check the value of , say for , = 2, = 2, = 4
Check now the value of , with the 1st index contravariant, for the same values of the indices (note you enter the value of the contravariant index prefixed by ~)
To compute with a representation for Riemann without actually performing the operation, use the inert form %Riemann. To afterwards perform the operation use value
To have a more compact display in the following examples, suppress the display of the dependency of and have the display of derivatives in jet notation, indexed (see Typesetting)
The nonzero values of and of (note you enter the character of the contravariant indices prefixed by ~)
The Riemann scalars (see the Description)
The 16 Riemann invariants presented in the paper by Carminati and McLenaghan (see the Description and the reference at the bottom)
Compute now the Array form of
As with all the general relativity tensors of the Physics package, you can obtain the same result for the all covariant case by entering the tensor without indices, as in Riemann[].
This is the array form of (note you enter the character of the contravariant indices prefixed by ~)
To use this array, because its components were computed already taking into account the (covariant/contravariant) character of its indices, you do not need to indicate furthermore that character. So for we have
>
|
|
Compare with the output obtained entering Riemann[~1, 2, 2, 4] in eq (15)
The Ricci tensor is defined in terms of the Riemann tensor as You can see how the four Riemann matrices add to form the Ricci matrix; for this purpose give values to the 1st and 3rd indices and pass the extra keyword matrix (or array)
Compare with the Ricci matrix
Upon simplification these matrices are the same