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

Physics[g_] - The g_ tensor

 Calling Sequence g_[$\mathrm{\mu },\mathrm{\nu }$] g_[$\mathrm{\mu },\mathrm{\nu }$, matrix] g_[keyword] convert(expression, g_)

Parameters

 $\mathrm{\mu }$, $\mathrm{\nu }$ - the indices, as names representing integer numbers between 0 and the spacetime dimension, they can also be the numbers themselves matrix - optional, returns the matrix form for the given (covariant or contravariant) indices; if passed without indices it returns the covariant metric keyword - optional, it can be definition, determinant, line_element, matrix, nonzero, trace or any portion of a known metric name to launch a search in the metric's database expression - an algebraic expression involving tensors (e.g. Christoffel) to be rewritten in terms of the metric g_ and its derivatives

Description

 • The g_[mu, nu], displayed as ${g}_{\mathrm{\mu },\mathrm{\nu }}$ (without _ in between $g$ and its indices), is a computational representation for the spacetime metric tensor. When Physics is loaded, the dimension of spacetime is set to 4 and the metric is automatically set to be galilean, representing a Minkowski spacetime with signature (-, -, -, +), so time in the fourth place.
 • When working in curvilinear coordinates so that the components of the Christoffel symbols are not zero it is sometimes convenient to rewrite tensorial expressions in terms of the metric g_ and its derivatives. For example, this is the case of the Christoffel symbols and any of the general relativity tensors that are defined in terms of them. For this purpose you can use convert(expression, g_) - see the Examples section.
 • When the indices of g_ assume integer values, it is expected they are between 0 and the spacetime dimension and the corresponding value of g_ is returned. The values 0 and 4, or for the case any dimension set for the spacetime, represent the same object. When the indices have symbolic values, say as in $\mathrm{\mu },\mathrm{\nu }$, if $\mathrm{\mu }=\mathrm{\nu }$ g_ returns the dimension of spacetime when $\mathrm{\mu }$ is a spacetime index, or the dimension of space when $\mathrm{\mu }$ is a space index. If the system can prove that $\mathrm{\mu }\ne \mathrm{\nu }$ (e.g. via assumptions), g_ returns zero whenever the metric is diagonal. Otherwise g_ returns unevaluated, after normalizing its indices taking into account that the spacetime metric is symmetric.
 • You can change the value of the metric g_ in different ways, using Setup or, when choosing a predefined set of values, you can also change the metric using g_ itself, indexing it with the related metric name; for example as in g_[Minkowski]. The predefined sets are: arbitrary, Euclidean, Minkowski, Schwarzschild, Tolman or related to any of the metrics of the book "Exact Solutions of Einstein's Field Equations" - see references at the end. Note that you can pass the keyword incomplete or misspelled, in which case a searchtext is performed among the keywords understood by g_ and if a match is found the metric is set accordingly, or if many matches are found then corresponding information is displayed on the screen. See the Examples section. Using predefined sets, either through Setup or g_, automatically sets the necessary systems of coordinates and differentiation variables for the spacetime differentiation operator d_ accordingly.
 • Any of the 991 metrics of the book "Exact Solutions of Einstein's Field Equations" can also be load by indexing g_ with a list of three numbers, for example as in g_[[12, 16, 1]], respectively representing the book's chapter where the metric is found, the equation number and the case.
 • Computations performed with the Physics package commands take into account Einstein's sum rule for repeated indices - see . and Simplify. The distinction between covariant and contravariant indices in the input of tensors is done by prefixing contravariant ones with ~, say as in ~mu; in the output, contravariant indices are displayed as superscripts. For contracted indices, you can enter them one covariant and one contravariant. Note however that - provided that the spacetime metric is galilean (Euclidean or Minkowski), or the object is a tensor also in curvilinear coordinates - this distinction in the input is not relevant, and so contracted indices can be entered as both covariant or both contravariant, in which case they will be automatically rewritten as one covariant and one contravariant. Tensors can have spacetime and space indices at the same time. To change the type of letter used to represent spacetime or space indices see Setup.
 • Note: since Maple 2019, g_[mu, ~nu], where one of its indices is contravariant as in ~nu while the other remains covariant, is displayed using the $\mathrm{\delta }$ greek letter, as ${\mathrm{\delta }}_{\mathrm{\mu }}^{\mathrm{\nu }}$, as is standard in physics textbooks. Also, KroneckerDelta[mu, nu] is not considered a tensor (of type Physics:-Library:-PhysicsType:-Tensor), even if $\mathrm{\mu }$ and $\mathrm{\nu }$ are letters representing tensor indices, unless one of such indices is contravariant as in ~nu, while the other remains covariant, in which case KroneckerDelta[mu, ~nu] is automatically transformed into the spacetime metric g_[mu, nu], which is a tensor.
 • During a Maple session, the value of any component of the general relativity tensors of Physics, that is: Christoffel, the covariant derivative D_, Einstein, Ricci, Riemann and Weyl, automatically follow the value or any changes introduced in the components of g_, the spacetime metric, provided these changes are made using Setup or g_ itself.
 • Besides being indexed with two indices, g_ accepts the following keywords as an index:
 – definition: when passed alone, g_ returns its definition, that is an equation with the metric on the left-hand side and the matrix form of the metric on the right-hand side, the same as when you enter the metric without indices (g_[]).
 – determinant: when passed alone, g_ returns the determinant of the all-covariant metric g[mu, nu] . If this keyword is passed together with indices, that can be covariant or contravariant, the resulting determinant takes into account the character of the indices.
 – line_element: (synonym: lineelement) when passed alone, g_ returns the line element for the current metric expressing the differentials of the coordinates using d_.
 – matrix: (synonym: Matrix, array, Array, or no indices whatsoever, as in g_[]) returns a Matrix that when indexed with numerical values from 1 to the dimension of spacetime it returns the value of each of the components of g_. If this keyword is passed together with indices, that can be covariant or contravariant, the resulting Matrix takes into account the character of the indices.
 – nonzero: returns a set of equations, with the left-hand side as a sequence of two positive numbers identifying the element of $\mathrm{g__μ,ν}$ and the corresponding value on the right-hand side. Note that this set is actually the output of the ArrayElems command when passing to it the Matrix obtained with the keyword matrix.
 – : some predefined sets of values for the spacetime metric can be used by giving the metric name or a portion of it; currently these are Euclidean, Minkowski, Tolman, Schwarzschild and the metrics of Chapter 12 of "Exact Solutions of Einstein's Field Equations" (second edition).
 • Some automatic checking and normalization are carried out each time you enter g_[...]. The checking is concerned with possible unexpected values of the indices. The automatic normalization takes into account the symmetry of g_[mu,nu] with respect to interchanging the positions of the indices mu and nu.
 • The %g_ command is the inert form of g_, so it represents the same tensor but entering it does not result in performing any computation. To perform the related computations as if %g_ were g_, use value.

