indexed covariant/contravariant differential operator with respect to curvilinear spacetime coordinates - Maple Programming Help

Physics[D_] - indexed covariant/contravariant differential operator with respect to curvilinear spacetime coordinates

 Calling Sequence D_[mu](A) D_[mu](A, [X]) D_(A) D_(A, [X])

Parameters

 mu - a name representing an integer number between 0 and the spacetime dimension, can also be the number itself A - any mathematical expression or relation between expressions, or a set or list of them, or an rtable [X] - a list of differentiation variables to which the index mu refers

Description

 • The D_[mu] command is a computational representation for ${𝒟}_{\mathrm{\mu }}$, the covariant differential operator, a tensor, the generalization of ${\partial }_{\mathrm{\mu }}$ to curvilinear coordinates.
 • D_ can also be used without an index, as in D_(A) displayed as $𝒟\left(A\right)$, in which case it represents the total differential in curvilinear coordinates, and the output comes automatically expanded as D_[mu](A) * d_(X[~mu]), where X is a coordinates system and X[~mu] is the corresponding spacetime vector.
 • The covariant D_[mu] = ${𝒟}_{\mathrm{\mu }}$ is defined in terms of the Christoffel symbols as

${𝒟}_{\mu }\left({A}_{\nu }\right)={\partial }_{\mu }\left({A}_{\nu }\right)-{\Gamma }_{\mu ,\nu }^{\alpha }{A}_{\alpha }$

 when acting on a covariant tensor as ${A}_{\mathrm{\nu }}$, and as

${𝒟}_{\mu }\left({A}_{}^{\nu }\right)={\partial }_{\mu }\left({A}_{}^{\nu }\right)+{\Gamma }_{\alpha ,\mu }^{\nu }{A}_{}^{\alpha }$

 when acting on a contravariant tensor. For tensors of higher rank, for each covariant index there is one negative Christoffel term as in the formula for ${A}_{\mathrm{\nu }}$ and for each contravariant index there is one positive Christoffel term as in the formula for ${A}^{\nu }$.
 • To express ${𝒟}_{\mu }\left({A}_{\nu }\right)$ using this definition in terms of Christoffel symbols use convert to d_ or expand which also know about other identities for ${𝒟}_{\mathrm{\mu }}$
 • The contravariant ${g}_{}^{\mu ,\nu }{𝒟}_{\nu }={𝒟}_{}^{\mu }$ is entered as D_[~mu], so using the same D_ just with a contravariant index.
 • 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 only one argument is given to D_ or D_[mu], say as in D_[mu](A), the differentiation variables are the default ones, as indicated by Setup(differentiationvariables). Note you can set various coordinate systems and choose which one is to be considered the differentiation variables for D_ using Setup.
 • You can also override the default differentiation variables by passing two arguments to D_ or D_[mu], in which case the second argument is expected to be a list with the differentiation variables, as in D_[mu](A, [x1, x2, ...]), and so this list should have as many symbols as the dimension of spacetime, which by default is 4 but can be set to any value with the Setup command.
 • Some automatic checking and simplifications are carried out each time an operation such as D_[mu](A) is executed. The checking is concerned with possible syntax errors. Regarding the automatic simplifications, a summary is as follows:
 – If $A$ does not depend on the differentiation variables or is equal to the metric g_, then 0 is returned.
 – If $A$ is a scalar then d_[mu](A) is returned.
 – If $A$ belongs to the differentiation variables, then the definition of D_[mu](A) is applied and the resulting value returned.
 – If $A$ is a sum, product, power, or known function, then the differentiation is distributed accordingly, the same way it is done by d_.
 • A number of additional identities for covariant derivatives are returned when using expand.
 • To perform the differentiation, the D_ command makes us of the diff command of the Physics package, which in turn uses the standard Maple diff command, so that any user-defined differentiation rule, such as for a function foo, of the form diff/foo, is automatically taken into account by D_.
 • The %D_ command is the inert form of D_, so it represents the same mathematical operation but without performing it. To perform the operation, use value.

