Overview of General Relativity Computations - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Mathematics : DifferentialGeometry : Overview of General Relativity Computations

An Overview of General Relativity computations with DifferentialGeometry

Description

 • The GRTensor package, developed by K. Lake, P. Musgrave and D. Polleny, has long provided the general relativity community with an excellent collection of command for symbolic computations in general relativity. This functionality is also now available within the DifferentialGeometry package and its subpackage Tensor, as well as within the Physics package.
 • This worksheet provides a quick introduction to General Relativity computations using DifferentialGeometry.

1. Getting Started

In this section we give a quick illustration of the use of the DifferentialGeometry software to perform a standard calculation in General Relativity. We shall solve the Einstein vacuum equations for spherically symmetric metrics in 4-dimensions. We check that the solution is of Petrov type D and we show that there are 4 Killing vectors.  First load the DifferentialGeometry package, the Tensor subpackage and the Tools subpackage.

 > with(DifferentialGeometry): with(Tensor): with(Tools):

All calculations in DifferentialGeometry begin by using the DGsetup command to initialize the computational environment. For our illustration we shall use standard spherical coordinates We use the name $\mathrm{M1}$ to designate the computational environment (in this case a 4-dimensional manifold) which we are creating.

 > DGsetup([t, r, theta, phi], M1, verbose);
 ${\mathrm{The following coordinates have been protected:}}$
 $\left[{t}{,}{r}{,}{\mathrm{\theta }}{,}{\mathrm{\phi }}\right]$
 ${\mathrm{The following vector fields have been defined and protected:}}$
 $\left[{\mathrm{D_t}}{,}{\mathrm{D_r}}{,}{\mathrm{D_θ}}{,}{\mathrm{D_φ}}\right]$
 ${\mathrm{The following differential 1-forms have been defined and protected:}}$
 $\left[{\mathrm{dt}}{,}{\mathrm{dr}}{,}{\mathrm{dθ}}{,}{\mathrm{dφ}}\right]$
 ${\mathrm{frame name: M1}}$ (1)

The coordinate vectors and the 1-forms are now defined and these can be used to construct general vector fields, differential forms and tensors. Use +/- for addition and subtraction, * for scalar multiplication, &t for tensor product and &w for wedge product. The command evalDG is used to insure that these operations are properly performed in DifferentialGeometry.

Here is the usual form for the static (time-independent), rotational invariant metric that is used as the starting ansatz for solving the Einstein equations. The two functions $A\left(r\right)$ and $B\left(r\right)$ will be determined by the Einstein equations

 > g := evalDG( A(r) *dt &t dt + B(r)* dr &t dr + r^2*(dtheta &t dtheta + sin(theta)^2* dphi &t dphi));
 ${g}{≔}{A}{}\left({r}\right){}{\mathrm{dt}}{}{\mathrm{dt}}{+}{B}{}\left({r}\right){}{\mathrm{dr}}{}{\mathrm{dr}}{+}{{r}}^{{2}}{}{\mathrm{dθ}}{}{\mathrm{dθ}}{+}{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}{}{\mathrm{dφ}}{}{\mathrm{dφ}}$ (2)

To solve the Einstein equations for this metric, we first calculate the Einstein tensor.

 > Ein := EinsteinTensor(g);
 ${\mathrm{Ein}}{≔}{-}\frac{\left({r}{}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{B}{}\left({r}\right)\right){+}{{B}{}\left({r}\right)}^{{2}}{-}{B}{}\left({r}\right)\right){}{\mathrm{D_t}}}{{A}{}\left({r}\right){}{{r}}^{{2}}{}{{B}{}\left({r}\right)}^{{2}}}{}{\mathrm{D_t}}{-}\frac{\left({A}{}\left({r}\right){}{B}{}\left({r}\right){-}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{r}{-}{A}{}\left({r}\right)\right){}{\mathrm{D_r}}}{{A}{}\left({r}\right){}{{B}{}\left({r}\right)}^{{2}}{}{{r}}^{{2}}}{}{\mathrm{D_r}}{-}\frac{\left(\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{B}{}\left({r}\right)\right){}{A}{}\left({r}\right){}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{r}{-}{2}{}{B}{}\left({r}\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{r}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{A}{}\left({r}\right){}{r}{+}{B}{}\left({r}\right){}{\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right)}^{{2}}{}{r}{+}{2}{}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{B}{}\left({r}\right)\right){}{{A}{}\left({r}\right)}^{{2}}{-}{2}{}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{B}{}\left({r}\right){}{A}{}\left({r}\right)\right){}{\mathrm{D_θ}}}{{4}{}{{r}}^{{3}}{}{{B}{}\left({r}\right)}^{{2}}{}{{A}{}\left({r}\right)}^{{2}}}{}{\mathrm{D_θ}}{-}\frac{\left(\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{B}{}\left({r}\right)\right){}{A}{}\left({r}\right){}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{r}{-}{2}{}{B}{}\left({r}\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{r}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{A}{}\left({r}\right){}{r}{+}{B}{}\left({r}\right){}{\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right)}^{{2}}{}{r}{+}{2}{}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{B}{}\left({r}\right)\right){}{{A}{}\left({r}\right)}^{{2}}{-}{2}{}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{B}{}\left({r}\right){}{A}{}\left({r}\right)\right){}{\mathrm{D_φ}}}{{4}{}{{r}}^{{3}}{}{{B}{}\left({r}\right)}^{{2}}{}{{A}{}\left({r}\right)}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}}{}{\mathrm{D_φ}}$ (3)

