 The Einstein tensor - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Physics : Physics/Einstein

Physics[Einstein] - The Einstein tensor

 Calling Sequence Einstein[$\mathrm{\mu },\mathrm{\nu }$] keyword : optional, it can be definition, array, nonzero convert(expression, Einstein)

Parameters

 mu, nu - the indices, as names representing integer numbers between 0 and the spacetime dimension, they can also be the numbers themselves keyword - optional, it can be definition, array or matrix, nonzero

Description

 • The Einstein[mu, nu], displayed as $\mathrm{G__μ,ν}$, is a computational representation for the Einstein tensor, defined in terms of the Ricci tensor as

${G}_{\mathrm{\mu },\mathrm{\nu }}={R}_{\mathrm{\mu },\mathrm{\nu }}-\frac{1}{2}{g}_{\mathrm{\mu },\mathrm{\nu }}{R}_{\mathrm{\alpha }}^{\mathrm{\alpha }}$

 • From this definition, and because of the symmetry of the Ricci tensor with respect to interchanging the position of its two indices, the Einstein tensor is also symmetric.
 • It is sometimesconvenient to rewrite tensorial expressions in terms of the Einstein tensor. For this purpose you can use convert(expression, Einstein).
 • When the indices of Einstein assume integer values they are expected to be between 0 and the spacetime dimension, prefixed by ~ when they are contravariant, and the corresponding value of Einstein 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 Einstein returns unevaluated after normalizing its indices taking into account their symmetry property.
 • 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.
 • When Physics is loaded, the default spacetime is galilean, of Minkowski type. During a Maple session, the value of any component of $\mathrm{G__μ,ν}$ is automatically determined by the value of the spacetime metric and so all the elements of Einstein are automatically zero. To set the spacetime metric to something different, use Setup. Also, at least one coordinate system must be set in order to compute the derivatives entering the definition of the Christoffel symbols, used to construct the Ricci tensor and so Einstein. For that purpose see Coordinates or Setup.
 • Besides being indexed with two indices, Einstein accepts three keywords:
 – definition: returns the definition of the Einstein tensor in terms of the Ricci tensor.
 – matrix: (synonyms: Matrix, array, Array, or no indices whatsoever, as in Einstein[]) returns a Matrix that when indexed with numerical values from 1 to the dimension of spacetime returns the value of each of the components of Einstein. 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 Array obtained with the keyword array.
 • Some automatic checking and normalization are carried out each time you enter Einstein[...]. The checking is concerned with possible syntax errors. The automatic normalization takes into account the symmetry of Einstein[mu,nu] with respect to interchanging the positions of the indices mu and nu.
 • The %Einstein command is the inert form of Einstein, so it represents the same mathematical operation but without performing it. To perform the operation, use value.

Examples

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

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

 > Setup(coordinatesystems = cartesian);
 ${}{}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}{}{}\left\{X=\left(x{,}y{,}z{,}t\right)\right\}$
 ${}{}\mathrm{Systems of spacetime coordinates are:}{}{}{}\left\{X=\left(x{,}y{,}z{,}t\right)\right\}$
 $\left[{\mathrm{coordinatesystems}}{=}\left\{{X}\right\}\right]$ (2)

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

 > g_[];
 ${{\mathrm{g_}}}_{{\mathrm{μ}}{,}{\mathrm{ν}}}{=}\left(\left[\begin{array}{rrrr}-1& 0& 0& 0\\ 0& -1& 0& 0\\ 0& 0& -1& 0\\ 0& 0& 0& 1\end{array}\right]\right)$ (3)

Check the nonzero components of Christoffel, used to construct the Ricci tensor entering the definition of Einstein: because the default spacetime is of Minkowski type, there are none

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