Examples

 > $\mathrm{with}\left(\mathrm{Physics}\right):$
 > $\mathrm{Setup}\left(\mathrm{mathematicalnotation}=\mathrm{true}\right)$
 $\left[{\mathrm{mathematicalnotation}}{=}{\mathrm{true}}\right]$ (1)

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

 > $\mathrm{g_}\left[\right]$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left[\right]$ (2)

The corresponding line element

 > $\mathrm{g_}\left[\mathrm{line_element}\right]$
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right)\right\}$
 ${-}{{\mathbf{ⅆ}}{}\left({\mathrm{x1}}\right)}^{{2}}{-}{{\mathbf{ⅆ}}{}\left({\mathrm{x2}}\right)}^{{2}}{-}{{\mathbf{ⅆ}}{}\left({\mathrm{x3}}\right)}^{{2}}{+}{{\mathbf{ⅆ}}{}\left({\mathrm{x4}}\right)}^{{2}}$ (3)

The default spacetime of the Physics package is a Minkowski spacetime with dimension 4, so the values 0 and 4 represent the same object

 > $\mathrm{g_}\left[0,0\right]=\mathrm{g_}\left[4,4\right]$
 ${1}{=}{1}$ (4)
 > $\mathrm{g_}\left[0,3\right]$
 ${0}$ (5)

The symmetry property of g_ is automatically taken into account when the indices have symbolic values

 > $\mathrm{g_}\left[\mathrm{\mu },\mathrm{\nu }\right]-\mathrm{g_}\left[\mathrm{\nu },\mathrm{\mu }\right]$
 ${0}$ (6)

By default, spacetime indices are represented by greek letters and the dimension of spacetime is 4 - you can query about that via

 > $\mathrm{Setup}\left(\mathrm{spacetimeindices},\mathrm{dimension}\right)$
 $\left[{\mathrm{dimension}}{=}{4}{,}{\mathrm{spacetimeindices}}{=}{\mathrm{greek}}\right]$ (7)