The command DGinfo is a utility program that can be used to obtain information about the computational environment and information about various DifferentialGeometry objects. Here we use DGinfoto extract all the coefficients of the Einstein tensor.

 > EinEq := DGinfo(Ein, "CoefficientSet");
 ${\mathrm{EinEq}}{≔}\left\{{-}\frac{\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{B}{}\left({r}\right)\right){}{A}{}\left({r}\right){}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{r}{-}{2}{}{B}{}\left({r}\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{r}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{A}{}\left({r}\right){}{r}{+}{B}{}\left({r}\right){}{\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right)}^{{2}}{}{r}{+}{2}{}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{B}{}\left({r}\right)\right){}{{A}{}\left({r}\right)}^{{2}}{-}{2}{}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{B}{}\left({r}\right){}{A}{}\left({r}\right)}{{4}{}{{r}}^{{3}}{}{{B}{}\left({r}\right)}^{{2}}{}{{A}{}\left({r}\right)}^{{2}}}{,}{-}\frac{{r}{}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{B}{}\left({r}\right)\right){+}{{B}{}\left({r}\right)}^{{2}}{-}{B}{}\left({r}\right)}{{A}{}\left({r}\right){}{{r}}^{{2}}{}{{B}{}\left({r}\right)}^{{2}}}{,}{-}\frac{{A}{}\left({r}\right){}{B}{}\left({r}\right){-}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{r}{-}{A}{}\left({r}\right)}{{A}{}\left({r}\right){}{{B}{}\left({r}\right)}^{{2}}{}{{r}}^{{2}}}{,}{-}\frac{\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{B}{}\left({r}\right)\right){}{A}{}\left({r}\right){}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{r}{-}{2}{}{B}{}\left({r}\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{r}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{A}{}\left({r}\right){}{r}{+}{B}{}\left({r}\right){}{\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right)}^{{2}}{}{r}{+}{2}{}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{B}{}\left({r}\right)\right){}{{A}{}\left({r}\right)}^{{2}}{-}{2}{}\left(\frac{{ⅆ}}{{ⅆ}{r}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{A}{}\left({r}\right)\right){}{B}{}\left({r}\right){}{A}{}\left({r}\right)}{{4}{}{{r}}^{{3}}{}{{B}{}\left({r}\right)}^{{2}}{}{{A}{}\left({r}\right)}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}}\right\}$ (4)

Now we use the Maple command pdsolve to integrate these differential equations:

 > Soln := pdsolve(EinEq);
 ${\mathrm{Soln}}{≔}\left\{{A}{}\left({r}\right){=}\frac{\left({r}{+}\mathrm{c__1}\right){}\mathrm{c__2}}{{r}}{,}{B}{}\left({r}\right){=}\frac{{r}}{{r}{+}\mathrm{c__1}}\right\}$ (5)

The constant _C1 is essentially the mass of the point source of the gravitational field. The constant _C2 is easily normalized to -1 by a re-scaling of time.

 > gS := subs({_C1 = - 2*m, _C2= -1},subs(Soln, g));
 ${\mathrm{gS}}{≔}{-}\frac{\left({r}{-}{2}{}{m}\right){}{\mathrm{dt}}}{{r}}{}{\mathrm{dt}}{+}\frac{{r}{}{\mathrm{dr}}}{{r}{-}{2}{}{m}}{}{\mathrm{dr}}{+}{{r}}^{{2}}{}{\mathrm{dθ}}{}{\mathrm{dθ}}{+}{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}{}{\mathrm{dφ}}{}{\mathrm{dφ}}$ (6)

This is the Schwarzschild metric in standard coordinates. The Einstein tensor vanishes as required.

 > EinsteinTensor(gS);
 ${0}{}{\mathrm{D_t}}{}{\mathrm{D_t}}$ (7)

The metric admits 4 Killing vectors.

 > K := KillingVectors(gS);
 ${K}{≔}\left[{-}{\mathrm{D_t}}{,}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}{\mathrm{D_θ}}{+}{\mathrm{cos}}{}\left({\mathrm{\phi }}\right){}{\mathrm{cot}}{}\left({\mathrm{\theta }}\right){}{\mathrm{D_φ}}{,}{\mathrm{cos}}{}\left({\mathrm{\phi }}\right){}{\mathrm{D_θ}}{-}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}{\mathrm{cot}}{}\left({\mathrm{\theta }}\right){}{\mathrm{D_φ}}{,}{\mathrm{D_φ}}\right]$ (8)
 > subs({sqrt(1-cos(2*theta)) = sqrt(2)*sin(theta)}, K);
 $\left[{-}{\mathrm{D_t}}{,}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}{\mathrm{D_θ}}{+}{\mathrm{cos}}{}\left({\mathrm{\phi }}\right){}{\mathrm{cot}}{}\left({\mathrm{\theta }}\right){}{\mathrm{D_φ}}{,}{\mathrm{cos}}{}\left({\mathrm{\phi }}\right){}{\mathrm{D_θ}}{-}{\mathrm{sin}}{}\left({\mathrm{\phi }}\right){}{\mathrm{cot}}{}\left({\mathrm{\theta }}\right){}{\mathrm{D_φ}}{,}{\mathrm{D_φ}}\right]$ (9)

The Petrov type of this metric is "D".

 > PetrovType(gS);
 ${"D"}$ (10)

