 perform summation over the repeated indices of a tensorial expression - Maple Programming Help

Physics[SumOverRepeatedIndices] - perform summation over the repeated indices of a tensorial expression

 Calling Sequence SumOverRepeatedIndices(expression, alpha, beta, ...)

Parameters

 expression - any algebraic tensorial expression having spacetime repeated indices implying summation alpha, beta, ... - optional, the repeated indices to be summed, if not given, all the spacetime repeated indices of expression are summed simplifier = ... - optional - indicates the simplifier to be used instead; default is none

Description

 • The SumOverRepeatedIndices performs the summation over the repeated indices of expression implied when using the Einstein summation convention. The summation takes into account the covariant and contravariant character of each contracted index.
 • The summation is performed from 1 to the dimension of spacetime, and optionally you indicate the indices (not their range) over which the summation is to be performed. The summation indices are indicated in sequence after expression. If no indices are indicated then summation is performed over all the repeated indices of expression.
 • To check and determine the free and repeated indices of an expression use Check.
 • By default, the summation is performed without simplifying the result; to have the result simplified before returning, indicate the simplifier on the right-hand-side of the optional argument simplifier = ...

Examples

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

Consider the complete contraction of indices between the Riemann tensor and its dual $\mathrm{R2}$ in a Schwarzschild spacetime in spherical coordinates

${\left(\stackrel{*}{R}\right)}_{\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }}=\frac{1}{2}{\mathrm{Ε}}_{\mathrm{\mu },\mathrm{\nu },\mathrm{\rho },\mathrm{\sigma }}{R}_{\mathrm{\alpha },\mathrm{\beta }}^{\mathrm{\rho },\mathrm{\sigma }}$

For that purpose, set first the metric and the coordinates -you can use Setup for that, or because the Schwarzschild metric is known to the system you can directly pass the keyword or an abbreviation of it to the metric g_ to do all in one step

 > g_[sc];
 ${}{}\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{_______________________________________________________}$
 ${{\mathrm{g_}}}_{{\mathrm{μ}}{,}{\mathrm{ν}}}{=}\left(\left[\begin{array}{cccc}\frac{r}{-r+2{}m}& 0& 0& 0\\ 0& -{r}^{2}& 0& 0\\ 0& 0& -{r}^{2}{}{\mathrm{sin}{}\left(\mathrm{θ}\right)}^{2}& 0\\ 0& 0& 0& \frac{r-2{}m}{r}\end{array}\right]\right)$ (2)

Enter the dual of the Riemann tensor

 > R2 := 1/2*LeviCivita[alpha,beta,rho,sigma]*Riemann[~rho,~sigma,mu,nu];
 ${\mathrm{R2}}{≔}\frac{{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{}{{R}}_{\phantom{{}}\phantom{{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}^{\phantom{{}}{\mathrm{\rho }}{,}{\mathrm{\sigma }}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}}{{2}}$ (3)

Multiply both

 > R2 * Riemann[~alpha,~beta,~mu,~nu];
 $\frac{{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{}{{R}}_{\phantom{{}}\phantom{{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}^{\phantom{{}}{\mathrm{\rho }}{,}{\mathrm{\sigma }}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}{}{{R}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}\phantom{{,}}\phantom{{\mathrm{\beta }}}\phantom{{,}}\phantom{{\mathrm{\mu }}}\phantom{{,}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}}{{2}}$ (4)

Check the indices

 > Check((4), all);
 $\mathrm{The repeated indices per term are:}{}\left[\left\{\mathrm{...}\right\}{,}\left\{\mathrm{...}\right\}{,}\mathrm{...}\right]{}\mathrm{, the free indices are:}{}\left\{\mathrm{...}\right\}$
 $\left[\left\{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}\right\}\right]{,}{\varnothing }$ (5)

Perform the summation over these 6 indices

 > SumOverRepeatedIndices((4));
 ${0}$ (6)

So (4) is zero; this term enters the computation of the 1st of the Riemann scalars, ${S}_{1}=\frac{1}{48}\left({R}_{\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }}{R}^{\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }}-i{R}_{\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }}{\left(\stackrel{*}{R}\right)}^{\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }}\right)$

and ${S}_{2}=\frac{1}{96}\left({R}_{\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }}{R}_{}^{\mathrm{\alpha },\mathrm{\beta },\mathrm{\rho },\mathrm{\sigma }}{R}_{\mathrm{\rho },\mathrm{\sigma }}^{\mathrm{\mu },\mathrm{\nu }}+i{R}_{\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }}{R}_{}^{\mathrm{\alpha },\mathrm{\beta },\mathrm{\rho },\mathrm{\sigma }}{\left(\stackrel{*}{R}\right)}_{\mathrm{\rho },\mathrm{\sigma }}^{\mathrm{\mu },\mathrm{\nu }}\right)$

 > Riemann[scalars];
 ${{S}}_{{1}}{=}\frac{{{m}}^{{2}}}{{{r}}^{{6}}}{,}{{S}}_{{2}}{=}{-}\frac{{{m}}^{{3}}}{{{r}}^{{9}}}$ (7)

and actually for both scalars only the first term in these formulas is different from zero:

 > Riemann[alpha, beta, mu, nu] * Riemann[~alpha, ~beta, ~mu, ~nu];
 ${{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{R}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}\phantom{{,}}\phantom{{\mathrm{\beta }}}\phantom{{,}}\phantom{{\mathrm{\mu }}}\phantom{{,}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (8)
 > SumOverRepeatedIndices((8));
 $\frac{{48}{}{{m}}^{{2}}}{{{r}}^{{6}}}$ (9)
 > Riemann[alpha,beta,mu,nu] * Riemann[~alpha,~beta,~rho,~sigma] * Riemann[rho,sigma,~mu,~nu];
 ${{R}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{R}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}\phantom{{,}}\phantom{{\mathrm{\beta }}}\phantom{{,}}\phantom{{\mathrm{\rho }}}\phantom{{,}}\phantom{{\mathrm{\sigma }}}}^{\phantom{{}}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\rho }}{,}{\mathrm{\sigma }}}{}{{R}}_{{\mathrm{\rho }}{,}{\mathrm{\sigma }}\phantom{{\mathrm{\mu }}{,}{\mathrm{\nu }}}}^{\phantom{{\mathrm{\rho }}}\phantom{{,}{\mathrm{\sigma }}}{\mathrm{\mu }}{,}{\mathrm{\nu }}}$ (10)
 > SumOverRepeatedIndices((10));
 ${-}\frac{{96}{}{{m}}^{{3}}}{{{r}}^{{9}}}$ (11)
 >

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[SumOverRepeatedIndices] command was introduced in Maple 16.