Set the space indices (not the spacetime indices) to be represented by lowercaselatin letters till h

 > $\mathrm{Setup}\left(\mathrm{spaceindices}=\mathrm{lowercaselatin_ah}\right)$
 $\left[{\mathrm{spaceindices}}{=}{\mathrm{lowercaselatin_ah}}\right]$ (8)

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

 > $\mathrm{g_}\left[\mathrm{\mu },\mathrm{\nu }\right]$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (9)
 > $\mathrm{eval}\left(,\mathrm{\mu }=\mathrm{\nu }\right)$
 ${4}$ (10)
 > $\mathrm{g_}\left[a,b\right]$
 ${{g}}_{{a}{,}{b}}$ (11)
 > $\mathrm{eval}\left(,a=b\right)$
 ${3}$ (12)

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

 > $\mathrm{Christoffel}\left[\mathrm{nonzero}\right]$
 ${{\mathrm{\Gamma }}}_{{\mathrm{\alpha }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}{\varnothing }$ (13)

Hence

 > $\mathrm{Christoffel}\left[\mathrm{\mu },\mathrm{\alpha },\mathrm{\beta }\right]$
 ${0}$ (14)

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_

 > $\mathrm{g_}\left[\mathrm{Tolman}\right]$
 ${}\mathrm{_______________________________________________________}$
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 ${}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 ${}\mathrm{The Tolman metric in coordinates}{}\left[r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right]$
 $\mathrm{Parameters:}\left[R{}\left(t{,}r\right){,}E{}\left(r\right)\right]$
 $\mathrm{Signature:}\left(\mathrm{- - - +}\right)$
 ${}\mathrm{_______________________________________________________}$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left[\right]$ (15)

The corresponding line element

 > $\mathrm{g_}\left[\mathrm{line_element}\right]$
 $\frac{{-}{\left(\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{R}{}\left({t}{,}{r}\right)\right)}^{{2}}{}{{\mathbf{ⅆ}}{}\left({r}\right)}^{{2}}{-}\left({1}{+}{2}{}{E}{}\left({r}\right)\right){}{{R}{}\left({t}{,}{r}\right)}^{{2}}{}\left({{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}{}{{\mathbf{ⅆ}}{}\left({\mathrm{\phi }}\right)}^{{2}}{+}{{\mathbf{ⅆ}}{}\left({\mathrm{\theta }}\right)}^{{2}}\right)}{{1}{+}{2}{}{E}{}\left({r}\right)}{+}{{\mathbf{ⅆ}}{}\left({t}\right)}^{{2}}$ (16)

So now

 > $\mathrm{g_}\left[\mathrm{\mu },\mathrm{\nu }\right]$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (17)
 > $\mathrm{g_}\left[1,1\right]$
 ${-}\frac{{\left(\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{R}{}\left({t}{,}{r}\right)\right)}^{{2}}}{{1}{+}{2}{}{E}{}\left({r}\right)}$ (18)

Or for the contravariant components (note you indicate the contravariant character of index prefixing with ~)

 > $\mathrm{g_}\left[\mathrm{~1},\mathrm{~1}\right]$
 ${-}\frac{{1}{+}{2}{}{E}{}\left({r}\right)}{{\left(\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{R}{}\left({t}{,}{r}\right)\right)}^{{2}}}$ (19)

The matrix form: all of g_[], g_[matrix] and g_[mu, nu, matrix] return the all-covariant matrix

 > $\mathrm{g_}\left[\mathrm{\mu },\mathrm{\nu },\mathrm{matrix}\right]$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left[\right]$ (20)

Or, for the matrix components of the all contravariant ${g}_{}^{\mathrm{\mu },\mathrm{\nu }}$, which as a matrix is equal to the inverse of the all-covariant ${g}_{\mathrm{\mu },\mathrm{\nu }}$,

 > $\mathrm{g_}\left[\mathrm{~mu},\mathrm{~nu},\mathrm{matrix}\right]$
 ${{g}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left[\right]$ (21)

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:

 > $\mathrm{Setup}\left(\mathrm{coordinates},\mathrm{differentiation}\right)$
 $\mathrm{* Partial match of \text{'}}\mathrm{differentiation}\mathrm{\text{'} against keyword \text{'}}\mathrm{differentiationvariables}\text{'}$
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 ${}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{coordinatesystems}}{=}\left\{{X}\right\}{,}{\mathrm{differentiationvariables}}{=}\left[{X}\right]\right]$ (22)
 > $\mathrm{Coordinates}\left(\right)$
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 $\left\{{X}\right\}$ (23)

Set now the metric to be

 > $\mathrm{ds2}≔{r}^{2}{\mathrm{dtheta}}^{2}+{r}^{2}{\mathrm{sin}\left(\mathrm{\theta }\right)}^{2}{\mathrm{dphi}}^{2}-2\mathrm{dt}\mathrm{dr}-2{k\left(r,t\right)}^{2}{\mathrm{dt}}^{2}$
 ${\mathrm{ds2}}{≔}{{r}}^{{2}}{}{{\mathrm{dθ}}}^{{2}}{+}{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}{}{{\mathrm{dφ}}}^{{2}}{-}{2}{}{\mathrm{dt}}{}{\mathrm{dr}}{-}{2}{}{{k}{}\left({r}{,}{t}\right)}^{{2}}{}{{\mathrm{dt}}}^{{2}}$ (24)
 > $\mathrm{Setup}\left(\mathrm{metric}=\mathrm{ds2}\right)$
 ${}\mathrm{_______________________________________________________}$
 $\mathrm{Coordinates:}\left[r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right]\mathrm{. Signature:}\left(\mathrm{- - - +}\right)$
 ${}\mathrm{_______________________________________________________}$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left[\right]$
 ${}\mathrm{_______________________________________________________}$
 $\left[{\mathrm{metric}}{=}\left\{\left({1}{,}{4}\right){=}{-1}{,}\left({2}{,}{2}\right){=}{{r}}^{{2}}{,}\left({3}{,}{3}\right){=}{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}{,}\left({4}{,}{4}\right){=}{-}{2}{}{{k}{}\left({r}{,}{t}\right)}^{{2}}\right\}\right]$ (25)

(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.)

 > $\mathrm{g_}\left[1,1\right]$
 ${0}$ (26)
 > $\mathrm{g_}\left[\mathrm{~1},\mathrm{~1}\right]$
 ${2}{}{{k}{}\left({r}{,}{t}\right)}^{{2}}$ (27)

The determinant of the all-covariant metric

 > $\mathrm{g_}\left[\mathrm{determinant}\right]$
 ${-}{{r}}^{{4}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}$ (28)

The nonzero components

 > $\mathrm{g_}\left[\mathrm{nonzero}\right]$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left\{\left({1}{,}{4}\right){=}{-1}{,}\left({2}{,}{2}\right){=}{{r}}^{{2}}{,}\left({3}{,}{3}\right){=}{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}{,}\left({4}{,}{4}\right){=}{-}{2}{}{{k}{}\left({r}{,}{t}\right)}^{{2}}\right\}$ (29)

The nonzero components of the inverse of the metric, that is, the all-contravariant ${g}_{}^{\mathrm{\mu },\mathrm{\nu }}$

 > $\mathrm{g_}\left[\mathrm{~mu},\mathrm{~nu},\mathrm{nonzero}\right]$
 ${{g}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left\{\left({1}{,}{1}\right){=}{2}{}{{k}{}\left({r}{,}{t}\right)}^{{2}}{,}\left({1}{,}{4}\right){=}{-1}{,}\left({2}{,}{2}\right){=}\frac{{1}}{{{r}}^{{2}}}{,}\left({3}{,}{3}\right){=}\frac{{{\mathrm{csc}}{}\left({\mathrm{\theta }}\right)}^{{2}}}{{{r}}^{{2}}}\right\}$ (30)

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

 > $\mathrm{Christoffel}\left[\mathrm{\mu },\mathrm{\alpha },\mathrm{\beta }\right]$
 ${{\mathrm{\Gamma }}}_{{\mathrm{\mu }}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}}$ (31)
 > $\mathrm{convert}\left(,\mathrm{g_}\right)$
 $\frac{{{\partial }}_{{\mathrm{\beta }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\mu }}}\right)}{{2}}{+}\frac{{{\partial }}_{{\mathrm{\alpha }}}{}\left({{g}}_{{\mathrm{\beta }}{,}{\mathrm{\mu }}}\right)}{{2}}{-}\frac{{{\partial }}_{{\mathrm{\mu }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}\right)}{{2}}$ (32)