It is often convenient to store the entries of a metric in a symmetric matrix.

 > convert(convert(gS, DGArray), Matrix);
 $\left[\begin{array}{cccc}{-}\frac{{r}{-}{2}{}{m}}{{r}}& {0}& {0}& {0}\\ {0}& \frac{{r}}{{r}{-}{2}{}{m}}& {0}& {0}\\ {0}& {0}& {{r}}^{{2}}& {0}\\ {0}& {0}& {0}& {{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}\end{array}\right]$ (11)

2. Algebraic Manipulations of Tensors

We use a simple metric defined on a 3-dimensional space to illustrate some basis algebraic manipulations with tensors.

First define a coordinate chart with coordinates

 > DGsetup([x, y, z], M2);
 ${\mathrm{frame name: M2}}$ (12)

Define a metric $g$.

 > g2 := evalDG(z*(dx&t dy + dy &t dx) + x^2*dz &t dz);
 ${\mathrm{g2}}{≔}{z}{}{\mathrm{dx}}{}{\mathrm{dy}}{+}{z}{}{\mathrm{dy}}{}{\mathrm{dx}}{+}{{x}}^{{2}}{}{\mathrm{dz}}{}{\mathrm{dz}}$ (13)

Calculate the inverse metric

 > h := InverseMetric(g2);
 ${h}{≔}\frac{{\mathrm{D_x}}}{{z}}{}{\mathrm{D_y}}{+}\frac{{\mathrm{D_y}}}{{z}}{}{\mathrm{D_x}}{+}\frac{{\mathrm{D_z}}}{{{x}}^{{2}}}{}{\mathrm{D_z}}$ (14)

Define a rank 3 tensor.

 > T := evalDG(dx &t D_y &t dz);
 ${T}{≔}{\mathrm{dx}}{}{\mathrm{D_y}}{}{\mathrm{dz}}$ (15)

Lower the second index of T.

 > RaiseLowerIndices(g2, T, [2]);
 ${z}{}{\mathrm{dx}}{}{\mathrm{dx}}{}{\mathrm{dz}}$ (16)

Raise the 1st and 3rd indices of T using the inverse metric $h$.

 > RaiseLowerIndices(h, T, [1,3]);
 $\frac{{\mathrm{D_y}}}{{z}{}{{x}}^{{2}}}{}{\mathrm{D_y}}{}{\mathrm{D_z}}$ (17)

Rearrange the 1st and 2nd indices.

 > RearrangeIndices(T, [[1,2]]);
 ${\mathrm{D_y}}{}{\mathrm{dx}}{}{\mathrm{dz}}$ (18)

Symmetrize over the 1st and 3rd indices

 > SymmetrizeIndices(T, [1, 3], "Symmetric");
 $\frac{{\mathrm{dx}}}{{2}}{}{\mathrm{D_y}}{}{\mathrm{dz}}{+}\frac{{\mathrm{dz}}}{{2}}{}{\mathrm{D_y}}{}{\mathrm{dx}}$ (19)

3. Derivatives

One can compute the exterior derivative of a differential form, the Lie derivative of any tensor field with respect to a vector field or the covariant derivative of any tensor field with respect to a connection

 > DGsetup([x, y, z], N);
 ${\mathrm{frame name: N}}$ (20)

Define a 1-form and calculate the exterior derivative.

 > omega := evalDG(sin(x) *dy + x^2*dz);
 ${\mathrm{\omega }}{≔}{\mathrm{sin}}{}\left({x}\right){}{\mathrm{dy}}{+}{{x}}^{{2}}{}{\mathrm{dz}}$ (21)
 > ExteriorDerivative(omega);
 ${\mathrm{cos}}{}\left({x}\right){}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dy}}{+}{2}{}{x}{}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dz}}$ (22)

Define a vector field  and a tensor  and calculate the Lie derivative.

 > X := evalDG(y*D_x + x*D_z);
 ${X}{≔}{y}{}{\mathrm{D_x}}{+}{x}{}{\mathrm{D_z}}$ (23)
 > T := evalDG(x^2*D_y &t dz);
 ${T}{≔}{{x}}^{{2}}{}{\mathrm{D_y}}{}{\mathrm{dz}}$ (24)
 > LieDerivative(X, T);
 ${-}{{x}}^{{2}}{}{\mathrm{D_x}}{}{\mathrm{dz}}{+}{{x}}^{{2}}{}{\mathrm{D_y}}{}{\mathrm{dx}}{+}{2}{}{y}{}{x}{}{\mathrm{D_y}}{}{\mathrm{dz}}$ (25)

Define a connection and calculate the covariant derivative of

 > C := Connection(a*D_z &t dx &t dy);
 ${C}{≔}{a}{}{\mathrm{D_z}}{}{\mathrm{dx}}{}{\mathrm{dy}}$ (26)
 > CovariantDerivative(T, C);
 ${-}{a}{}{{x}}^{{2}}{}{\mathrm{D_y}}{}{\mathrm{dx}}{}{\mathrm{dy}}{+}{2}{}{x}{}{\mathrm{D_y}}{}{\mathrm{dz}}{}{\mathrm{dx}}$ (27)

4. Useful Utilities

The DifferentialGeometry package has many useful utilities for working with differential forms and tensors.  For example, we can easily construct a general metric as follows. (GenerateSymmetricTensors, DGzip)

 > DGsetup([x, y, z], N);
 ${\mathrm{frame name: N}}$ (28)
 > S := GenerateSymmetricTensors([dx, dy , dz], 2);
 ${S}{≔}\left[{\mathrm{dx}}{}{\mathrm{dx}}{,}\frac{{\mathrm{dx}}}{{2}}{}{\mathrm{dy}}{+}\frac{{\mathrm{dy}}}{{2}}{}{\mathrm{dx}}{,}\frac{{\mathrm{dx}}}{{2}}{}{\mathrm{dz}}{+}\frac{{\mathrm{dz}}}{{2}}{}{\mathrm{dx}}{,}{\mathrm{dy}}{}{\mathrm{dy}}{,}\frac{{\mathrm{dy}}}{{2}}{}{\mathrm{dz}}{+}\frac{{\mathrm{dz}}}{{2}}{}{\mathrm{dy}}{,}{\mathrm{dz}}{}{\mathrm{dz}}\right]$ (29)
 > g := DGzip([a1,a2,a3,a4,a5,a6](x, y, z), S, "plus");
 ${g}{≔}{\mathrm{a1}}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{dx}}{}{\mathrm{dx}}{+}\frac{{\mathrm{a2}}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{dx}}}{{2}}{}{\mathrm{dy}}{+}\frac{{\mathrm{a3}}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{dx}}}{{2}}{}{\mathrm{dz}}{+}\frac{{\mathrm{a2}}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{dy}}}{{2}}{}{\mathrm{dx}}{+}{\mathrm{a4}}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{dy}}{}{\mathrm{dy}}{+}\frac{{\mathrm{a5}}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{dy}}}{{2}}{}{\mathrm{dz}}{+}\frac{{\mathrm{a3}}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{dz}}}{{2}}{}{\mathrm{dx}}{+}\frac{{\mathrm{a5}}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{dz}}}{{2}}{}{\mathrm{dy}}{+}{\mathrm{a6}}{}\left({x}{,}{y}{,}{z}\right){}{\mathrm{dz}}{}{\mathrm{dz}}$ (30)

