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
The corresponding line element
The default spacetime of the Physics package is a Minkowski spacetime with dimension 4, so the values 0 and 4 represent the same object
The symmetry property of g_ is automatically taken into account when the indices have symbolic values
By default, spacetime indices are represented by greek letters and the dimension of spacetime is 4 - you can query about that via
Set the space indices (not the spacetime indices) to be represented by lowercaselatin letters till h
The trace of g_ is equal to the dimension; note the use of the sum rule for repeated indices, both for spacetime and space only indices
Check now the nonzero components of Christoffel, used to construct the g_ tensor entering the definition of g_: 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. This can be done directly from g_, choose for example the keyword Tolman; it automatically implies on setting spherical coordinates as the differentiation variables for d_
The corresponding line element
So now
Or for the contravariant components (note you indicate the contravariant character of index prefixing with ~)
The matrix form: all of g_[], g_[matrix] and g_[mu, nu, matrix] return the all-covariant matrix
Or, for the matrix components of the all contravariant , which as a matrix is equal to the inverse of the all-covariant ,
The metric can also be set using Setup in different ways. Here we enter it by passing the square of the spacetime interval, also called the line element. Because the spacetime coordinates were automatically set to spherical when entering g_[Tolman] you do not need to set the coordinates again. To query about the coordinates use Setup or Coordinates:
Set now the metric to be
(Note that this equation in the output by Setup can be directly used as input for Setup; this is useful to perform minor changes to the metric when desired.)
The determinant of the all-covariant metric
The nonzero components
The nonzero components of the inverse of the metric, that is, the all-contravariant
The general relativity tensors, or expressions involving them, can be expressed in terms of the metric g_ and its derivatives. For that purpose use convert(... g_) as in
Define a tensor for illustration purposes
The covariant derivative of the contravariant vector and its expansion, or rewriting in terms of d_,g_ or Christoffel symbols
Alternatively, spacetime derivatives of the metric can be expressed in terms of Christoffel symbols
In the same line, all of Einstein, Ricci, Riemann and Weyl tensors can be expressed in terms of Christoffel symbols, and so in terms of the metric g_ and its derivatives, for instance,
To compute with a representation for g_ without actually performing the operation, use the inert form %g_. To afterwards perform the operation use value
It is possible to set the metric searching the database of DifferentialGeometry directly from g_. For example
You can now refine the search accordingly, for example choose and automatically set the metric [12, 38, 1] including the corresponding coordinates
Note the redefinition of the signature: basically all metrics in the database follow the conventions found in the book Exact Solutions of Einstein's Field Equations (reference at the end), where the signature is (+ + + -).
The simplification of contracted indices is normally performed using Simplify but you can also perform it using the `.` operator. Define first some spacetime tensors.
Compare the difference between `*` and `.`
So g_[alpha, mu] . A[mu] equivalent to Simplify(g_[alpha, mu] * A[mu], indices). This functionality is particularly useful when handling larger expressions where you want contraction to be simplified only in some places. Consider the following product
You can always Simplify the whole product, as in
Using Physics[`.`], however, you can achieve either the same, or any more selective simplification. Replacing the first `*` by `.`,
Likely (note the parenthesis to indicate the desired order of precedence between `.` and `*`)
and replacing `*` and `.` in the middle of the expression,
When one of the sides of `.` is a nested expression, the simplification of contracted indices is performed recursively, compare for instance
Set the spacetime metric to be the Schwarzschild metric and consider the contraction of all the indices of the Riemann tensor
Note: since Maple 2019, KroneckerDelta[mu, nu] is not considered a tensor (of type Physics:-Library:-PhysicsType:-Tensor), even if and are letters representing tensor indices. Consequently, in all cases, the following does not return the trace, but the number 1
Care should be taken, however, if you happen to index KroneckerDelta with one index covariant and the other contravariant (preceded by ~), in which case KroneckerDelta[mu, ~nu] is automatically transformed into the spacetime metric g_[mu, ~nu] (both displayed with the greek letter as is standard in physics textbooks), for which g[mu, ~mu], with the index repeated, represents its trace, equal to the spacetime dimension
Physics:-g_[mu,~nu] = Physics:-g_[mu,~nu]
| |