tensor - Maple Help

Overview of the tensor Package

 Calling Sequence tensor[command](arguments) command(arguments)

Description

Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.

 • The tensor package (tensor) contains commands that deal with tensors, their operations, and their use in General Relativity both in the natural basis and in a moving frame. Some utilities to help manipulate tensors are also provided.
 • The tensor package uses its own data type, called tensor_type, to represent objects which have possibly both covariant and contravariant indices. Specifically, a tensor_type is a table with two entries: a $\mathrm{compts}$ field, to store the components of the object, and an index_char field, which describes the covariant or contravariant nature of the indices of the object.
 • The components must be stored as an array of size equal to the rank of the object, with all index ranges beginning at one and ending at the dimension of the space (only "square" ranges are allowed). The index character is stored as a list of positive and negative ones (1 or -1). A positive one (1) in the ith position in the index character list specifies that the ith index of the object is contravariant. Similarly, a negative one (-1) in the ith position in the index character list specifies that the ith index of the object is covariant.
 For example, [1,-1,-1,1] specifies that indices 1 and 4 are contravariant (written as superscripts) and indices 2 and 3 are covariant (written as subscripts). Note that the size of the index character list must match the size of the components array (the rank of the object). For tensors of rank 0 (that is, scalars, invariants), the index character field is an empty list ([]), and the components field is an algebraic type.
 • The tensor_type type is implemented as a procedure (tensor/tensor_type) with a Boolean return value. It returns a value of true if its first argument satisfies the properties of a tensor_type object, and false otherwise.
 • Other than the tensor_type data type, the tensor package uses two other kinds of tables to keep track of related sets of quantities. These are known as the "spin coefficient table" and the "curvature component table".
 • The spin coefficient table stores the NP spin coefficients as computed by tensor[npspin]. The coefficients are indexed according to their Greek names: epsilon, nu, lambda, pi, mu, tau, rho, sigma, kappa, alpha, beta, and gamma (that is, table entry [mu] contains the spin coefficient 'mu').
 • The curvature component table contains the NP curvature components as computed by tensor[npcurve]. This table contains three fields: Phi, which is a (0..2,0..2) array that (with Hermitian matrix components) contains the Ricci components, Psi, which is a (0..4) array containing the Weyl components, and R, a scalar field containing the Ricci scalar.
 • Because computations with tensors usually involve a great number of quantities, it is important to have a lot of flexibility in the way that computations are simplified. For this reason, most of the tensor routines use their own simplifying routines which can be customized for a particular problem. For more information, see tensor/simp.
 • Several of the tensor routines use specific quantities and tensors that have certain symmetrical properties in their indices (for example, the symmetrical property of the metric tensor components). For this reason, the tensor package provides indexing functions that are not provided by Maple. For more information on tensor indexing functions, see tensor/indexing.
 • Each command in the tensor package can be accessed by using either the long form or the short form of the command name in the command calling sequence.

List of tensor Package Commands

 • The following is a list of available commands.

 apply an operation on the elements of a tensor, spin or curvature table fully antisymmetrize tensor change basis Christoffel symbols of the first kind Christoffel symbols of the second kind commutator of two vectors compare two tensors, spin or curvature tables complex conjugation connection coefficients for a rigid frame contract indices convert connection or Riemann tensor to the NP formalism covariant differentiation create a tensor object first partial derivatives of the metric second partial derivatives of the metric directional derivative display the objects used in General Relativity display one object used in General Relativity perform the dual operation on the indices of a tensor Einstein tensor facility for the input of metric tensor components exterior differentiation exterior product compute the frame that brings the metric to the diagonal signature metric Euler-Lagrange equations for geodesic curves get the character (covariant/contravariant) of an object get the components of an object get the rank of an object invariants of the Riemann curvature tensor (General Relativity) inverse of a second rank tensor Jacobian of a coordinate transformation Killing's equation (related to symmetries of the space) Levi-Civita pseudo-tensors Lie derivative with respect to a vector linear combination of tensor objects lower indices Newmann-Penrose curvature component in Debever formalism (G.R.) Newmann-Penrose spin component in Debever formalism (G.R.) partial derivative of a tensor permutation of indices classification of polynomials of degree 4 inner and outer tensor product raise indices Ricci tensor Ricci scalar Riemann tensor Riemann curvature tensor in a rigid frame fully symmetrize a tensor compute the objects used in General Relativity Change coordinates systems Weyl tensor

 • To display the help page for a particular tensor command, see Getting Help with a Command in a Package.

Examples

Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.

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

Define the Schwarzschild covariant metric tensor: In defining the array of metric components, use sparse to cut down on the number of components that must be entered.  We always use the symmetric indexing function when defining the metric components.

 > $\mathrm{g_compts}≔\mathrm{array}\left(\mathrm{symmetric},\mathrm{sparse},1..4,1..4\right):$
 > $\mathrm{g_compts}\left[1,1\right]≔1-\frac{2m}{r}:$$\mathrm{g_compts}\left[2,2\right]≔-\frac{1}{\mathrm{g_compts}\left[1,1\right]}:$
 > $\mathrm{g_compts}\left[3,3\right]≔-{r}^{2}:$$\mathrm{g_compts}\left[4,4\right]≔-{r}^{2}{\mathrm{sin}\left(\mathrm{th}\right)}^{2}:$

Now create the metric tensor by assigning the proper values to fields index_char and compts of a table (or use tensor[create]).

 > $g≔\mathrm{create}\left(\left[-1,-1\right],\mathrm{eval}\left(\mathrm{g_compts}\right)\right)$
 ${g}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}{1}{-}\frac{{2}{}{m}}{{r}}& {0}& {0}& {0}\\ {0}& {-}\frac{{1}}{{1}{-}\frac{{2}{}{m}}{{r}}}& {0}& {0}\\ {0}& {0}& {-}{{r}}^{{2}}& {0}\\ {0}& {0}& {0}& {-}{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{th}}\right)}^{{2}}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{-1}\right]\right]\right)$ (1)

Verify that the new object "g" is really a tensor_type.

 > $\mathrm{type}\left(g,\mathrm{tensor_type}\right)$
 ${\mathrm{true}}$ (2)

Create a "rank-0" tensor, that is, a scalar.

 > $R≔\mathrm{create}\left(\left[\right],-\frac{4}{{r}^{2}}\right)$
 ${R}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}{-}\frac{{4}}{{{r}}^{{2}}}{,}{\mathrm{index_char}}{=}\left[\right]\right]\right)$ (3)

Verify that this object is also really a tensor_type.

 > $\mathrm{type}\left(R,\mathrm{tensor_type}\right)$
 ${\mathrm{true}}$ (4)