As another example, we can get the components of any tensor with respect to any basis with the command GetComponents.

 > B := evalDG([dx , dx -dy, dx +2*dy -dz]);
 ${B}{≔}\left[{\mathrm{dx}}{,}{\mathrm{dx}}{-}{\mathrm{dy}}{,}{\mathrm{dx}}{+}{2}{}{\mathrm{dy}}{-}{\mathrm{dz}}\right]$ (31)
 > alpha := evalDG(dx - 3*dy + 5*dz);
 ${\mathrm{\alpha }}{≔}{\mathrm{dx}}{-}{3}{}{\mathrm{dy}}{+}{5}{}{\mathrm{dz}}$ (32)
 > GetComponents(alpha, B);
 $\left[{13}{,}{-7}{,}{-5}\right]$ (33)

5. Curvature Tensors

The Riemann curvature tensor, the Ricci tensor, the Ricci scalar and the Weyl tensor of a metric are easily computed. Here we use the Godel metric.

 > DGsetup([x, y, z, t], M5);
 ${\mathrm{frame name: M5}}$ (34)

To define the metric, we first define a 1-form and then define the metric in terms of the 1-form.

 > omega := evalDG(dt + exp(x)*dz);
 ${\mathrm{\omega }}{≔}{{ⅇ}}^{{x}}{}{\mathrm{dz}}{+}{\mathrm{dt}}$ (35)
 > g5 := evalDG(dx &t dx + dy &t dy +1/2*exp(2*x)*dz &t dz - omega &t omega);
 ${\mathrm{g5}}{≔}{\mathrm{dx}}{}{\mathrm{dx}}{+}{\mathrm{dy}}{}{\mathrm{dy}}{-}\frac{{{ⅇ}}^{{2}{}{x}}{}{\mathrm{dz}}}{{2}}{}{\mathrm{dz}}{-}{{ⅇ}}^{{x}}{}{\mathrm{dz}}{}{\mathrm{dt}}{-}{{ⅇ}}^{{x}}{}{\mathrm{dt}}{}{\mathrm{dz}}{-}{\mathrm{dt}}{}{\mathrm{dt}}$ (36)

Here is the curvature tensor (as a type (1, 3)) tensor.

 > CurvatureTensor(g5);
 $\frac{{3}{}{{ⅇ}}^{{2}{}{x}}{}{\mathrm{D_x}}}{{4}}{}{\mathrm{dz}}{}{\mathrm{dx}}{}{\mathrm{dz}}{+}\frac{{{ⅇ}}^{{x}}{}{\mathrm{D_x}}}{{2}}{}{\mathrm{dz}}{}{\mathrm{dx}}{}{\mathrm{dt}}{-}\frac{{3}{}{{ⅇ}}^{{2}{}{x}}{}{\mathrm{D_x}}}{{4}}{}{\mathrm{dz}}{}{\mathrm{dz}}{}{\mathrm{dx}}{-}\frac{{{ⅇ}}^{{x}}{}{\mathrm{D_x}}}{{2}}{}{\mathrm{dz}}{}{\mathrm{dt}}{}{\mathrm{dx}}{+}\frac{{{ⅇ}}^{{x}}{}{\mathrm{D_x}}}{{2}}{}{\mathrm{dt}}{}{\mathrm{dx}}{}{\mathrm{dz}}{+}\frac{{\mathrm{D_x}}}{{2}}{}{\mathrm{dt}}{}{\mathrm{dx}}{}{\mathrm{dt}}{-}\frac{{{ⅇ}}^{{x}}{}{\mathrm{D_x}}}{{2}}{}{\mathrm{dt}}{}{\mathrm{dz}}{}{\mathrm{dx}}{-}\frac{{\mathrm{D_x}}}{{2}}{}{\mathrm{dt}}{}{\mathrm{dt}}{}{\mathrm{dx}}{-}\frac{{\mathrm{D_z}}}{{2}}{}{\mathrm{dx}}{}{\mathrm{dx}}{}{\mathrm{dz}}{+}\frac{{\mathrm{D_z}}}{{2}}{}{\mathrm{dx}}{}{\mathrm{dz}}{}{\mathrm{dx}}{+}\frac{{{ⅇ}}^{{x}}{}{\mathrm{D_z}}}{{2}}{}{\mathrm{dz}}{}{\mathrm{dz}}{}{\mathrm{dt}}{-}\frac{{{ⅇ}}^{{x}}{}{\mathrm{D_z}}}{{2}}{}{\mathrm{dz}}{}{\mathrm{dt}}{}{\mathrm{dz}}{+}\frac{{\mathrm{D_z}}}{{2}}{}{\mathrm{dt}}{}{\mathrm{dz}}{}{\mathrm{dt}}{-}\frac{{\mathrm{D_z}}}{{2}}{}{\mathrm{dt}}{}{\mathrm{dt}}{}{\mathrm{dz}}{+}{{ⅇ}}^{{x}}{}{\mathrm{D_t}}{}{\mathrm{dx}}{}{\mathrm{dx}}{}{\mathrm{dz}}{+}\frac{{\mathrm{D_t}}}{{2}}{}{\mathrm{dx}}{}{\mathrm{dx}}{}{\mathrm{dt}}{-}{{ⅇ}}^{{x}}{}{\mathrm{D_t}}{}{\mathrm{dx}}{}{\mathrm{dz}}{}{\mathrm{dx}}{-}\frac{{\mathrm{D_t}}}{{2}}{}{\mathrm{dx}}{}{\mathrm{dt}}{}{\mathrm{dx}}{-}\frac{{{ⅇ}}^{{2}{}{x}}{}{\mathrm{D_t}}}{{4}}{}{\mathrm{dz}}{}{\mathrm{dz}}{}{\mathrm{dt}}{+}\frac{{{ⅇ}}^{{2}{}{x}}{}{\mathrm{D_t}}}{{4}}{}{\mathrm{dz}}{}{\mathrm{dt}}{}{\mathrm{dz}}{-}\frac{{{ⅇ}}^{{x}}{}{\mathrm{D_t}}}{{2}}{}{\mathrm{dt}}{}{\mathrm{dz}}{}{\mathrm{dt}}{+}\frac{{{ⅇ}}^{{x}}{}{\mathrm{D_t}}}{{2}}{}{\mathrm{dt}}{}{\mathrm{dt}}{}{\mathrm{dz}}$ (37)