Hence

 > Einstein[mu, nu];
 ${0}$ (5)

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

 > ds2 := r^2*dtheta^2 + r^2*sin(theta)^2*dphi^2 - 2*dt*dr - 2*k(r, t)^2*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}}$ (6)
 > Setup(coordinates = spherical, metric = ds2);
 ${}{}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}{}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 ${}{}\mathrm{Systems of spacetime coordinates are:}{}{}{}\left\{X=\left(r{,}\mathrm{\theta }{,}\mathrm{\phi }{,}t\right)\right\}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{coordinatesystems}}{=}\left\{{X}\right\}{,}{\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]$ (7)
 > g_[];
 ${{\mathrm{g_}}}_{{\mathrm{μ}}{,}{\mathrm{ν}}}{=}\left(\left[\begin{array}{cccc}0& 0& 0& -1\\ 0& {r}^{2}& 0& 0\\ 0& 0& {r}^{2}{}{\mathrm{sin}{}\left(\mathrm{θ}\right)}^{2}& 0\\ -1& 0& 0& -2{}{k{}\left(r,t\right)}^{2}\end{array}\right]\right)$ (8)

Now when the indices are not numerical, Einstein returns itself after normalizing its second and third indices taking advantage of the symmetry of its indices

 > Einstein[alpha, beta];
 ${{G}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}$ (9)
 > Einstein[beta, alpha];
 ${{G}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}$ (10)
 > (9) - (10);
 ${0}$ (11)

To express Einstein in terms of the Ricci tensor using its definition use convert to Ricci

 > convert((9), Ricci);
 ${{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}{-}\frac{{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}{}{{R}}_{{\mathrm{\mu }}\phantom{{\mathrm{\mu }}}}^{\phantom{{\mathrm{\mu }}}{\mathrm{\mu }}}}{{2}}$ (12)
 > convert((9), Ricci, evaluatetrace);
 ${{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}{+}\frac{{{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}{}\left({2}{}\left(\frac{{{\partial }}^{{2}}}{{\partial }{{r}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{k}{}\left({r}{,}{t}\right)\right){}{k}{}\left({r}{,}{t}\right){}{{r}}^{{2}}{+}{2}{}{\left(\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{k}{}\left({r}{,}{t}\right)\right)}^{{2}}{}{{r}}^{{2}}{+}{8}{}{k}{}\left({r}{,}{t}\right){}{r}{}\left(\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{k}{}\left({r}{,}{t}\right)\right){+}{2}{}{{k}{}\left({r}{,}{t}\right)}^{{2}}{-}{1}\right)}{{{r}}^{{2}}}$ (13)

Check the value of $\mathrm{G__μ,ν}$ for $\mathrm{\mu }$ = $\mathrm{\nu }$ = 1

 > Einstein[1, 1];
 ${0}$ (14)

Now of ${G}_{\mathrm{\nu }}^{\mathrm{\mu }}$ for $\mathrm{\mu }$ = $\mathrm{\nu }$ = 1 (note you enter the value of the contravariant index prefixed by ~)

 > Einstein[~1, 1];
 $\frac{{4}{}{k}{}\left({r}{,}{t}\right){}{r}{}\left(\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{k}{}\left({r}{,}{t}\right)\right){+}{2}{}{{k}{}\left({r}{,}{t}\right)}^{{2}}{-}{1}}{{{r}}^{{2}}}$ (15)

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

 > %Einstein[~1,1];
 ${{\mathrm{%Einstein}}}_{\phantom{{}}\phantom{{1}}{1}}^{\phantom{{}}{1}\phantom{{1}}}$ (16)
 > value((16));
 $\frac{{4}{}{k}{}\left({r}{,}{t}\right){}{r}{}\left(\frac{{\partial }}{{\partial }{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{k}{}\left({r}{,}{t}\right)\right){+}{2}{}{{k}{}\left({r}{,}{t}\right)}^{{2}}{-}{1}}{{{r}}^{{2}}}$ (17)

To have a more compact display in the following examples, suppress the display of the dependency of $k\left(r,t\right)$ and have the display of derivatives in jet notation, indexed (see Typesetting)

 > Typesetting:-Suppress(k(r,t));
 > Typesetting:-Settings(userep = true);
 ${\mathrm{false}}$ (18)

Compute now the Matrix form of $\mathrm{G__μ,ν}$.

 > Einstein[mu, nu, matrix];
 ${{\mathrm{Einstein}}}_{{\mathrm{μ}}{,}{\mathrm{ν}}}{=}\left(\left[\begin{array}{cccc}0& 0& 0& \frac{-4{}k{}\left(r,t\right){}r{}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)-2{}{k{}\left(r,t\right)}^{2}+1}{{r}^{2}}\\ 0& 2{}\left(k{}\left(r,t\right){}\left(\frac{\partial }{\partial r}{}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)\right){}r+{\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)}^{2}{}r+2{}k{}\left(r,t\right){}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)\right){}r& 0& 0\\ 0& 0& 2{}r{}{\mathrm{sin}{}\left(\mathrm{θ}\right)}^{2}{}\left(k{}\left(r,t\right){}\left(\frac{\partial }{\partial r}{}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)\right){}r+{\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)}^{2}{}r+2{}k{}\left(r,t\right){}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)\right)& 0\\ \frac{-4{}k{}\left(r,t\right){}r{}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)-2{}{k{}\left(r,t\right)}^{2}+1}{{r}^{2}}& 0& 0& \frac{2{}k{}\left(r,t\right){}\left(-4{}{k{}\left(r,t\right)}^{2}{}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right){}r-2{}{k{}\left(r,t\right)}^{3}+2{}\left(\frac{\partial }{\partial t}{}k{}\left(r,t\right)\right){}r+k{}\left(r,t\right)\right)}{{r}^{2}}\end{array}\right]\right)$ (19)

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 Einstein[].

