Skip to content

Defining New Tensors

akwilson19 edited this page Jul 31, 2019 · 16 revisions

GRTensorIII provides a number of typical scalars and tensors, but in many cases there will be new objects required in a Maple session. The command grdef() provides a mechanism to do this. This wiki page provides a simple introduction to the capabilities of grdef(). A more comprehensive description is provided in the grDef manual, also found on the Worksheets page.

The first argument in a grdef command is a string that defines the name and index configuration of the new object, and optionally provides an expression defining it. Within this string, index names separated by a space, are placed inside curly parenthesis {}. By default an index is assumed covariant/down unless preceded by a ^ symbol.

For example: grdef("A{a ^b}") defines a new object A, with one covariant/down index and one contravariant/up index. In this case no definition is provided, when a calculation requires this object Maple will prompt the user to enter the components.

Additionally, a definition can be provided by using the := assignment designation and then providing an expression that makes reference to existing/known scalars or tensors. This expression can also reference standard Maple functions.

For example we can re-define the Einstein tensor under a new name as:

grdef(" myG{a b} := R{a b} - (1/2)Ricciscalar*g{a b}");

grdef will check to ensure that the listing indices occur in each part of the defining expression.

Contractions, by means of dummy indices in a definition, work in the expected way. For example: grdef("T1{a b} := R{a c d b} * R{^c ^d}"); will perform a summation over the c and d indices. grdef will check that a dummy index occurs once down and once up.

Definition of the components of a vector is a common operation, and a special form of grdef is provided: grdef(" v{^a} := [m/r, 0, 0, r*sin(theta)]");. This defines the vector v and initializes the components.

grdef also provides more complex operations as described in the grDef manual:

  1. symmetrization and anti-symmetrization over indices
  2. Use of the Kronecker delta symbol
  3. References to objects in different spacetimes
  4. Explicit definitions of the symmetries of the new object