Overview of the tensor Package
Calling Sequence
Description
List of tensor Package Commands
Examples
tensor[command](arguments)
command(arguments)
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 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.
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
Euler-Lagrange 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
Levi-Civita pseudo-tensors
Lie_diff
Lie derivative with respect to a vector
lin_com
linear combination of tensor objects
lower
lower indices
npcurve
Newmann-Penrose curvature component in Debever formalism (G.R.)
npspin
Newmann-Penrose 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
To display the help page for a particular tensor command, see Getting Help with a Command in a Package.
with⁡tensor:
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.
g_compts≔array⁡symmetric,sparse,1..4,1..4:
g_compts1,1≔1−2⁢mr:g_compts2,2≔−1g_compts1,1:
g_compts3,3≔−r2:g_compts4,4≔−r2⁢sin⁡th2:
Now create the metric tensor by assigning the proper values to fields index_char and compts of a table (or use tensor[create]).
g≔create⁡−1,−1,eval⁡g_compts
g≔table⁡index_char=−1,−1,compts=1−2⁢mr0000−11−2⁢mr0000−r20000−r2⁢sin⁡th2
Verify that the new object "g" is really a tensor_type.
type⁡g,tensor_type
true
Create a "rank-0" tensor, that is, a scalar.
R≔create⁡,−4r2
R≔table⁡index_char=,compts=−4r2
Verify that this object is also really a tensor_type.
type⁡R,tensor_type
See Also
DifferentialGeometry[Tensor]
Physics
tensor(deprecated)[indexing]
tensor(deprecated)[simp]
UsingPackages
with
Download Help Document