This is the matrix form of ${G}_{\mathrm{\nu }}^{\mathrm{\mu }}$ (note the contravariant index $\mathrm{\mu }$, prefixed by ~)

 > Einstein[~mu, nu, matrix];
 ${{\mathrm{Einstein}}}_{{\mathrm{~mu}}{,}{\mathrm{ν}}}{=}\left(\left[\begin{array}{cccc}\frac{4{}k{}\left(r,t\right){}r{}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)+2{}{k{}\left(r,t\right)}^{2}-1}{{r}^{2}}& 0& 0& -\frac{4{}k{}\left(r,t\right){}\left(\frac{\partial }{\partial t}{}k{}\left(r,t\right)\right)}{r}\\ 0& \frac{2{}k{}\left(r,t\right){}\left(\frac{\partial }{\partial r}{}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)\right){}r+2{}{\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)}^{2}{}r+4{}k{}\left(r,t\right){}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)}{r}& 0& 0\\ 0& 0& \frac{2{}k{}\left(r,t\right){}\left(\frac{\partial }{\partial r}{}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)\right){}r+2{}{\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)}^{2}{}r+4{}k{}\left(r,t\right){}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)}{r}& 0\\ 0& 0& 0& \frac{4{}k{}\left(r,t\right){}r{}\left(\frac{\partial }{\partial r}{}k{}\left(r,t\right)\right)+2{}{k{}\left(r,t\right)}^{2}-1}{{r}^{2}}\end{array}\right]\right)$ (20)

To use this matrix, because its components were computed by already taking into account the (covariant/contravariant) character of its indices, you do not need to indicate furthermore that character. So for ${G}_{1}^{1}$ we have

 > G := rhs((20)):
 > G[1,1];
 $\frac{{4}{}{k}{}{r}{}\left({{k}}_{{r}}\right){+}{2}{}{{k}}^{{2}}{-}{1}}{{{r}}^{{2}}}$ (21)

Compare with the output obtained entering Einstein[~1, 1] in eq (14)

 > normal((15) - (21));
 ${0}$ (22)
 >

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.

Compatibility

 • The Physics[Einstein] command was introduced in Maple 16.
 • For more information on Maple 16 changes, see Updates in Maple 16.
 • The Physics[Einstein] command was updated in Maple 2017.