Examples

 > $\mathrm{with}\left(\mathrm{Physics}\right):$
 > $\mathrm{Setup}\left(\mathrm{mathematicalnotation}=\mathrm{true}\right)$
 $\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

 > $\mathrm{Setup}\left(\mathrm{coordinatesystems}=\mathrm{cartesian}\right)$
 ${\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 g_ with no indices

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

For illustration purposes Define an arbitrary spacetime tensor  $A$

 > $\mathrm{Define}\left(A\right)$
 ${\mathrm{Defined objects with tensor properties}}$
 $\left\{{A}{,}{{\mathrm{\gamma }}}_{{\mathrm{\mu }}}{,}{{\mathrm{\sigma }}}_{{\mathrm{\mu }}}{,}{{X}}_{{\mathrm{\mu }}}{,}{{\partial }}_{{\mathrm{\mu }}}{,}{{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\delta }}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{,}{{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}\right\}$ (4)

Check the nonzero components of Christoffel: if, as in the Minkowski case, there are none, then ${𝒟}_{\mathrm{\mu }}={\partial }_{\mathrm{\mu }}$

 > ${\mathrm{Christoffel}}_{\mathrm{nonzero}}$
 ${{\mathrm{\Gamma }}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}{,}{\mathrm{\alpha }}}{=}\left\{\right\}$ (5)
 > $\mathrm{D_}\left({X}_{\mathrm{~nu}}\right)$
 ${\partial }{}\left({{X}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}\right)$ (6)
 > $\mathrm{D_}[\mathrm{μ}]\left(A[\mathrm{~nu}]\left(X\right)\right)$
 ${{\partial }}_{{\mathrm{\mu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{}\left({X}\right)\right)$ (7)

To set the scenario as an arbitrary non-galilean spacetime set the metric to be arbitrary, that is, depending on 10 arbitrary functions of the spacetime coordinates $x,y,z,t$

 > $\mathrm{Setup}\left(\mathrm{metric}=\mathrm{arbitrary}\right)$
 $\left[{\mathrm{metric}}{=}\left\{\left({1}{,}{1}\right){=}{\mathrm{_F1}}{}\left({X}\right){,}\left({1}{,}{2}\right){=}{\mathrm{_F2}}{}\left({X}\right){,}\left({1}{,}{3}\right){=}{\mathrm{_F3}}{}\left({X}\right){,}\left({1}{,}{4}\right){=}{\mathrm{_F4}}{}\left({X}\right){,}\left({2}{,}{2}\right){=}{\mathrm{_F5}}{}\left({X}\right){,}\left({2}{,}{3}\right){=}{\mathrm{_F6}}{}\left({X}\right){,}\left({2}{,}{4}\right){=}{\mathrm{_F7}}{}\left({X}\right){,}\left({3}{,}{3}\right){=}{\mathrm{_F8}}{}\left({X}\right){,}\left({3}{,}{4}\right){=}{\mathrm{_F9}}{}\left({X}\right){,}\left({4}{,}{4}\right){=}{\mathrm{_F10}}{}\left({X}\right)\right\}\right]$ (8)
 > ${\mathrm{g_}}_{[]}$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left[\begin{array}{cccc}{\mathrm{_F1}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F2}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F3}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F4}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)\\ {\mathrm{_F2}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F5}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F6}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F7}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)\\ {\mathrm{_F3}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F6}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F8}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F9}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)\\ {\mathrm{_F4}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F7}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F9}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)& {\mathrm{_F10}}{}\left({x}{,}{y}{,}{z}{,}{t}\right)\end{array}\right]$ (9)