Define a tensor $A$ for illustration purposes

 > $\mathrm{Define}\left(A\right)$
 $\mathrm{Defined objects with tensor properties}$
 $\left\{{A}{,}{{▿}}_{{\mathrm{\mu }}}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{R}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{R}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}}{,}{{C}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\gamma }}}_{{a}{,}{b}}{,}{{\mathrm{\Gamma }}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\alpha }}}{,}{{G}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{X}}_{{\mathrm{\mu }}}\right\}$ (33)

The covariant derivative of the contravariant vector ${A}_{}^{\mathrm{\nu }}\left(X\right)$ and its expansion, or rewriting in terms of d_,g_ or Christoffel symbols

 > $\mathrm{D_}\left[\mathrm{\mu }\right]\left(A\left[\mathrm{~nu}\right]\left(X\right)\right)$
 ${{▿}}_{{\mathrm{\mu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{}\left({X}\right)\right)$ (34)
 > $\mathrm{expand}\left(\right)$
 ${{\partial }}_{{\mathrm{\mu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{}\left({X}\right)\right){+}{{\mathrm{\Gamma }}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}{\mathrm{\alpha }}{,}{\mathrm{\mu }}}^{\phantom{{}}{\mathrm{\nu }}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\mu }}}}{}{{A}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}}^{\phantom{{}}{\mathrm{\alpha }}}{}\left({X}\right)$ (35)
 > $\mathrm{convert}\left(,\mathrm{d_}\right)$
 ${{\partial }}_{{\mathrm{\mu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{}\left({X}\right)\right){+}{{\mathrm{\Gamma }}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}{\mathrm{\alpha }}{,}{\mathrm{\mu }}}^{\phantom{{}}{\mathrm{\nu }}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\mu }}}}{}{{A}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}}^{\phantom{{}}{\mathrm{\alpha }}}{}\left({X}\right)$ (36)
 > $\mathrm{convert}\left(,\mathrm{g_}\right)$
 ${{\partial }}_{{\mathrm{\mu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{}\left({X}\right)\right){+}\frac{{{g}}_{\phantom{{}}\phantom{{\mathrm{\beta }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\beta }}{,}{\mathrm{\nu }}}{}\left({{\partial }}_{{\mathrm{\mu }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}\right){+}{{\partial }}_{{\mathrm{\alpha }}}{}\left({{g}}_{{\mathrm{\beta }}{,}{\mathrm{\mu }}}\right){-}{{\partial }}_{{\mathrm{\beta }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\mu }}}\right)\right){}{{A}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}}^{\phantom{{}}{\mathrm{\alpha }}}{}\left({X}\right)}{{2}}$ (37)
 > $\mathrm{convert}\left(,\mathrm{Christoffel}\right)$
 ${{\partial }}_{{\mathrm{\mu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{}\left({X}\right)\right){+}{{g}}_{\phantom{{}}\phantom{{\mathrm{\beta }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\beta }}{,}{\mathrm{\nu }}}{}{{\mathrm{\Gamma }}}_{{\mathrm{\beta }}{,}{\mathrm{\alpha }}{,}{\mathrm{\mu }}}{}{{A}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}}^{\phantom{{}}{\mathrm{\alpha }}}{}\left({X}\right)$ (38)
 > $\mathrm{Simplify}\left(\right)$
 ${{\mathrm{\Gamma }}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}{\mathrm{\mu }}\phantom{{\mathrm{\alpha }}}}^{\phantom{{}}{\mathrm{\nu }}\phantom{{\mathrm{\mu }}}{\mathrm{\alpha }}}{}{{A}}_{{\mathrm{\alpha }}}{}\left({X}\right){+}{{\partial }}_{{\mathrm{\mu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{}\left({X}\right)\right)$ (39)

Alternatively, spacetime derivatives of the metric can be expressed in terms of Christoffel symbols

 > $\mathrm{d_}\left[\mathrm{\mu }\right]\left(\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\beta }\right]\right)$
 ${{\partial }}_{{\mathrm{\mu }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}\right)$ (40)
 > $\mathrm{convert}\left(,\mathrm{Christoffel}\right)$
 ${{\mathrm{\Gamma }}}_{{\mathrm{\beta }}{,}{\mathrm{\alpha }}{,}{\mathrm{\mu }}}{+}{{\mathrm{\Gamma }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}}$ (41)

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,

 > $\mathrm{Ricci}\left[\mathrm{\alpha },\mathrm{\beta }\right]$
 ${{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}$ (42)
 > $\mathrm{convert}\left(,\mathrm{Christoffel}\right)$
 ${{\partial }}_{{\mathrm{\mu }}}{}\left({{\mathrm{\Gamma }}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}{\mathrm{\alpha }}{,}{\mathrm{\beta }}}^{\phantom{{}}{\mathrm{\mu }}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}}\right){-}{{\partial }}_{{\mathrm{\beta }}}{}\left({{\mathrm{\Gamma }}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}{\mathrm{\alpha }}{,}{\mathrm{\mu }}}^{\phantom{{}}{\mathrm{\mu }}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\mu }}}}\right){+}{{\mathrm{\Gamma }}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}{\mathrm{\alpha }}{,}{\mathrm{\beta }}}^{\phantom{{}}{\mathrm{\nu }}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}}{}{{\mathrm{\Gamma }}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}^{\phantom{{}}{\mathrm{\mu }}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}{-}{{\mathrm{\Gamma }}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}{\mathrm{\alpha }}{,}{\mathrm{\mu }}}^{\phantom{{}}{\mathrm{\nu }}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\mu }}}}{}{{\mathrm{\Gamma }}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}{\mathrm{\beta }}{,}{\mathrm{\nu }}}^{\phantom{{}}{\mathrm{\mu }}\phantom{{\mathrm{\beta }}{,}{\mathrm{\nu }}}}$ (43)
 > $\mathrm{convert}\left(,\mathrm{g_}\right)$
 $\frac{{{\partial }}_{{\mathrm{\mu }}}{}\left({{g}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right){}\left({{\partial }}_{{\mathrm{\beta }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\nu }}}\right){+}{{\partial }}_{{\mathrm{\alpha }}}{}\left({{g}}_{{\mathrm{\beta }}{,}{\mathrm{\nu }}}\right){-}{{\partial }}_{{\mathrm{\nu }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}\right)\right)}{{2}}{+}\frac{{{g}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left({{\partial }}_{{\mathrm{\beta }}}{}\left({{\partial }}_{{\mathrm{\mu }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\nu }}}\right)\right){+}{{\partial }}_{{\mathrm{\alpha }}}{}\left({{\partial }}_{{\mathrm{\mu }}}{}\left({{g}}_{{\mathrm{\beta }}{,}{\mathrm{\nu }}}\right)\right){-}{{\partial }}_{{\mathrm{\mu }}}{}\left({{\partial }}_{{\mathrm{\nu }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}\right)\right)\right)}{{2}}{-}\frac{{{\partial }}_{{\mathrm{\beta }}}{}\left({{g}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right){}{{\partial }}_{{\mathrm{\alpha }}}{}\left({{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right)}{{2}}{-}\frac{{{g}}_{\phantom{{}}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{\partial }}_{{\mathrm{\alpha }}}{}\left({{\partial }}_{{\mathrm{\beta }}}{}\left({{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right)\right)}{{2}}{+}\frac{{{g}}_{\phantom{{}}\phantom{{\mathrm{\lambda }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\lambda }}{,}{\mathrm{\nu }}}{}\left({{\partial }}_{{\mathrm{\beta }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\lambda }}}\right){+}{{\partial }}_{{\mathrm{\alpha }}}{}\left({{g}}_{{\mathrm{\beta }}{,}{\mathrm{\lambda }}}\right){-}{{\partial }}_{{\mathrm{\lambda }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}\right)\right){}{{g}}_{\phantom{{}}\phantom{{\mathrm{\kappa }}{,}{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\kappa }}{,}{\mathrm{\mu }}}{}{{\partial }}_{{\mathrm{\nu }}}{}\left({{g}}_{{\mathrm{\kappa }}{,}{\mathrm{\mu }}}\right)}{{4}}{-}\frac{{{g}}_{\phantom{{}}\phantom{{\mathrm{\lambda }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\lambda }}{,}{\mathrm{\nu }}}{}\left({{\partial }}_{{\mathrm{\mu }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\lambda }}}\right){+}{{\partial }}_{{\mathrm{\alpha }}}{}\left({{g}}_{{\mathrm{\lambda }}{,}{\mathrm{\mu }}}\right){-}{{\partial }}_{{\mathrm{\lambda }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\mu }}}\right)\right){}{{g}}_{\phantom{{}}\phantom{{\mathrm{\kappa }}{,}{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\kappa }}{,}{\mathrm{\mu }}}{}\left({{\partial }}_{{\mathrm{\nu }}}{}\left({{g}}_{{\mathrm{\beta }}{,}{\mathrm{\kappa }}}\right){+}{{\partial }}_{{\mathrm{\beta }}}{}\left({{g}}_{{\mathrm{\kappa }}{,}{\mathrm{\nu }}}\right){-}{{\partial }}_{{\mathrm{\kappa }}}{}\left({{g}}_{{\mathrm{\beta }}{,}{\mathrm{\nu }}}\right)\right)}{{4}}$ (44)