Here is the Ricci tensor.

 > RicciTensor(g5);
 ${{ⅇ}}^{{2}{}{x}}{}{\mathrm{dz}}{}{\mathrm{dz}}{+}{{ⅇ}}^{{x}}{}{\mathrm{dz}}{}{\mathrm{dt}}{+}{{ⅇ}}^{{x}}{}{\mathrm{dt}}{}{\mathrm{dz}}{+}{\mathrm{dt}}{}{\mathrm{dt}}$ (38)

Here is the Ricci scalar.

 > RicciScalar(g5);
 ${-1}$ (39)

6. Working with Orthonormal Tetrads

Many calculations in General Relativity can be dramatically simplified by defining an orthonormal tetrad and by expressing the metric and all other tensors in terms of this orthonormal tetrad. This is particularly true when a co-frame can be chosen with simple structure equations.

A simple illustration of this is provided by the Godel metric from the previous example.

 > DGsetup([x, y, z, t], M6);
 ${\mathrm{frame name: M6}}$ (40)
 > omega := evalDG(dt + exp(x)*dz);
 ${\mathrm{\omega }}{≔}{{ⅇ}}^{{x}}{}{\mathrm{dz}}{+}{\mathrm{dt}}$ (41)
 > g6 := evalDG(dx &t dx + dy &t dy +1/2*exp(2*x)*dz &t dz - omega &t omega);
 ${\mathrm{g6}}{≔}{\mathrm{dx}}{}{\mathrm{dx}}{+}{\mathrm{dy}}{}{\mathrm{dy}}{-}\frac{{{ⅇ}}^{{2}{}{x}}{}{\mathrm{dz}}}{{2}}{}{\mathrm{dz}}{-}{{ⅇ}}^{{x}}{}{\mathrm{dz}}{}{\mathrm{dt}}{-}{{ⅇ}}^{{x}}{}{\mathrm{dt}}{}{\mathrm{dz}}{-}{\mathrm{dt}}{}{\mathrm{dt}}$ (42)
 > Omega := evalDG([dx, dy, 1/sqrt(2)*exp(x)*dz, omega]);
 ${\mathrm{\Omega }}{≔}\left[{\mathrm{dx}}{,}{\mathrm{dy}}{,}\frac{\sqrt{{2}}{}{{ⅇ}}^{{x}}{}{\mathrm{dz}}}{{2}}{,}{{ⅇ}}^{{x}}{}{\mathrm{dz}}{+}{\mathrm{dt}}\right]$ (43)

We use TensorInnerProduct to check that the forms in the list define an orthonormal tetrad.

 > TensorInnerProduct(g6, Omega, Omega);
 $\left[\begin{array}{cccc}{1}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {-1}\end{array}\right]$ (44)

The command FrameData calculates the structure equations for this frame and stores the results in a format that can be used by DGsetup.

 > FD := FrameData(Omega, O6);
 ${\mathrm{FD}}{≔}\left[{d}{}{\mathrm{Θ1}}{=}{0}{,}{d}{}{\mathrm{Θ2}}{=}{0}{,}{d}{}{\mathrm{Θ3}}{=}{\mathrm{Θ1}}{}{\bigwedge }{}{\mathrm{Θ3}}{,}{d}{}{\mathrm{Θ4}}{=}\sqrt{{2}}{}{\mathrm{Θ1}}{}{\bigwedge }{}{\mathrm{Θ3}}\right]$ (45)

What is nice about this co-frame is that the structure functions are all constant -- even though there was an exponential function in the metric.   We run DGsetup again to create a new computational environment which used this co-frame and these structure equations.

 > DGsetup(FD, [E], [theta]);
 ${\mathrm{frame name: O6}}$ (46)
 > newg6 := evalDG(theta1 &t theta1 + theta2 &t theta2 + theta3 &t theta3 - theta4 &t theta4);
 ${\mathrm{newg6}}{≔}{\mathrm{θ1}}{}{\mathrm{θ1}}{+}{\mathrm{θ2}}{}{\mathrm{θ2}}{+}{\mathrm{θ3}}{}{\mathrm{θ3}}{-}{\mathrm{θ4}}{}{\mathrm{θ4}}$ (47)

The curvature tensor and the Ricci tensor take simple forms in terms of this frame.

 > CurvatureTensor(newg6);
 $\frac{{\mathrm{E1}}}{{2}}{}{\mathrm{θ3}}{}{\mathrm{θ1}}{}{\mathrm{θ3}}{-}\frac{{\mathrm{E1}}}{{2}}{}{\mathrm{θ3}}{}{\mathrm{θ3}}{}{\mathrm{θ1}}{+}\frac{{\mathrm{E1}}}{{2}}{}{\mathrm{θ4}}{}{\mathrm{θ1}}{}{\mathrm{θ4}}{-}\frac{{\mathrm{E1}}}{{2}}{}{\mathrm{θ4}}{}{\mathrm{θ4}}{}{\mathrm{θ1}}{-}\frac{{\mathrm{E3}}}{{2}}{}{\mathrm{θ1}}{}{\mathrm{θ1}}{}{\mathrm{θ3}}{+}\frac{{\mathrm{E3}}}{{2}}{}{\mathrm{θ1}}{}{\mathrm{θ3}}{}{\mathrm{θ1}}{+}\frac{{\mathrm{E3}}}{{2}}{}{\mathrm{θ4}}{}{\mathrm{θ3}}{}{\mathrm{θ4}}{-}\frac{{\mathrm{E3}}}{{2}}{}{\mathrm{θ4}}{}{\mathrm{θ4}}{}{\mathrm{θ3}}{+}\frac{{\mathrm{E4}}}{{2}}{}{\mathrm{θ1}}{}{\mathrm{θ1}}{}{\mathrm{θ4}}{-}\frac{{\mathrm{E4}}}{{2}}{}{\mathrm{θ1}}{}{\mathrm{θ4}}{}{\mathrm{θ1}}{+}\frac{{\mathrm{E4}}}{{2}}{}{\mathrm{θ3}}{}{\mathrm{θ3}}{}{\mathrm{θ4}}{-}\frac{{\mathrm{E4}}}{{2}}{}{\mathrm{θ3}}{}{\mathrm{θ4}}{}{\mathrm{θ3}}$ (48)
 > RicciTensor(newg6);
 ${\mathrm{θ4}}{}{\mathrm{θ4}}$ (49)