Related to displaying the components of Christoffel, it is convenient to have a compact display of the 10 arbitrary functions entering the metric as well as of their derivatives; for that purpose use the enhanced display scheme of the differential equation packages.

 > $\mathrm{PDEtools}:-\mathrm{declare}\left(\right)$
 ${\mathrm{_F1}}{}\left({x}{,}{y}{,}{z}{,}{t}\right){}{\mathrm{will now be displayed as}}{}{\mathrm{_F1}}$
 ${\mathrm{_F10}}{}\left({x}{,}{y}{,}{z}{,}{t}\right){}{\mathrm{will now be displayed as}}{}{\mathrm{_F10}}$
 ${\mathrm{_F2}}{}\left({x}{,}{y}{,}{z}{,}{t}\right){}{\mathrm{will now be displayed as}}{}{\mathrm{_F2}}$
 ${\mathrm{_F3}}{}\left({x}{,}{y}{,}{z}{,}{t}\right){}{\mathrm{will now be displayed as}}{}{\mathrm{_F3}}$
 ${\mathrm{_F4}}{}\left({x}{,}{y}{,}{z}{,}{t}\right){}{\mathrm{will now be displayed as}}{}{\mathrm{_F4}}$
 ${\mathrm{_F5}}{}\left({x}{,}{y}{,}{z}{,}{t}\right){}{\mathrm{will now be displayed as}}{}{\mathrm{_F5}}$
 ${\mathrm{_F6}}{}\left({x}{,}{y}{,}{z}{,}{t}\right){}{\mathrm{will now be displayed as}}{}{\mathrm{_F6}}$
 ${\mathrm{_F7}}{}\left({x}{,}{y}{,}{z}{,}{t}\right){}{\mathrm{will now be displayed as}}{}{\mathrm{_F7}}$
 ${\mathrm{_F8}}{}\left({x}{,}{y}{,}{z}{,}{t}\right){}{\mathrm{will now be displayed as}}{}{\mathrm{_F8}}$
 ${\mathrm{_F9}}{}\left({x}{,}{y}{,}{z}{,}{t}\right){}{\mathrm{will now be displayed as}}{}{\mathrm{_F9}}$ (10)

So from herein, in the display of expressions, derivatives are displayed as indexed and the functionality of the arbitrary functions is suppressed.

Check the value of ${\mathrm{\Gamma }}_{\mathrm{\alpha ,\mu ,\nu }}$ for $\mathrm{\alpha }$ = $\mathrm{\mu }$ = $\mathrm{\nu }$ = 1

 > ${\mathrm{Christoffel}}_{1,1,1}$
 $\frac{{{\mathrm{_F1}}}_{{x}}}{{2}}$ (11)

So now, for the total differential and the covariant derivative, we have

 > $\mathrm{D_}\left(A[\mathrm{~nu}]\left(X\right)\right)$
 $\left({{𝒟}}_{{\mathrm{\mu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{}\left({X}\right)\right)\right){}\left({\partial }{}\left({{X}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}\right)\right)$ (12)
 > $\mathrm{D_}[\mathrm{μ}]\left(A[\mathrm{~nu}]\left(X\right)\right)$
 ${{𝒟}}_{{\mathrm{\mu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{}\left({X}\right)\right)$ (13)

To express these results using the definition in terms of Christoffel symbols use expand or convert to d_

 > $\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 }}}\phantom{{,}}\phantom{{\mathrm{\mu }}}}{}{{A}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}}^{\phantom{{}}{\mathrm{\alpha }}}{}\left({X}\right)$ (14)

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

 > $\mathrm{%D_}[\mathrm{μ}]\left({\mathrm{g_}}_{\mathrm{α},\mathrm{β}}\right)$
 ${{𝒟}}_{{\mathrm{\mu }}}{}\left({{g}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}\right)$ (15)
 > $\mathrm{value}\left(\right)$
 ${0}$ (16)

