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

Tensor[EinsteinTensor] - calculate the Einstein tensor for a metric

Calling Sequences

EinsteinTensor(g, R)

Parameters

g    - a metric tensor

R    - (optional) the curvature tensor of the metric g

Description

 • Let $\mathrm{Ric}\left(g\right)$ and $S\left(g\right)$ be the Ricci tensor and Ricci scalar for the metric $g$, respectively. The covariant form of the Einstein tensor is . The contravariant form is obtained by raising both indices of the covariant Einstein tensor with the metric $g$. In terms of components,

${G}^{\mathrm{ab}}={R}^{\mathrm{ab}}-\frac{1}{2}{\mathrm{Sg}}^{\mathrm{ab}}$.

 • The program EinsteinTensor(g, R) returns the contravariant form of the Einstein tensor. This tensor is symmetric and its covariant divergence vanishes.
 • This command is part of the DifferentialGeometry:-Tensor package, and so can be used in the form EinsteinTensor(...) only after executing the command with(DifferentialGeometry) and with(Tensor) in that order. It can always be used in the long form DifferentialGeometry:-Tensor:-EinsteinTensor.

Examples

 > $\mathrm{with}\left(\mathrm{DifferentialGeometry}\right):$$\mathrm{with}\left(\mathrm{Tensor}\right):$

Example 1.

Create a 4 dimensional manifold $M$, define a metric $\mathrm{g1}$, and calculate the Einstein tensor $\mathrm{E1}$.

 > $\mathrm{DGsetup}\left(\left[x,y,z,w\right],\mathrm{M1}\right)$
 ${\mathrm{frame name: M1}}$ (2.1)
 M1 > $\mathrm{g1}≔\mathrm{evalDG}\left(\mathrm{dx}&t\mathrm{dx}+\mathrm{dx}&t\mathrm{dy}+\mathrm{dy}&t\mathrm{dx}+xy\left(\mathrm{dz}&t\mathrm{dw}+\mathrm{dw}&t\mathrm{dz}\right)\right)$
 ${\mathrm{g1}}{:=}{\mathrm{dx}}{}{\mathrm{dx}}{+}{\mathrm{dx}}{}{\mathrm{dy}}{+}{\mathrm{dy}}{}{\mathrm{dx}}{+}{x}{}{y}{}{\mathrm{dz}}{}{\mathrm{dw}}{+}{x}{}{y}{}{\mathrm{dw}}{}{\mathrm{dz}}$ (2.2)

Calculate the Christoffel symbols for the metric $\mathrm{g1}$.

 M1 > $\mathrm{C1}≔\mathrm{Christoffel}\left(\mathrm{g1}\right):$

Calculate the Einstein tensor for the metric $\mathrm{g1}$.

 M1 > $\mathrm{E1}≔\mathrm{EinsteinTensor}\left(\mathrm{g1}\right)$
 ${\mathrm{E1}}{:=}\frac{{1}}{{2}}{}\frac{{\mathrm{D_x}}{}{\mathrm{D_x}}}{{{y}}^{{2}}}{-}\frac{{1}}{{4}}{}\frac{\left({-}{4}{}{y}{+}{x}\right){}{\mathrm{D_x}}{}{\mathrm{D_y}}}{{{y}}^{{2}}{}{x}}{-}\frac{{1}}{{4}}{}\frac{\left({-}{4}{}{y}{+}{x}\right){}{\mathrm{D_y}}{}{\mathrm{D_x}}}{{{y}}^{{2}}{}{x}}{+}\frac{{1}}{{4}}{}\frac{\left({-}{2}{}{x}{}{y}{+}{{x}}^{{2}}{+}{2}{}{{y}}^{{2}}\right){}{\mathrm{D_y}}{}{\mathrm{D_y}}}{{{x}}^{{2}}{}{{y}}^{{2}}}{+}\frac{{1}}{{4}}{}\frac{\left({2}{}{y}{+}{x}\right){}{\mathrm{D_z}}{}{\mathrm{D_w}}}{{{y}}^{{3}}{}{{x}}^{{2}}}{+}\frac{{1}}{{4}}{}\frac{\left({2}{}{y}{+}{x}\right){}{\mathrm{D_w}}{}{\mathrm{D_z}}}{{{y}}^{{3}}{}{{x}}^{{2}}}$ (2.3)

Check that the covariant divergence of the Einstein tensor $\mathrm{E1}$ vanishes.

 M1 > $\mathrm{ContractIndices}\left(\mathrm{CovariantDerivative}\left(\mathrm{E1},\mathrm{C1}\right),\left[\left[2,3\right]\right]\right)$
 ${0}{}{\mathrm{D_x}}$ (2.4)