7. Working with Null Tetrads and the Newman-Penrose Formalism

The DifferentialGeometry package supported computations in all the different formalisms for general relativity -- coordinate calculations, orthonormal tetrads, null tetrads and the Newman-Penrose formalism, and the two-component spinor formalism. The tools are readily available for moving from one formalism to another.

In this example we calculate the Newman-Penrose curvature scalars for a metric.

 > DGsetup([r, u, x, y], M7);
 ${\mathrm{frame name: M7}}$ (50)
 > g7 := evalDG(dr &t du + du &t dr -((2*(3*x*r+m))*du &t du)/r-(1/4)*(r^2*dx &t dx)/x^3-(1/4)*(r^2*dy &t dy)/x^3);
 ${\mathrm{g7}}{≔}{\mathrm{dr}}{}{\mathrm{du}}{+}{\mathrm{du}}{}{\mathrm{dr}}{-}\frac{{2}{}\left({3}{}{x}{}{r}{+}{m}\right){}{\mathrm{du}}}{{r}}{}{\mathrm{du}}{-}\frac{{{r}}^{{2}}{}{\mathrm{dx}}}{{4}{}{{x}}^{{3}}}{}{\mathrm{dx}}{-}\frac{{{r}}^{{2}}{}{\mathrm{dy}}}{{4}{}{{x}}^{{3}}}{}{\mathrm{dy}}$ (51)

The command DGGramSchmidt and NullTetrad provide useful tools for constructing null tetrads. Here is the one that we shall use for this example

 > NT := evalDG([D_r, (3*x*r+m)*D_r/r+D_u, I*sqrt(2)*x^(3/2)*D_x/r+sqrt(2)*x^(3/2)*D_y/r, -I*sqrt(2)*x^(3/2)*D_x/r+sqrt(2)*x^(3/2)*D_y/r]);
 ${\mathrm{NT}}{≔}\left[{\mathrm{D_r}}{,}\frac{\left({3}{}{x}{}{r}{+}{m}\right){}{\mathrm{D_r}}}{{r}}{+}{\mathrm{D_u}}{,}\frac{{I}{}\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{D_x}}}{{r}}{+}\frac{\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{D_y}}}{{r}}{,}{-}\frac{{I}{}\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{D_x}}}{{r}}{+}\frac{\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{D_y}}}{{r}}\right]$ (52)

Here are the Newman-Penrose curvature scalars for this null tetrad.

 > NP := NPCurvatureScalars(NT, output = ["WeylScalars"]);
 ${\mathrm{NP}}{≔}{table}{}\left(\left[{"Psi3"}{=}\frac{{-}{3}{}{I}{}\sqrt{{2}}{}{{x}}^{{3}}{{2}}}}{{{r}}^{{2}}}{,}{"Psi1"}{=}{0}{,}{"Psi0"}{=}{0}{,}{"Psi4"}{=}\frac{{18}{}{{x}}^{{2}}}{{{r}}^{{2}}}{,}{"Psi2"}{=}{-}\frac{{m}}{{{r}}^{{3}}}\right]\right)$ (53)

8. Two Component Spinor Formalism

As a quick illustration of the 2-component spinor formalism, we calculate the Weyl spinor for the metric from the previous paragraph. To work with spinors we use DGsetup to specify both the coordinates for the space-time and also the coordinates to be used for the spinors and their complex conjugates.

 > DGsetup([r, u, x, y], [z1, z2, w1, w2], M8);
 ${\mathrm{frame name: M8}}$ (54)

Here is metric as before.

 > g8 := evalDG(dr &t du + du &t dr -((2*(3*x*r+m))*du &t du)/r-(1/4)*(r^2*dx &t dx)/x^3-(1/4)*(r^2*dy &t dy)/x^3);
 ${\mathrm{g8}}{≔}{\mathrm{dr}}{}{\mathrm{du}}{+}{\mathrm{du}}{}{\mathrm{dr}}{-}\frac{{2}{}\left({3}{}{r}{}{x}{+}{m}\right){}{\mathrm{du}}}{{r}}{}{\mathrm{du}}{-}\frac{{{r}}^{{2}}{}{\mathrm{dx}}}{{4}{}{{x}}^{{3}}}{}{\mathrm{dx}}{-}\frac{{{r}}^{{2}}{}{\mathrm{dy}}}{{4}{}{{x}}^{{3}}}{}{\mathrm{dy}}$ (55)

Here is the null tetrad as before.

 > NT := evalDG([D_r, (3*x*r+m)*D_r/r+D_u, I*sqrt(2)*x^(3/2)*D_x/r+sqrt(2)*x^(3/2)*D_y/r, -I*sqrt(2)*x^(3/2)*D_x/r+sqrt(2)*x^(3/2)*D_y/r]);
 ${\mathrm{NT}}{≔}\left[{\mathrm{D_r}}{,}\frac{\left({3}{}{r}{}{x}{+}{m}\right){}{\mathrm{D_r}}}{{r}}{+}{\mathrm{D_u}}{,}\frac{{I}{}\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{D_x}}}{{r}}{+}\frac{\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{D_y}}}{{r}}{,}{-}\frac{{I}{}\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{D_x}}}{{r}}{+}\frac{\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{D_y}}}{{r}}\right]$ (56)

We use the null tetrad to construction an orthonormal tetrad.

 > OT := OrthonormalTetrad(NT);
 ${\mathrm{OT}}{≔}\left[\frac{\sqrt{{2}}{}\left({3}{}{r}{}{x}{+}{m}{+}{r}\right){}{\mathrm{D_r}}}{{2}{}{r}}{+}\frac{\sqrt{{2}}{}{\mathrm{D_u}}}{{2}}{,}\frac{{2}{}{{x}}^{{3}}{{2}}}{}{\mathrm{D_y}}}{{r}}{,}\frac{{2}{}{{x}}^{{3}}{{2}}}{}{\mathrm{D_x}}}{{r}}{,}{-}\frac{\sqrt{{2}}{}\left({3}{}{r}{}{x}{+}{m}{-}{r}\right){}{\mathrm{D_r}}}{{2}{}{r}}{-}\frac{\sqrt{{2}}{}{\mathrm{D_u}}}{{2}}\right]$ (57)