The covariant derivative of a scalar is always equal to the $\partial$ derivative

 > $\mathrm{D_}[\mathrm{μ}]\left(\mathrm{Φ}\left(X\right)\right)$
 ${{\partial }}_{{\mathrm{\mu }}}{}\left({\mathrm{\Phi }}{}\left({X}\right)\right)$ (17)
 > $\mathrm{D_}\left(\mathrm{Φ}\left(X\right)\right)$
 $\left({{\partial }}_{{\mathrm{\mu }}}{}\left({\mathrm{\Phi }}{}\left({X}\right)\right)\right){}\left({\partial }{}\left({{X}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}\right)\right)$ (18)

To reduce the amount of input notation, a scalar constructed with contracted indices in tensors can be entered with all contracted indices covariant, or as a power in the case of a contracted product of a tensor with itself. For example, use ${A}_{\mu }{A}_{}^{\mu }={A}_{\mu }^{2}$

 > ${A}_{\mathrm{μ}}^{2}$
 ${{A}}_{{\mathrm{\mu }}}{}{{A}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}$ (19)
 > $\mathrm{D_}[\mathrm{ν}]\left({A[\mathrm{μ}]\left(X\right)}^{2}\right)$
 $\left({{\partial }}_{{\mathrm{\nu }}}{}\left({{A}}_{{\mathrm{\mu }}}{}\left({X}\right)\right)\right){}{{A}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}\left({X}\right){+}{{A}}_{{\mathrm{\mu }}}{}\left({X}\right){}\left({{\partial }}_{{\mathrm{\nu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}\left({X}\right)\right)\right)$ (20)

and as expected in the case of scalars, in the above you see no Christoffel symbols.

Set the spacetime metric g_ by giving the square of the spacetime interval

 > $\mathrm{ds2}≔{x}^{2}{\mathrm{dx}}^{2}+{y}^{2}{\mathrm{dy}}^{2}+{z}^{2}{\mathrm{dz}}^{2}+xy\mathrm{dx}\mathrm{dy}-{\mathrm{dt}}^{2}$
 ${\mathrm{ds2}}{≔}{{x}}^{{2}}{}{{\mathrm{dx}}}^{{2}}{+}{x}{}{y}{}{\mathrm{dx}}{}{\mathrm{dy}}{+}{{y}}^{{2}}{}{{\mathrm{dy}}}^{{2}}{+}{{z}}^{{2}}{}{{\mathrm{dz}}}^{{2}}{-}{{\mathrm{dt}}}^{{2}}$ (21)
 > $\mathrm{Setup}\left(\mathrm{metric}=\mathrm{ds2}\right)$
 $\left[{\mathrm{metric}}{=}\left\{\left({1}{,}{1}\right){=}{{x}}^{{2}}{,}\left({1}{,}{2}\right){=}\frac{{x}{}{y}}{{2}}{,}\left({2}{,}{2}\right){=}{{y}}^{{2}}{,}\left({3}{,}{3}\right){=}{{z}}^{{2}}{,}\left({4}{,}{4}\right){=}{-1}\right\}\right]$ (22)

The generalized divergence of a vector in curvilinear coordinates

 > $\mathrm{D_}[\mathrm{μ}]\left(A[\mathrm{~mu}]\left(X\right)\right)$
 ${{𝒟}}_{{\mathrm{\mu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}\left({X}\right)\right)$ (23)
 > $\mathrm{expand}\left(\right)$
 $\frac{{{A}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}\left({X}\right){}\left({{\partial }}_{{\mathrm{\mu }}}{}\left({x}\right)\right)}{{x}}{+}\frac{{{A}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}\left({X}\right){}\left({{\partial }}_{{\mathrm{\mu }}}{}\left({y}\right)\right)}{{y}}{+}\frac{{{A}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}\left({X}\right){}\left({{\partial }}_{{\mathrm{\mu }}}{}\left({z}\right)\right)}{{z}}{+}{{\partial }}_{{\mathrm{\mu }}}{}\left({{A}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}\left({X}\right)\right)$ (24)
 >