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

Home : Support : Online Help : Physics : SpaceTimeVector

Physics[SpaceTimeVector] - a representation for spacetime indexed vectors

 Calling Sequence SpaceTimeVector[mu](X)

Parameters

 mu - a spacetime index X - a sequence of spacetime symbol parameters, as many as the dimension of spacetime, typically defined by Coordinates

Description

 • The SpaceTimeVector command is a representation for spacetime indexed vectors. Note that having defined X as a label representing a sequence of spacetime coordinates using Coordinates or Setup, the Physics commands already understand ${X}^{\mathrm{\mu }}$ as a representation for a spacetime vector.
 • In a galilean system (Euclidean or Minkowski), both ${X}^{\mathrm{\mu }}$ and the differential of the coordinates $d{X}^{\mathrm{\mu }}$ are vectors (tensors with 1 index), and so both $\partial \left({A}^{\mathrm{\mu }}\right)$ and $\partial {}_{}^{\mathrm{\mu }}$ are vectors, the latter representing

${\partial }_{}^{\mathrm{\mu }}=\frac{\partial }{\partial {X}_{\mathrm{\mu }}}$

 where ${X}_{\mathrm{\mu }}={g}_{\mathrm{\mu },\mathrm{\nu }}{X}_{}^{\mathrm{\nu }}$ is the covariant spacetime vector. However, unlike the galilean case, in a curvilinear system of coordinates, ${X}^{\mathrm{\mu }}$ is not a vector, only $d{X}^{\mathrm{\mu }}$ is and the formula above for $\partial {}_{}^{\mathrm{\mu }}$ loses its meaning; instead, the convention used in the Physics package (it becomes the one above only in the galilean case) is

$\partial {}_{}^{\mathrm{\mu }}=g{}_{}^{\mathrm{\mu },\mathrm{\nu }}{\partial }_{\mathrm{\nu }}$

 Likely, from ${X}_{\mathrm{\nu }}={g}_{\mathrm{\alpha },\mathrm{\nu }}{X}_{}^{\mathrm{\alpha }}$, in a galilean spacetime ${\partial }_{\mathrm{\mu }}\left({X}_{\mathrm{\nu }}\right)={g}_{\mathrm{\mu },\mathrm{\nu }}$ while this is not correct in a nongalilean spacetime, where the metric depends on the coordinates, and the correct formula is ${\partial }_{\mathrm{\mu }}\left({X}_{\mathrm{\nu }}\right)={\partial }_{\mathrm{\mu }}\left({g}_{\mathrm{\alpha },\mathrm{\nu }}\right){X}_{}^{\mathrm{\alpha }}+{g}_{\mathrm{\mu },\mathrm{\nu }}$
 • Remark: in tensor computations, the distinction between covariant and contravariant indices is important when the spacetime is not Euclidean and the indices assume numerical values. The label of a system of coordinates set with Coordinates represent the contravariant components of the corresponding SpaceTimeVector. To indicate than an index is contravariant you prefix it with ~. On the other hand, in Maple, the selection operation is also performed through indexation. Hence, if X is a label for a system of coordinates, entering X[1] returns x1, the contravariant component of the corresponding SpaceTimeVector, even when the index used is the number 1, the covariant version of the contravariant ~1. So in a context where covariant and contravariant indexation is relevant and where you are going to assign numerical values to the indices, it is recommended to represent the spacetime vector with the SpaceTimeVector function, as in SpaceTimeVector[mu](X), instead of directly using X[mu]. In all other cases it is safe and simpler to use X[mu] and all the Physics commands understand both representations as equivalent.

Examples

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

Set first two sets of coordinates:

 > $\mathrm{Coordinates}\left(X,Y\right)$
 ${}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right)\right\}$
 ${}\mathrm{Systems of spacetime coordinates are:}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right){,}Y=\left(\mathrm{y1}{,}\mathrm{y2}{,}\mathrm{y3}{,}\mathrm{y4}\right)\right\}$
 $\left\{{X}{,}{Y}\right\}$ (2)
 > $\mathrm{Setup}\left(\mathrm{diff}=X,\mathrm{dimension}=4\right)$
 ${}\mathrm{Default differentiation variables for d_, D_ and dAlembertian are:}{}\left\{X=\left(\mathrm{x1}{,}\mathrm{x2}{,}\mathrm{x3}{,}\mathrm{x4}\right)\right\}$
 $\mathrm{_______________________________________________________}$
 $\left[{\mathrm{differentiationvariables}}{=}\left[{X}\right]{,}{\mathrm{dimension}}{=}{4}\right]$ (3)