To compute with a representation for g_ without actually performing the operation, use the inert form %g_. To afterwards perform the operation use value

 > $\mathrm{%g_}\left[\mathrm{~1},1\right]$
 ${{\mathrm{\delta }}}_{\phantom{{}}\phantom{{1}}{1}}^{\phantom{{}}{1}\phantom{{1}}}$ (45)
 > $\mathrm{value}\left(\right)$
 ${1}$ (46)

It is possible to set the metric searching the database of DifferentialGeometry directly from g_. For example

 > $\mathrm{g_}\left[\mathrm{sik}\right]$
 ${}\mathrm{_______________________________________________________}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[12, 34, 1\right] = \left[Authors = \left[Kaigorodov \left(1962\right), Cahen \left(1964\right), Siklos \left(1981\right), Ozsvath \left(1987\right)\right], PrimaryDescription = Einstein, SecondaryDescription = \left[Homogeneous\right], Comments = \left[All metrics with _epsilon <> 0 are equivalent to the cases _epsilon = +1, -1, _epsilon = 0 is anti-deSitter space\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[12, 35, 1\right] = \left[Authors = \left[Kaigorodov \left(1962\right), Cahen \left(1964\right), Siklos \left(1981\right), Ozsvath \left(1987\right)\right], PrimaryDescription = Einstein, SecondaryDescription = \left[Homogeneous, SimpleTransitive\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[12, 38, 1\right] = \left[Authors = \left[Siklos \left(1985\right)\right], PrimaryDescription = PureRadiation, SecondaryDescription = \left[Homogeneous, PureRadiation\right], Comments = \left[Generic k value, k <> -1 \left(see \left[12, 6, 1\right]\right), 1/2 \left(see \left[12,38,2\right]\right), 3/2 \left(see \left[12,38, 5\right]\right), 2 \left(see \left[12,38, 3\right] and \left[12, 38, 4\right]\right). Note the k = 1/2 is Petrov type "O" .\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[12, 38, 2\right] = \left[Authors = \left[Siklos \left(1985\right)\right], PrimaryDescription = PureRadiation, SecondaryDescription = \left[PureRadiation, Homogeneous\right], Comments = \left[This is k = 1/2 in \left[12, 38, 1\right]. This is of Petrov type "O"\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[12, 38, 3\right] = \left[Authors = \left[Siklos \left(1985\right)\right], PrimaryDescription = EinsteinMaxwell, SecondaryDescription = \left[PureRadiation, Homogeneous\right], Comments = \left[This is _k = 2 and _epsilon = 1 in \left[12, 38, 1\right]. Only _epsilon = 1 gives a Maxwell field\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[12, 38, 4\right] = \left[Authors = \left[Siklos \left(1985\right)\right], PrimaryDescription = PureRadiation, SecondaryDescription = \left[PureRadiation, Homogeneous\right], Comments = \left[This is _k = 2 and _epsilon = -1 in \left[12, 38, 1\right]. Only _epsilon = 1 gives a Maxwell field\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[12, 38, 5\right] = \left[Authors = \left[Siklos \left(1985\right), Nariai\left(1950\right)\right], PrimaryDescription = Einstein, SecondaryDescription = \left[Homogeneous\right], Comments = \left[This is k = 3/2 in \left[12, 38, 1\right]. It is equivalent to \left[12, 34, 1\right]\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[13, 64, 1\right] = \left[Authors = \left[Siklos \left(1981\right)\right], PrimaryDescription = Einstein, SecondaryDescription = \left[\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[13, 64, 3\right] = \left[Authors = \left[Siklos \left(1981\right)\right], PrimaryDescription = Einstein, SecondaryDescription = \left[\right], Comments = \left[See also \left(13, 64, 4\right) for Riemannian orbits\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[13, 64, 4\right] = \left[Authors = \left[Siklos \left(1981\right)\right], PrimaryDescription = Einstein, SecondaryDescription = \left[\right], Comments = \left[See also \left(13, 64, 3\right) for PseudoRiemannian orbits\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[13, 65, 1\right] = \left[Authors = \left[Siklos \left(1981\right)\right], PrimaryDescription = Einstein, SecondaryDescription = \left[\right], Comments = \left[We can use the transformation x -> - x to assume the parameter _b > 0, A boost and a spatial rotation are required to take the null tetrad to an adapted null tetrad\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[13, 67, 1\right] = \left[Authors = \left[Siklos \left(1981\right)\right], PrimaryDescription = Einstein, SecondaryDescription = \left[TwistingSolution\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[13, 67, 2\right] = \left[Authors = \left[Siklos \left(1981\right)\right], PrimaryDescription = Einstein, SecondaryDescription = \left[TwistingSolution\right]\right]}$
 $\mathrm{____________________________________________________________}$
 $\mathrm{\left[38, 1, 1\right] = \left[Authors = \left[Siklos \left(1981\right)\right], PrimaryDescription = Hypersurface-Homogeneous, SecondaryDescription = \left[AlgebraicallySpecial\right]\right]}$
 ${\mathbit{Found more than one match for the keyword \text{'}}}{\mathbit{sik}}{\mathbit{\text{'}, as seen above. Please refine your \text{'}keyword\text{'} or re-enter the metric g_}}\left[{\mathbit{...}}\right]{\mathbit{with the list of three numbers identifying the metric, for example as in g_}}\left[\left[{\mathbf{12}}{,}{\mathbf{34}}{,}{\mathbf{1}}\right]\right]{\mathbit{or}}{\mathbit{Setup}}{}\left({\mathbit{metric}}{\mathbf{=}}\left[{\mathbf{12}}{,}{\mathbf{34}}{,}{\mathbf{1}}\right]\right)$ (47)

You can now refine the search accordingly, for example choose and automatically set the metric [12, 38, 1] including the corresponding coordinates

 > $\mathrm{g_}\left[\left[12,38,1\right]\right]$
 ${}\mathrm{_______________________________________________________}$
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(v{,}y{,}z{,}u\right)\right\}$
 ${}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}\left\{X=\left(v{,}y{,}z{,}u\right)\right\}$
 $\mathrm{The}\mathrm{Siklos \left(1985\right)}\mathrm{metric in coordinates}\left[v{,}y{,}z{,}u\right]$
 $\mathrm{Parameters:}\left[k{,}\mathrm{\epsilon }{,}\mathrm{\Lambda }{,}\mathrm{κ0}\right]$
 $\mathrm{Comments:}Gⅇnⅇric k valuⅇ, k <> -1 \left(sⅇⅇ \left[12, 6, 1\right]\right), 1/2 \left(sⅇⅇ \left[12,38,2\right]\right), 3/2 \left(sⅇⅇ \left[12,38, 5\right]\right), 2 \left(sⅇⅇ \left[12,38, 3\right] anⅆ \left[12, 38, 4\right]\right). Notⅇ thⅇ k = 1/2 is Pⅇtrov typⅇ "O" .$
 $\mathrm{Domain:}\left[0
 $\mathrm{Assumptions:}\left[\mathrm{\epsilon }=-1{,}\mathrm{\epsilon }=1{,}0<\mathrm{κ0}{,}\mathrm{\Lambda }<0\right]$
 $\mathrm{Resetting the signature of spacetime from}\left(\mathrm{- - - +}\right)\mathrm{to}\left(\mathrm{+ + + -}\right)\mathrm{in order to match the signature in the database of metrics}$
 ${}\mathrm{_______________________________________________________}$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left[\right]$ (48)

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.

 > $\mathrm{Define}\left(A,B\right)$
 $\mathrm{Defined objects with tensor properties}$
 $\left\{{B}{,}{{A}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{,}{{▿}}_{{\mathrm{\mu }}}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{R}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{R}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}}{,}{{C}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\gamma }}}_{{a}{,}{b}}{,}{{\mathrm{\Gamma }}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\alpha }}}{,}{{G}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{Τ}}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{X}}_{{\mathrm{\mu }}}\right\}$ (49)

Compare the difference between * and .

 > $\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\mu }\right]A\left[\mathrm{\mu }\right]$
 ${{A}}_{{\mathrm{\mu }}}{}{{\mathrm{\delta }}}_{{\mathrm{\alpha }}\phantom{{\mathrm{\mu }}}}^{\phantom{{\mathrm{\alpha }}}{\mathrm{\mu }}}$ (50)
 > $\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\mu }\right]·A\left[\mathrm{\mu }\right]$
 ${{A}}_{{\mathrm{\alpha }}}$ (51)

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

 > $\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\mu }\right]A\left[\mathrm{\mu }\right]\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\nu }\right]B\left[\mathrm{\nu }\right]$
 ${{A}}_{{\mathrm{\mu }}}{}{{B}}_{{\mathrm{\nu }}}{}{{\mathrm{\delta }}}_{{\mathrm{\alpha }}\phantom{{\mathrm{\mu }}}}^{\phantom{{\mathrm{\alpha }}}{\mathrm{\mu }}}{}{{g}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\alpha }}{,}{\mathrm{\nu }}}$ (52)

You can always Simplify the whole product, as in

 > $\mathrm{Simplify}\left(,\mathrm{indices}\right)$
 ${{A}}_{{\mathrm{\nu }}}{}{{B}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}$ (53)

Using Physics[.], however, you can achieve either the same, or any more selective simplification. Replacing the first * by .,

 > $\left(\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\mu }\right]·A\left[\mathrm{\mu }\right]\right)\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\nu }\right]B\left[\mathrm{\nu }\right]$
 ${{A}}_{{\mathrm{\alpha }}}{}{{B}}_{{\mathrm{\nu }}}{}{{g}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\alpha }}{,}{\mathrm{\nu }}}$ (54)

