metrics



next up previous contents index
Next: shift() Up: Metric Contractions Previous: Metric Contractions

metrics

  A prerequisite of using shift() is the existence of a metric for the appropriate index-type. We have seen in §2.4 how to construct a tensor metric from either an indexed object or a line-element. The function metric(), when it creates a metric, declares it to be the ``current-metric'' by updating the variable currentmetric. This variable is a list of names of metrics for each type of index defined by the defindextype!* variable, starting with the tensor metric (see table 2.1 for a list of the initial index-types defined in the system). After creating the metric h for the RW metric we can examine the value of this variable:

 
#: lisp currentmetric;

(h)
The current-metric for any index-type can be set with the function setmetric() and the name of the current-metric can be obtained with the function getmetric(). The argument to setmetric() is the name of a rank-2 covariant object that must be of itype metric, it should also have a metric inverse defined by applying the function invert() to it, if the object was not created by one of the system metric functions. If the tensor metric is being changed, the system coordinates (in coords!*) are changed to reflect those on the new metric. In addition, setmetric() also flags the old metric to be nodir, so that it and its family (see §4) are not displayed by dir(). With setmetric() it is possible for the user to maintain several metrics in the system simultaneously, switching between them as required. The GR package in REDTEN makes this even easier.

The argument to getmetric() is an integer index-type value whose sign is the opposite of the actual entries in the indextype property of the metric. Thus, the value 1 will return the tensor metric, while -1 will return the metric inverse:

 
#: getmetric(1);

  h

#: getmetric(-1);

  h_inv
It is an error to ask for a metric that has not yet been defined.



next up previous contents index
Next: shift() Up: Metric Contractions Previous: Metric Contractions



John Harper
Wed Nov 16 13:34:23 EST 1994