You can now represent the 4-vectors ${Y}_{\mathrm{\mu }}$ and ${X}_{\mathrm{\mu }}$ by using - say for $X$ -  either ${X}_{\mathrm{\mu }}$ or SpaceTimeVector[mu](X).

 > $\mathrm{SpaceTimeVector}\left[\mathrm{\mu }\right]\left(X\right)$
 ${{X}}_{{\mathrm{\mu }}}$ (4)
 > $\mathrm{diff}\left(F\left(X\right),X\left[\mathrm{\mu }\right]\right)$
 ${{\partial }}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}\left({F}{}\left({X}\right)\right)$ (5)
 > $\mathrm{diff}\left(F\left(X\right),\mathrm{SpaceTimeVector}\left[\mathrm{\mu }\right]\left(X\right)\right)$
 ${{\partial }}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}\left({F}{}\left({X}\right)\right)$ (6)

In the output above, note that the default differentiation variables are omitted in the display of d_, as well as that of dAlembertian.

Use the inert %diff notation so the derivative is not performed until you activate it by using the value command.

 > $\mathrm{g_}\left[\mathrm{\mu },\mathrm{\nu }\right]\mathrm{%diff}\left(F\left(X\right),X\left[\mathrm{\mu }\right],X\left[\mathrm{\nu }\right]\right)$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}\left(\frac{{{\partial }}^{{2}}}{{\partial }{{X}}_{{\mathrm{\mu }}}{\partial }{{X}}_{{\mathrm{\nu }}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{F}{}\left({X}\right)\right)$ (7)
 > $\mathrm{value}\left(\right)$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{\partial }}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}\left({{\partial }}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{}\left({F}{}\left({X}\right)\right)\right)$ (8)
 > $\mathrm{Simplify}\left(\right)$
 ${\mathrm{\square }}{}\left({F}{}\left({X}\right)\right)$ (9)

Only the default differentiation variables are omitted in the display of d_ and dAlembertian, so in the following example, $\left[Y\right]$ is displayed.

 > $\mathrm{diff}\left(F\left(Y\right),Y\left[\mathrm{\mu }\right],Y\left[\mathrm{\mu }\right]\right)$
 ${\mathrm{\square }}{}\left({F}{}\left({Y}\right){,}\left[{Y}\right]\right)$ (10)
 > $\mathrm{diff}\left(F\left(Y-X\right),X\left[\mathrm{\mu }\right],Y\left[\mathrm{\nu }\right]\right)$
 ${{\partial }}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{}\left({{\partial }}_{\phantom{{}}\phantom{{\mathrm{\nu }}}}^{\phantom{{}}{\mathrm{\nu }}}{}\left({F}{}\left({\mathrm{y1}}{-}{\mathrm{x1}}{,}{\mathrm{y2}}{-}{\mathrm{x2}}{,}{\mathrm{y3}}{-}{\mathrm{x3}}{,}{\mathrm{y4}}{-}{\mathrm{x4}}\right){,}\left[{Y}\right]\right)\right)$ (11)

Independently of using SpaceTimeVector[mu](X) or the equivalent X[mu] to indicate the dependency of some functions or as differentiation variables, these objects can enter any algebraic computations to representing tensors with 1 index). For example:

 > $X\left[\mathrm{~alpha}\right]X\left[\mathrm{~beta}\right]$
 ${{X}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}}^{\phantom{{}}{\mathrm{\alpha }}}{}{{X}}_{\phantom{{}}\phantom{{\mathrm{\beta }}}}^{\phantom{{}}{\mathrm{\beta }}}$ (12)
 > $\mathrm{d_}\left[\mathrm{\mu }\right]\left(\right)$
 ${{X}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}}^{\phantom{{}}{\mathrm{\alpha }}}{}{{\mathrm{\delta }}}_{{\mathrm{\mu }}\phantom{{\mathrm{\beta }}}}^{\phantom{{\mathrm{\mu }}}{\mathrm{\beta }}}{+}{{\mathrm{\delta }}}_{{\mathrm{\mu }}\phantom{{\mathrm{\alpha }}}}^{\phantom{{\mathrm{\mu }}}{\mathrm{\alpha }}}{}{{X}}_{\phantom{{}}\phantom{{\mathrm{\beta }}}}^{\phantom{{}}{\mathrm{\beta }}}$ (13)
 > $\mathrm{dAlembertian}\left(\right)$
 ${2}{}{{g}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}{,}{\mathrm{\beta }}}}^{\phantom{{}}{\mathrm{\alpha }}{,}{\mathrm{\beta }}}$ (14)
 > $\mathrm{LeviCivita}\left[\mathrm{\alpha },\mathrm{\beta },\mathrm{\mu },\mathrm{\nu }\right]$
 ${{\mathrm{\epsilon }}}_{{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\mu }}{,}{\mathrm{\nu }}}{}{{X}}_{\phantom{{}}\phantom{{\mathrm{\alpha }}}}^{\phantom{{}}{\mathrm{\alpha }}}{}{{X}}_{\phantom{{}}\phantom{{\mathrm{\beta }}}}^{\phantom{{}}{\mathrm{\beta }}}$ (15)
 > $\mathrm{Simplify}\left(\right)$
 ${0}$ (16)