Likely (note the parenthesis to indicate the desired order of precedence between . and *)

 > $\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\mu }\right]A\left[\mathrm{\mu }\right]\left(\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\nu }\right]·B\left[\mathrm{\nu }\right]\right)$
 ${{B}}_{{\mathrm{\alpha }}}{}{{A}}_{{\mathrm{\mu }}}{}{{g}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\alpha }}{,}{\mathrm{\mu }}}$ (55)

and replacing * and . in the middle of the expression,

 > $\left(\left(\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\mu }\right]A\left[\mathrm{\mu }\right]\right)·\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\nu }\right]\right)B\left[\mathrm{\nu }\right]$
 ${{A}}_{{\mathrm{\nu }}}{}{{B}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}$ (56)

When one of the sides of . is a nested expression, the simplification of contracted indices is performed recursively, compare for instance

 > $\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\mu }\right]\left(A\left[\mathrm{\mu }\right]+B\left[\mathrm{\mu }\right]\right)$
 $\left({{A}}_{{\mathrm{\mu }}}{+}{{B}}_{{\mathrm{\mu }}}\right){}{{\mathrm{\delta }}}_{{\mathrm{\alpha }}\phantom{{\mathrm{\mu }}}}^{\phantom{{\mathrm{\alpha }}}{\mathrm{\mu }}}$ (57)
 > $\mathrm{g_}\left[\mathrm{\alpha },\mathrm{\mu }\right]·\left(A\left[\mathrm{\mu }\right]+B\left[\mathrm{\mu }\right]\right)$
 ${{A}}_{{\mathrm{\alpha }}}{+}{{B}}_{{\mathrm{\alpha }}}$ (58)