We use the orthonormal tetrad to define the solder form as a spin-tensor .

 > sigma := SolderForm(OT);
 ${\mathrm{\sigma }}{≔}{\mathrm{dr}}{}{\mathrm{D_z1}}{}{\mathrm{D_w1}}{-}\frac{\left({3}{}{r}{}{x}{+}{m}\right){}{\mathrm{du}}}{{r}}{}{\mathrm{D_z1}}{}{\mathrm{D_w1}}{+}{\mathrm{du}}{}{\mathrm{D_z2}}{}{\mathrm{D_w2}}{-}\frac{\frac{{I}}{{4}}{}{r}{}\sqrt{{2}}{}{\mathrm{dx}}}{{{x}}^{{3}}{{2}}}}{}{\mathrm{D_z1}}{}{\mathrm{D_w2}}{+}\frac{\frac{{I}}{{4}}{}{r}{}\sqrt{{2}}{}{\mathrm{dx}}}{{{x}}^{{3}}{{2}}}}{}{\mathrm{D_z2}}{}{\mathrm{D_w1}}{+}\frac{{r}{}\sqrt{{2}}{}{\mathrm{dy}}}{{4}{}{{x}}^{{3}}{{2}}}}{}{\mathrm{D_z1}}{}{\mathrm{D_w2}}{+}\frac{{r}{}\sqrt{{2}}{}{\mathrm{dy}}}{{4}{}{{x}}^{{3}}{{2}}}}{}{\mathrm{D_z2}}{}{\mathrm{D_w1}}$ (58)

Here is the null vector as a 2-component spinor.

 > convert(D_r, DGspinor, sigma, [1]);
 ${\mathrm{D_z1}}{}{\mathrm{D_w1}}$ (59)

We use SpinorInnerProduct to check that the contracted product re-produces the metric.

 > SpinorInnerProduct(sigma, sigma);
 ${\mathrm{dr}}{}{\mathrm{du}}{+}{\mathrm{du}}{}{\mathrm{dr}}{-}\frac{{2}{}\left({3}{}{r}{}{x}{+}{m}\right){}{\mathrm{du}}}{{r}}{}{\mathrm{du}}{-}\frac{{{r}}^{{2}}{}{\mathrm{dx}}}{{4}{}{{x}}^{{3}}}{}{\mathrm{dx}}{-}\frac{{{r}}^{{2}}{}{\mathrm{dy}}}{{4}{}{{x}}^{{3}}}{}{\mathrm{dy}}$ (60)

Here is the Weyl spinor.

 > WeylSpinor(sigma);
 $\frac{{m}{}{\mathrm{dz1}}}{{{r}}^{{3}}}{}{\mathrm{dz1}}{}{\mathrm{dz2}}{}{\mathrm{dz2}}{+}\frac{{m}{}{\mathrm{dz1}}}{{{r}}^{{3}}}{}{\mathrm{dz2}}{}{\mathrm{dz1}}{}{\mathrm{dz2}}{+}\frac{{m}{}{\mathrm{dz1}}}{{{r}}^{{3}}}{}{\mathrm{dz2}}{}{\mathrm{dz2}}{}{\mathrm{dz1}}{+}\frac{{3}{}{I}{}\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{dz1}}}{{{r}}^{{2}}}{}{\mathrm{dz2}}{}{\mathrm{dz2}}{}{\mathrm{dz2}}{+}\frac{{m}{}{\mathrm{dz2}}}{{{r}}^{{3}}}{}{\mathrm{dz1}}{}{\mathrm{dz1}}{}{\mathrm{dz2}}{+}\frac{{m}{}{\mathrm{dz2}}}{{{r}}^{{3}}}{}{\mathrm{dz1}}{}{\mathrm{dz2}}{}{\mathrm{dz1}}{+}\frac{{3}{}{I}{}\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{dz2}}}{{{r}}^{{2}}}{}{\mathrm{dz1}}{}{\mathrm{dz2}}{}{\mathrm{dz2}}{+}\frac{{m}{}{\mathrm{dz2}}}{{{r}}^{{3}}}{}{\mathrm{dz2}}{}{\mathrm{dz1}}{}{\mathrm{dz1}}{+}\frac{{3}{}{I}{}\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{dz2}}}{{{r}}^{{2}}}{}{\mathrm{dz2}}{}{\mathrm{dz1}}{}{\mathrm{dz2}}{+}\frac{{3}{}{I}{}\sqrt{{2}}{}{{x}}^{{3}}{{2}}}{}{\mathrm{dz2}}}{{{r}}^{{2}}}{}{\mathrm{dz2}}{}{\mathrm{dz2}}{}{\mathrm{dz1}}{-}\frac{{18}{}{{x}}^{{2}}{}{\mathrm{dz2}}}{{{r}}^{{2}}}{}{\mathrm{dz2}}{}{\mathrm{dz2}}{}{\mathrm{dz2}}$ (61)

9. Congruences

Line congruences (especially null congruences) play an important role in the geometric analysis of space-times. We continue with the metric from the previous example. We show that the congruence defined by D_ris defines a shear-free principal null direction.

 > U := D_r;
 ${U}{≔}{\mathrm{D_r}}$ (62)
 > V := evalDG((3*x*r+m)*D_r/r+D_u);
 ${V}{≔}\frac{\left({3}{}{r}{}{x}{+}{m}\right){}{\mathrm{D_r}}}{{r}}{+}{\mathrm{D_u}}$ (63)
 > W := WeylTensor(g8):
 > GRQuery(U, g8, W, "PrincipalNullDirection");
 ${\mathrm{true}}$ (64)

Here are the properties of the null congruence defined by $U$.

 > CongruenceProperties(g8, U, V);
 ${table}{}\left(\left[{"RotationScalar"}{=}{0}{,}{"RotationNormSquared"}{=}{0}{,}{"Raychaudhuri"}{=}{0}{,}{"RotationTensor"}{=}{0}{}{\mathrm{dr}}{}{\mathrm{dr}}{,}{"ShearNormSquared"}{=}{0}{,}{"Expansion"}{=}\frac{{2}}{{r}}{,}{"ShearTensor"}{=}{0}{}{\mathrm{dr}}{}{\mathrm{dr}}\right]\right)$ (65)