The 1st contravariant and covariant components are respectively represented by indexing SpaceTimeVector with the numbers ~1 and 1

 > $\mathrm{SpaceTimeVector}\left[\mathrm{~1}\right]\left(X\right)$
 ${\mathrm{x1}}$ (17)
 > $\mathrm{SpaceTimeVector}\left[1\right]\left(X\right)=\mathrm{g_}\left[1,\mathrm{\mu }\right]X\left[\mathrm{\mu }\right]$
 ${-}{\mathrm{x1}}{=}{{X}}_{{\mathrm{\mu }}}{}{{\mathrm{\delta }}}_{{1}\phantom{{\mathrm{\mu }}}}^{\phantom{{1}}{\mathrm{\mu }}}$ (18)
 > $\mathrm{Simplify}\left(\right)$
 ${-}{\mathrm{x1}}{=}{-}{\mathrm{x1}}$ (19)

To understand the result above, display the current spacetime metric g_ matrix

 > $\mathrm{g_}\left[\right]$
 ${{g}}_{{\mathrm{\mu }}{,}{\mathrm{\nu }}}{=}\left[\right]$ (20)

Compute the derivative with respect to the 1st contravariant component of $X$, that is $\mathrm{x1}$. Recalling, contravariant differentiation coordinates are the ones entering the covariant differentiation operator ${\partial }_{\mathrm{\mu }}=\frac{\partial }{\partial {x}^{\mathrm{\mu }}}$. For illustration purposes use the inert form of d_ and diff, prefixing the commands with % and perform the computation using value

 > $\mathrm{SpaceTimeVector}\left[\mathrm{~mu}\right]\left(X\right)$
 ${{X}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}$ (21)
 > $\mathrm{%d_}\left[1\right]\left(\right)=\mathrm{%diff}\left(,\mathrm{x1}\right)$
 ${{\partial }}_{{1}}{}\left({{X}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}\right){=}\frac{{\partial }}{{\partial }{\mathrm{x1}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{X}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}$ (22)
 > $\mathrm{value}\left(\right)$
 ${{\mathrm{\delta }}}_{{1}\phantom{{\mathrm{\mu }}}}^{\phantom{{1}}{\mathrm{\mu }}}{=}{{\mathrm{\delta }}}_{{1}\phantom{{\mathrm{\mu }}}}^{\phantom{{1}}{\mathrm{\mu }}}$ (23)

You can also represent x1 with SpaceTimeVector[~1](X), and when differentiating with respect to contravariant components of the spacetime vector you can represent them directly with X[~mu] because ~1, ~2, etc. are viewed by the system as symbols (in this context, contravariant indices) not selecting numbers

 > $\mathrm{%diff}\left(,\mathrm{%SpaceTimeVector}\left[\mathrm{~1}\right]\left(X\right)\right)=\mathrm{%diff}\left(,X\left[\mathrm{~1}\right]\right)$
 $\frac{{\partial }}{{\partial }{{X}}_{\phantom{{}}\phantom{{1}}}^{\phantom{{}}{1}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{X}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}{=}\frac{{\partial }}{{\partial }{{X}}_{\phantom{{}}\phantom{{1}}}^{\phantom{{}}{1}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{{X}}_{\phantom{{}}\phantom{{\mathrm{\mu }}}}^{\phantom{{}}{\mathrm{\mu }}}$ (24)
 > $\mathrm{value}\left(\right)$
 ${{\mathrm{\delta }}}_{{1}\phantom{{\mathrm{\mu }}}}^{\phantom{{1}}{\mathrm{\mu }}}{=}{{\mathrm{\delta }}}_{{1}\phantom{{\mathrm{\mu }}}}^{\phantom{{1}}{\mathrm{\mu }}}$ (25)