Set the spacetime metric to be the Schwarzschild metric and consider the contraction of all the indices of the Riemann tensor

 > $\mathrm{g_}\left[\mathrm{sc}\right]$
 ${}\mathrm{_______________________________________________________}$
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 ${}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 ${}\mathrm{The Schwarzschild metric in coordinates}{}\left[r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right]$
 $\mathrm{Parameters:}\left[m\right]$
 $\mathrm{Signature:}\left(\mathrm{+ + + -}\right)$
 ${}\mathrm{_______________________________________________________}$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left[\right]$ (59)
 > $\mathrm{Riemann}\left[\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }\right]\mathrm{Riemann}\left[\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }\right]$
 ${{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{R}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (60)
 > $\mathrm{Riemann}\left[\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }\right]·\mathrm{Riemann}\left[\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }\right]$
 $\frac{{48}{}{{m}}^{{2}}}{{{r}}^{{6}}}$ (61)

Note: since Maple 2019, KroneckerDelta[mu, nu] is not considered a tensor (of type Physics:-Library:-PhysicsType:-Tensor), even if $\mathrm{\mu }$ and $\mathrm{\nu }$ are letters representing tensor indices. Consequently, in all cases, the following does not return the trace, but the number 1

 > $\mathrm{KroneckerDelta}\left[\mathrm{\mu },\mathrm{\mu }\right]$
 ${1}$ (62)
 > $\mathrm{%KroneckerDelta}\left[\mathrm{\mu },\mathrm{\mu }\right]$
 ${{\mathrm{\delta }}}_{{\mathrm{\mu }}{,}{\mathrm{\mu }}}$ (63)
 > $\mathrm{value}\left(\right)$
 ${1}$ (64)
 > $\mathrm{KroneckerDelta}\left[\mathrm{\mu },\mathrm{\nu }\right]$
 ${{\mathrm{\delta }}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (65)
 > $\mathrm{type}\left(,\mathrm{Physics}:-\mathrm{Library}:-\mathrm{PhysicsType}:-\mathrm{Tensor}\right)$
 ${\mathrm{false}}$ (66)

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 $\mathrm{\delta }$ 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

 > $\mathrm{KroneckerDelta}\left[\mathrm{\mu },\mathrm{~nu}\right]=\mathrm{g_}\left[\mathrm{\mu },\mathrm{~nu}\right]$
 ${{\mathrm{\delta }}}_{{\mathrm{\mu }}\phantom{{\mathrm{\nu }}}}^{\phantom{{\mathrm{\mu }}}{\mathrm{\nu }}}{=}{{\mathrm{\delta }}}_{{\mathrm{\mu }}\phantom{{\mathrm{\nu }}}}^{\phantom{{\mathrm{\mu }}}{\mathrm{\nu }}}$ (67)
 > $\mathrm{lprint}\left(\right)$
 Physics:-g_[mu,~nu] = Physics:-g_[mu,~nu]
 > $\mathrm{eval}\left(,\mathrm{\mu }=\mathrm{\nu }\right)$
 ${4}{=}{4}$ (68)
 > $\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{assuming}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{\mu }=\mathrm{\nu }$
 ${4}{=}{4}$ (69)

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.
 Stephani, H., Kramer, D., MacCallum, M., Hoenselaers, C. Herlt, E.  Exact Solutions of Einstein's Field Equations, Cambridge Monographs on Mathematical Physics, second edition. Cambridge University Press, 2003.

Compatibility

 • The Physics[g_] command was updated in Maple 2019.