10. Electro-Vac Spacetimes

A space-time is called an electro-vac space-time if there exists an electromagnetic field which solves the Einstein-Maxwell field equations. The problem of deciding if a space-time is electro-vac can be solved using the command RainichConditions and RainichElectromagneticField. Here is a simple example.

 > DGsetup([t, x, y, z], M10);
 ${\mathrm{frame name: M10}}$ (66)
 > g10 := evalDG(4/3*t^2* dx &t dx + t*(exp(-2*x)* dy &t dy + exp(2*x)*dz &t dz) - dt &t dt);
 ${\mathrm{g10}}{≔}{-}{\mathrm{dt}}{}{\mathrm{dt}}{+}\frac{{4}{}{{t}}^{{2}}{}{\mathrm{dx}}}{{3}}{}{\mathrm{dx}}{+}{t}{}{{ⅇ}}^{{-}{2}{}{x}}{}{\mathrm{dy}}{}{\mathrm{dy}}{+}{t}{}{{ⅇ}}^{{2}{}{x}}{}{\mathrm{dz}}{}{\mathrm{dz}}$ (67)

Test to see if the Rainich conditions for a spacetime hold.

 > RainichConditions(g10);
 ${\mathrm{true}}$ (68)

We conclude the space-time is an electro-vac spacetime. Here is the electro-magnetic field.

 > F := RainichElectromagneticField(g10);
 ${F}{≔}\frac{{2}{}{\mathrm{cos}}{}\left(\mathrm{c__1}\right){}\left({1}{+}{\mathrm{csgn}}{}\left(\frac{{1}}{{{t}}^{{2}}}\right)\right){}{\mathrm{dt}}}{\sqrt{{6}{}{\mathrm{csgn}}{}\left(\frac{{1}}{{{t}}^{{2}}}\right){+}{6}}}{}{\bigwedge }{}{\mathrm{dx}}{+}\frac{{\mathrm{sin}}{}\left(\mathrm{c__1}\right){}\left({1}{+}{\mathrm{csgn}}{}\left(\frac{{1}}{{{t}}^{{2}}}\right)\right){}{\mathrm{csgn}}{}\left(\frac{{1}}{{{t}}^{{2}}}\right){}{\mathrm{dy}}}{\sqrt{{2}{}{\mathrm{csgn}}{}\left(\frac{{1}}{{{t}}^{{2}}}\right){+}{2}}}{}{\bigwedge }{}{\mathrm{dz}}$ (69)
 > F := simplify(F) assuming t > 0;
 ${F}{≔}\frac{{2}{}{\mathrm{cos}}{}\left(\mathrm{c__1}\right){}\sqrt{{3}}{}{\mathrm{dt}}}{{3}}{}{\bigwedge }{}{\mathrm{dx}}{+}{\mathrm{sin}}{}\left(\mathrm{c__1}\right){}{\mathrm{dy}}{}{\bigwedge }{}{\mathrm{dz}}$ (70)

We check that the Einstein equations are satisfied (See EinsteinTensor, EnergyMomentumTensor).

 > T := EnergyMomentumTensor("Electromagnetic", g10, F); E := EinsteinTensor(g10); E &minus T;
 ${T}{≔}\frac{{\mathrm{D_t}}}{{2}{}{{t}}^{{2}}}{}{\mathrm{D_t}}{-}\frac{{3}{}{\mathrm{D_x}}}{{8}{}{{t}}^{{4}}}{}{\mathrm{D_x}}{+}\frac{{{ⅇ}}^{{2}{}{x}}{}{\mathrm{D_y}}}{{2}{}{{t}}^{{3}}}{}{\mathrm{D_y}}{+}\frac{{{ⅇ}}^{{-}{2}{}{x}}{}{\mathrm{D_z}}}{{2}{}{{t}}^{{3}}}{}{\mathrm{D_z}}$
 ${E}{≔}\frac{{\mathrm{D_t}}}{{2}{}{{t}}^{{2}}}{}{\mathrm{D_t}}{-}\frac{{3}{}{\mathrm{D_x}}}{{8}{}{{t}}^{{4}}}{}{\mathrm{D_x}}{+}\frac{{{ⅇ}}^{{2}{}{x}}{}{\mathrm{D_y}}}{{2}{}{{t}}^{{3}}}{}{\mathrm{D_y}}{+}\frac{{{ⅇ}}^{{-}{2}{}{x}}{}{\mathrm{D_z}}}{{2}{}{{t}}^{{3}}}{}{\mathrm{D_z}}$
 ${0}{}{\mathrm{D_t}}{}{\mathrm{D_t}}$ (71)

We check that the Maxwell equations (see MatterFieldEquations) are satisfied.

 > MatterFieldEquations("Electromagnetic", g10, F);
 ${0}{}{\mathrm{D_t}}{,}{0}{}{\mathrm{dt}}{}{\bigwedge }{}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dy}}$ (72)

 11. Exact Solution Database An database of exact solutions of the Einstein equations can be accessed using either the Browse and or the MetricSearch commands from the DifferentialGeometry Library subpackage.

12. Other Features

 • Transformation between space-times can be constructed. See Transformation, Pullback, Pushforward
 • The Segre classification of space-time can be calculated.
 • The KillingVector and PetrovType commands support case-splitting for metrics which depend upon arbitrary parameters or functions.
 • Killing tensors, Killing-Yano tensors, Killing spinors and recurrent tensors can all be calculated.
 • The LieAlgebras package provides all the tools needed for a complete algebraic analysis of the Killing vectors of a space-time.
 • The isotropy subalgebra and isotropy type of a Lie algebra of Killing vectors can be determined. These are useful properties for classifying Killing vectors.
 • Invariant metrics for any Lie algebra of vector fields can be easily computed using the command InvariantGeometricObjectFields in the GroupActions package.
 • Residual diffeomorphism groups for reductions of space-times can be calculated with the command InfinitisimalPseudoGroupNormalizer
 • Future releases of DifferentialGeometry will include commands for working with the Einstein-Yang-Mills equations and for abstractly solving the Einstein equations on homogeneous spaces and low cohomogeneity manifolds.

 See Also