
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.

act

apply an operation on the elements of a tensor, spin or curvature table

antisymmetrize

fully antisymmetrize tensor

change_basis

change basis

Christoffel1

Christoffel symbols of the first kind

Christoffel2

Christoffel symbols of the second kind

commutator

commutator of two vectors

compare

compare two tensors, spin or curvature tables

conj

complex conjugation

connexF

connection coefficients for a rigid frame

contract

contract indices

convertNP

convert connection or Riemann tensor to the NP formalism

cov_diff

covariant differentiation

create

create a tensor object

d1metric

first partial derivatives of the metric

d2metric

second partial derivatives of the metric

directional_diff

directional derivative

display_allGR

display the objects used in General Relativity

displayGR

display one object used in General Relativity

dual

perform the dual operation on the indices of a tensor

Einstein

Einstein tensor

entermetric

facility for the input of metric tensor components

exterior_diff

exterior differentiation

exterior_prod

exterior product

frame

compute the frame that brings the metric to the diagonal signature metric

geodesic_eqns

EulerLagrange equations for geodesic curves

get_char

get the character (covariant/contravariant) of an object

get_compts

get the components of an object

get_rank

get the rank of an object

invars

invariants of the Riemann curvature tensor (General Relativity)

invert

inverse of a second rank tensor

Jacobian

Jacobian of a coordinate transformation

Killing_eqns

Killing's equation (related to symmetries of the space)

Levi_Civita

LeviCivita pseudotensors

Lie_diff

Lie derivative with respect to a vector

lin_com

linear combination of tensor objects

lower

lower indices

npcurve

NewmannPenrose curvature component in Debever formalism (G.R.)

npspin

NewmannPenrose spin component in Debever formalism (G.R.)

partial_diff

partial derivative of a tensor

permute_indices

permutation of indices

petrov

classification of polynomials of degree 4

prod

inner and outer tensor product

raise

raise indices

Ricci

Ricci tensor

Ricciscalar

Ricci scalar

Riemann

Riemann tensor

RiemannF

Riemann curvature tensor in a rigid frame

symmetrize

fully symmetrize a tensor

tensorsGR

compute the objects used in General Relativity

transform

Change coordinates systems

Weyl

Weyl tensor





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}\u2254\mathrm{array}\left(\mathrm{symmetric}\,\mathrm{sparse}\,1..4\,1..4\right)\:$

>

${\mathrm{g\_compts}}_{1\,1}\u22541\frac{2m}{r}\:$${\mathrm{g\_compts}}_{2\,2}\u2254\frac{1}{{\mathrm{g\_compts}}_{1\,1}}\:$

>

${\mathrm{g\_compts}}_{3\,3}\u2254{r}^{2}\:$${\mathrm{g\_compts}}_{4\,4}\u2254{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\u2254\mathrm{create}\left(\left[1\,1\right]\,\mathrm{eval}\left(\mathrm{g\_compts}\right)\right)$

${g}{\u2254}{\mathrm{table}}\left(\left[{\mathrm{index\_char}}{\=}\left[{}{1}{\,}{}{1}\right]{\,}{\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]\right]\right)$
 (1) 
Verify that the new object "g" is really a tensor_type.
>

$\mathrm{type}\left(g\,\mathrm{tensor\_type}\right)$

Create a "rank0" tensor, that is, a scalar.
>

$R\u2254\mathrm{create}\left(\left[\right]\,\frac{4}{{r}^{2}}\right)$

${R}{\u2254}{\mathrm{table}}\left(\left[{\mathrm{index\_char}}{\=}\left[{}\right]{\,}{\mathrm{compts}}{\=}{}\frac{{4}}{{{r}}^{{2}}}\right]\right)$
 (3) 
Verify that this object is also really a tensor_type.
>

$\mathrm{type}\left(R\,\mathrm{tensor\_type}\right)$



