home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / derive / download / Setup.exe / %MAINDIR% / Users / Tensor.doc < prev    next >
Encoding:
Text File  |  2002-05-15  |  28.9 KB  |  688 lines

  1.        ****************************************************
  2.        *  The Derive Tensor Algebra and Analysis Package  *
  3.        *  Documentation for the utility file Tensor.mth   *
  4.        ****************************************************
  5.  
  6.     Written by Hans A. Dudler (619 420-1787)  25 November 1994
  7.     Updated for Derive 5              10 November 2001
  8.  
  9.  
  10.   This text file describes the DERIVE utility file Tensor.mth which
  11.   provides definitions and functions for tensor algebra and analysis.
  12.   Tensor.mth should normally be loaded as a utility file using the
  13.   File > Load > Utility File command.
  14.   Note that Tensor.mth activates the case sensitive and word input modes.
  15.   As an introduction to the concepts described in this document the
  16.   demonstration files Tensor1.dmo and Tensor2.dmo are recommended. They
  17.   should be loaded using the File > Load > Demo File command.
  18.  
  19. 1. Tensor Representation in DERIVE.
  20. ===================================
  21.   From the algebraic point-of-view tensors are an extension of the
  22.   vector/matrix concept to higher order arrays. Thus a tensor of rank
  23.   (order) 1 is a vector. A rank 2 tensor is a matrix, which DERIVE
  24.   treats as a vector of vectors. A rank 3 tensor is a vector of
  25.   matrices, a rank 4 tensor is a matrix of matrices, and so on. The
  26.   obvious way to handle tensors in DERIVE is therefore to extend the
  27.   vector concept to higher ranks (orders).
  28.  
  29.   The equivalent of the ELEMENT function to extract an element from a
  30.   tensor is the function (see function descriptions below)
  31.  
  32.              EL_T(A,iv)   ,
  33.  
  34.   where A is the name of the tensor and iv is the index 'vector'(quotes
  35.   used to distinguish a DERIVE vector from a rank 1 tensor). As an
  36.   example consider the tensor of rank (order) 3 and dimension 3
  37.  
  38.             // a b c \     / j k l \   / s t u \\
  39.            A := || d e f | , | m n o | , | v w x ||  .
  40.             \\ g h i /     \ p q r /   \ y z 0 //
  41.   Then
  42.            EL_T(A,[2,3,2])  returns  q
  43.            EL_T(A,[3,1,3])  returns  u
  44.  
  45.   As is clear from the example, the first index (element 1 of the index
  46.   vector) selects the matrix, the second index selects the row-vector
  47.   in the selected matrix and the third index finally selects the element
  48.   in the row vector. Note that under DERIVE the indices must range from
  49.   1 to n (the space dimension), zero (often used in relativity) is not
  50.   allowed. From the above example we deduce that
  51.  
  52.     EL_T(A,[i,j,k])  <=>  ELEMENT(ELEMENT(ELEMENT(A,i),j),k)
  53.  
  54.   in this case, and the extension to higher ranks is obvious. Note that
  55.  
  56.       EL_T(A,[i])     <=>  ELEMENT(A,i)
  57.       EL_T(A,[i,j])  <=>  ELEMENT(A,i,j)  ,
  58.  
  59.   which again demonstrates that the chosen storage philosophy is a
  60.   logical extension of the DERIVE vector/matrix concept.
  61.  
  62.  
  63. 2. Tensor Notation.
  64. ===================
  65.   Since sub- and superscripts cannot be accomodated easily in an ASCII
  66.   file we use the following notation for tensors, which is compatible
  67.   with the notational constraints of DERIVE.
  68.   A mixed tensor T is typically represented as
  69.  
  70.              T_ijk_lm   .
  71.  
  72.   Here T (one or more, UC or LC, Roman or Greek letter) is the tensor
  73.   name. The LC letters i,j,k denote the subscripts (covariant indices)
  74.   and l,m denote the superscripts (contravariant indices).  Totally
  75.   covariant or contravariant tensors have the form T_ijk or T__ijk ,
  76.   respectively. Thus covariant indices follow the first underscore,
  77.   followed by contravariant indices after the second underscore. More
  78.   underscores followed by indices may be appended and each time the
  79.   underscore switches the type of indices. This method may appear
  80.   somewhat cumbersome but it provides the necessary flexibility and
  81.   permits maintaining the relative order of subscripts and superscripts,
  82.   when necessary. As an example consider raising the first index of the
  83.   Riemann curvature tensor of the first kind R_ijkl by means of the
  84.   contravariant metric tensor g__ij, in order to obtain the curvature
  85.   tensor of the second kind R__i_jkl :
  86.  
  87.             R__i_jkl = g__is R_sjkl
  88.  
  89.   Note the two underscores preceding the indices "i" and "is", which
  90.   indicates that they are contravariant (superscripts).
  91.  
  92.   The above notation corresponds to the index notation used in text
  93.   books but in can also be used under DERIVE with one essential
  94.   difference, however. When a tensor is named T_ijk in DERIVE the index
  95.   letters i, j ,k are part of the name and their only function is to
  96.   indicate the structure of the tensor.  The actual indices (variables)
  97.   are contained in an index vector that accompanies the name T_ijk.
  98.   In a text-book equation (characterized by the equal sign =) T_ijk
  99.   refers to element [i,j,k] of the tensor. In a DERIVE assignment
  100.   (characterized by the assignment operator :=) T_ijk denotes a
  101.   "packaged" tensor.  Under DERIVE the above tensor equation would
  102.   appear as follows:
  103.  
  104.       R__i_jkl := IP_T(g__ij,[i,sS],R_ijkl,[sS,j,k,l],[i,j,k,l]).
  105.  
  106.   Here IP_T is the inner-product function (see description below).
  107.   Note that each argument tensor is followed by a corresponding index
  108.   vector, and that the last argument is the desired index vector for the
  109.   result.  The summation index must be named sS but all the other
  110.   indices in the index vectors could have any names, as long as the
  111.   proper correspondences are retained and no name conflicts occur.
  112.  
  113.   With this naming convention the structure of a tensor can be inferred
  114.   from its name and it becomes easier to keep track of things when
  115.   involved calculations are performed. Additional naming rules could
  116.   be used to distinguish between absolute and relative tensors. Thus
  117.   tensor densities could be characterized by an identifier consisting
  118.   of two identical LC letters (e.g. rr_i). It goes without saying,
  119.   however, that any other names may be used with the functions described
  120.   below.
  121.   In accordance with the above conventions the covariant and
  122.   contravariant metric tensors are normally named g_ij and g__ij,
  123.   respectively, with
  124.  
  125.     g__ij := g_ij^(-1)   ;     g := DET(g_ij)
  126.  
  127.   The coordinates are assumed to be the elements of a 'vector'
  128.  
  129.           x := [x1,x2,x3,x4,...]
  130.  
  131.   but can, of course, have arbitrary names.
  132.  
  133.   The underscore (the only special character allowed in DERIVE names)
  134.   may also be used at the end of a name to indicate a transformation of
  135.   the coordinate frame. Thus, if x_(x) defines a new coordinate frame,
  136.   T_ij_klm_ would the name of the transformed tensor.
  137.  
  138.   Note that the index vector shows no distinction between covariant and
  139.   contravariant indices.  For operations that treat covariant and
  140.   contravariant indices differently (such as coordinate transformation)
  141.   additional information to separate the two types of indices in the
  142.   index vector must be given.
  143.  
  144.   When actual computations are performed on tensors the order of storage
  145.   becomes important. The rule adopted here is that storage of a tensor
  146.   follows the sequence of indices (from left to right) in the name. Thus
  147.   the first index ("i" in T_ijk_lm ) corresponds to the highest level of
  148.   vector nesting in DERIVE. Under DERIVE T_i_j and T__j_i are therefore
  149.   different entities although they both have a covariant index "i" and a
  150.   contravariant index "j". This is especially important when tensor
  151.   products are involved. Consider, e.g. the inner product
  152.  
  153.           A__js B_isk = C__j_ik = C_i_j_k = C_ik_j ,
  154.  
  155.   which can be represented by each of the three tensors on the right.
  156.   To avoid this ambiguity the general product functions OP_T and IP_T
  157.   require the desired index vector of the result as an argument (see
  158.   function description below). Since this makes these functions
  159.   somewhat cumbersome to use, the simplified forms O_T and I_T are also
  160.   provided. These functions assume that the product index vector is
  161.   obtained by concatenating the factor index vectors with the summation
  162.   indices omitted. Using these functions the above example can be
  163.   implemented by the DERIVE expression
  164.  
  165.           C__i_jk := I_T(A__ij,2,B_ijk,2) .
  166.  
  167.   Here the numbers 2 indicate the positions of the summation index in
  168.   the factor index vectors. Note that interchanging the arguments would
  169.   produce C_ik_j rather than C__i_jk !
  170.   Another short cut is provided by the function MI_T which is used to
  171.   raise or lower indices by means of the metric tensor.
  172.  
  173.   Transposed Tensors (Isomers).
  174.   =============================
  175.   A tensor equation expressed in the customary index notation is,
  176.   in fact, a relation between tensor elements (components). Thus the
  177.   equation
  178.  
  179.              S_ij = A_ij + A_ji
  180.  
  181.   says that element S_12 (for example) is obtained by summing elements
  182.   A_12 and A_21 of the tensor "A". In matrix notation the above equation
  183.   would be written
  184.             S = A + A'   ,
  185.  
  186.   where "A'" is the transpose of "A". Thus, instead of a single concept
  187.   (matrix A_ij), we are now dealing with two different entities (A and
  188.   A') on the right-hand side of the equation. Note that this is a
  189.   consequence of "packaging" (storing) the matrix elements into an array
  190.   in a predetermined way (rows and columns).  According to the rules of
  191.   matrix algebra element (1,2) of "S" is now found by summing element
  192.   (1,2) of "A" and element (1,2) of "A'", or, in general,
  193.  
  194.              (S)_ij = (A)_ij + (A')_ij     .
  195.  
  196.   Thus when matrices (or tensors) are treated as "packages" it becomes
  197.   necessary to consider their "isomers", i.e. packages with the same
  198.   elements arranged (stored) differently. For matrices (rank 2 tensors)
  199.   there are only two isomers: the matrix itself and its transpose. A
  200.   tensor of rank r, on the other hand, has r! isomers (the number of
  201.   permutations of its indices).
  202.   The DERIVE tensor utility provides the function TP_T to form isomers
  203.   of a given tensor. Consider, for example, the well known identity
  204.   involving the Christoffel symbol of the first kind C_ijk and the
  205.   covariant metric tensor g_ij :
  206.  
  207.          d/dx__j (g_ik) = C_ijk + C_jki  .
  208.  
  209.   Starting with C_ijk and its index vector [i,j,k], the second term on
  210.   the right is obtained from TP_T(C_ijk,[j,k,i],[i,j,k]). Note that the
  211.   first index vector in the function call contains the index permutation
  212.   of the desired isomer, whereas the second index vector shows the
  213.   original sequence. To understand this remember that the last index
  214.   vector in the general tensor functions TP_T, IP_T, OP_T and CT_T is
  215.   the index vector of the result of the operation. When adding tensors,
  216.   elements with equal indices are summed. However, the TP_T function
  217.   above has put element [j,k,i] into location [i,j,k] in the second
  218.   term. Thus when elements [i,j,k] are summed, the second term
  219.   contributes C_jki, as required by the above equation.
  220.   To evaluate the left-hand side we obtain the ordinary derivative of
  221.   g_ij from OD_T(g_ij,x). The index vector of the result is [i,j,k] ,
  222.   with the last index pertaining to the differentiation (see function
  223.   description). Since the equation requires the middle index to be the
  224.   differentiation index, we have to invoke TP_T again to obtain the
  225.   desired isomer. Arguing as above we find that the proper expression
  226.   for the left-hand side is TP_T(OD_T(g_ij,x),[i,k,j],[i,j,k]).
  227.   The demonstration file Tensor1.dmo illustrates this example with a
  228.   particular metric.
  229.  
  230.  
  231.   A Note on Name Conflicts:
  232.   ========================
  233.   The DERIVE functions VECTOR, SUM and PRODUCT can cause name conflict
  234.   problems. Consider, for example, the function S(V) which computes the
  235.   sum of the elements of a vector V :
  236.  
  237.           S(V) := SUM(ELEMENT(V,I),I,DIMENSION(V)) .
  238.  
  239.   If V:=[A,I,B] the function will return A+B+2 rather than A+B+I.
  240.   Since the tensor functions use VECTOR and SUM extensively, care must
  241.   be taken that internal loop index names do not accidentally coincide
  242.   with user names. In addition, auxiliary function names used in the
  243.   tensor utility file could also cause name conflicts.
  244.   In the Tensor Utility File names of auxiliary functions and loop
  245.   indices consistently start with a LC letter followed by an UC letter
  246.   (examples: sVec, sUbel, jJ).    To prevent name conflicts it is
  247.   therefore sufficient to avoid this combination in user-defined names.
  248.   On the other hand, the elements of index-vector arguments of functions
  249.   such as OP_T and IP_T should follow the internal name format, because
  250.   they are used internally as loop indices. Recommended index names are
  251.   iI, jJ, kK, lL, etc.
  252.  
  253.  
  254. 3. Function Description.
  255. ========================
  256.  
  257. 3.1 General Remarks.
  258. ====================
  259.   a) The tensor representation philosophy outlined above accomodates
  260.      tensors of any rank and dimension. In the present implementation
  261.      the only limitation is the length of the index-list vectors 'iNdxa'
  262.      and 'iNdxb" which are used by several functions to construct dummy
  263.      index vectors. Enough dummy names are provided to accomodate
  264.      tensors of rank 12 or less. In the unlikely event that this is
  265.      insufficient more names can be added to the lists.
  266.  
  267.   b) Since tensor calculations tend to be slow, it is good practice
  268.      to assign variables to intermediate results for later use. Thus,
  269.      starting with a metric tensor g_ij one would first compute the
  270.      Christoffel symbols by simplifying CHRIS1 and CHRIS2 and then
  271.      saving the results as C_ijk and C_ij_k, respectively. Accordingly
  272.      the function RIEM1 takes C_ijk and C_ij_k as arguments rather than
  273.      starting from the metric tensor. Note that the DERIVE expression
  274.      C_ijk := CHRIS1(g_ij,x)  does not save any time, since CHRIS1 is
  275.      re-computed each time the name C_ijk is encountered. CHRIS1 must be
  276.      simplified first, and then C_ijk must be assigned to the result.
  277.      To facilitate this assignment procedure DERIVE (starting with
  278.      version 3.00) provides the Simplify/Assign operator :== , which
  279.      simplifies the right-hand side before assigning it to the left-hand
  280.      side. Thus
  281.  
  282.               C_ijk :== CHRIS1(g_ij, x)
  283.  
  284.      will compute the Christoffel symbol of the first kind and assign
  285.      the result to C_ijk.
  286.  
  287.   c) In the function descriptions below the following symbols are used:
  288.  
  289.       A, B      :  tensors of any rank (see 3.1a), any dimension
  290.     ivA, ivB  :  dummy index vectors corresponding to A, B , with
  291.                dim(ivA) = rank(A) , dim(ivB) = rank(B)
  292.              All elements of these vectors must be different
  293.              undeclared variable names. Recommended: iI, jJ ,..
  294.        ivN      :  Numeric index vector pointing to a tensor element.
  295.              Elements of ivN must be integers in the range 1...n
  296.              (n is the dimension of the space) or variables that
  297.              simplify to such integers.
  298.  
  299.  
  300. 3.2 Tensor Rank, Dimension, Elements.
  301. =====================================
  302.  
  303.   RANK_T(A) , DIM_T(A) : Find rank, dimension of a tensor. Examples:
  304.   ====================
  305.                 // a  b \ / e  f \\
  306.                 |\ c  d / \ g  h /|
  307.        with  A_ijkl :=  |              |
  308.                 |/ i  k \ / n o \ |
  309.                 \\ l  m / \ p q / /
  310.  
  311.        RANK_T(A_ijkl) => 4    ,  DIM_T(A_ijkl) => 2
  312.  
  313.     DIM_T(A) is the same as DIMENSION(A), except that DIM_T(A) returns
  314.     zero when A is a scalar.
  315.  
  316.   EL_T(A,ivN) : Extract an element from a tensor.
  317.   ===========
  318.      ivN : numeric index vector pointing to element, dim(ivN) = rank(A)
  319.        Examples:
  320.  
  321.                 // a  b \ / e  f \\
  322.                 |\ c  d / \ g  h /|
  323.           with    A :=  |              |
  324.                 |/ i  k \ / n o \ |
  325.                 \\ l  m / \ p q / /
  326.  
  327.        EL_T(A, [2,1,1,2]) => k    ,  EL_T(A, [1,2,2,2]) => h
  328.  
  329.   NZEL_T(A) : Extract all non-zero elements from a tensor. Example:
  330.   =========
  331.             // 0 0 0 \     / 0 0 0 \   / 0 0 0 \\
  332.      with  A := || 0 0 x | , | 0 y 0 | , | 0 0 0 ||
  333.             \\ 0 0 0 /     \-x 0 0 /   \ 0 0 0 //
  334.  
  335.                    / [1,2,3] = x \
  336.           NZEL_T(A) => | [2,2,2] = y |
  337.                    \ [2,3,1] =-x /
  338.  
  339.   GNZE_T(A) : Grouped non-zero elements of a tensor.
  340.   =========
  341.      Displays the non-zero elements grouped together on the basis of
  342.      their absolute value, which shows the symmetry properties of a
  343.      tensor. Applied to the above example GNZE_T(A) will return (note
  344.      negative indices for negative values)
  345.  
  346.        / /[ 1, 2, 3]     \                \
  347.        \ \[-2,-3,-1] = x / , [ [ 2, 2, 2] = y ] /
  348.  
  349.   EL_D(i,j) : Element of Kronecker Delta (1 if i=j, 0 otherwise),
  350.   =========
  351.  
  352.   EL_GD(iv1,iv2) : Element of Generalized Kronecker Delta (GD_ij.._kl..)
  353.   ==============
  354.     iv1, iv2 : Numeric covariant, contravariant index vectors with
  355.            DIM(iv1) = DIM(iv2)
  356.  
  357.   EL_E(ivN) : Element of Permutation Symbol, rank=dim=dim(ivN)
  358.   =========
  359.      ivN     : Numerical index vector
  360.  
  361.  
  362. 3.3 Algebraic Tensor Operations.
  363. ================================
  364.      Since from the DERIVE point-of-view tensors are merely nested
  365.      vectors, addition and subtraction of tensors of the same type are
  366.      handled by DERIVE automatically. This also holds for multiplication
  367.      or division of a tensor by a scalar, and differentiation or
  368.      integration with respect to a scalar parameter. Additional tensor
  369.      operations are described below. See 3.1c for symbol definition.
  370.  
  371.   TP_T(A,ivA,ivT) : Transpose of a tensor.
  372.   ===============
  373.      ivT is the index vector of the result and must be a permutation
  374.      of ivA. This function creates an isomer of A (same elements,
  375.      different order of indices, storage). Examples:
  376.  
  377.      T_ikj_ml := TP_T(T_ijk_lm, [iI,kK,jJ,mM,lL], [iI,jJ,kK,lL,mM])
  378.  
  379.      creates a tensor with indices j, k and l,m transposed.
  380.  
  381.            / a  b  c \                / a  d  g \
  382.       TP_T(| d  e  f | , [jJ,iI], [iI,jJ])    =>  | b  e  h |
  383.            \ g  h  i /                \ c  f  i /
  384.  
  385.   OP_T(A,ivA,B,ivB,ivP) : Outer product of two tensors.
  386.   =====================
  387.   O_T(A,B) :  short form, assumes ivP = APPEND(ivA,ivB)
  388.  
  389.      ivP : index vector of the product, dim(ivP) = rank(A)+rank(B)
  390.      Examples:
  391.  
  392.           with  A := [a,b,c] , B := [u,v,w]
  393.  
  394.                          / a u  a v  a w \
  395.         OP_T(A,[iI], B,[jJ], [iI,jJ] =>  | b u  b v  b w |
  396.            or  O_T(A,B)             \ c u  c v  c w /
  397.  
  398.                          / a u  b u  c u \
  399.         OP_T(A,[jJ], B,[iI], [iI,jJ] =>  | a v  b v  c v |
  400.            or  O_T(B,A)             \ a w  b w  c w /
  401.  
  402.   IP_T(A,ivA,B,ivB,ivP) : Inner Product of two tensors.
  403.   =====================
  404.   I_T(A,sA,B,sB) : short form, assumes ivP = APPEND(ivA',ivB'),
  405.            ivA', ivB' : ivA, ivB less summation index
  406.            sA,sB : location of summation index in ivA,ivB
  407.  
  408.      ivP : index vector of the product, dim(ivP) = rank(A)+rank(B)-2
  409.      ivA and ivB must each contain 'sS' as one element (placeholder
  410.      for the summation index). Examples:
  411.  
  412.      The text-book formula   C_ij = A_ij_k B_k corresponds to
  413.  
  414.       C_ij := IP_T(A_ij_k,[iI,jJ,sS], B_i,[sS], [iI,jJ]).
  415.      or   C_ij := I_T(A_ij_k,3,B,1)
  416.  
  417.      With  A := [a,b,c] , B := [u,v,w]
  418.  
  419.         IP_T(A,[sS], B,[sS], [])  =>  a u + b v + c w
  420.     or  I_T(A,1,B,1)
  421.  
  422.   EL_IP_T(A,ivAN,B,ivBN) : One element of an inner product.
  423.   ======================
  424.      ivAN, ivBN : numeric index vectors except for the presence of sS
  425.           (summation index) in one location each.   Example:
  426.  
  427.            // a b c \   / j k l \    / s t u \\     / P Q R \
  428.      with A := || d e f | , | m n o | , | v w x || , B :=| S T U |
  429.            \\ g h i /   \ p q r /    \ y z 0 //     \ V W X /
  430.  
  431.       EL_IP_T(A,[2,1,sS], B,[sS,3]) => j R + k U + l X
  432.  
  433.   MI_T(A,n,metric) : Move (raise or lower) an index
  434.   ================
  435.      n        : location of index to be moved in index vector. The raised
  436.           or lowered index remains in the same location.
  437.      metric : g__ij to raise index, g_ij to lower index.  Example:
  438.  
  439.          R__i_jkl := MI_T(R_ijkl,1,g__ij)
  440.  
  441.   CT_T(A,ivA,ivC) : Contraction of a tensor.
  442.   ===============
  443.   C_T(A,s1,s2) : short form, assumes ivC=ivA with summ.indices omitted.
  444.     s1, s2 : locations of summation indices in ivA.  Examples:
  445.  
  446.      The text-book formula  B_ij = A_ijk_k  corresponds to
  447.  
  448.        B_ij := CT_T(A_ijk_l,[iI,jJ,sS,sS],[iI,jJ])
  449.  
  450.          / a  b  c \
  451.         C_T( | d  e  f | ,1,2)  =>    a + e + i
  452.          \ g  h  i /
  453.  
  454.   CI_T(A,ivA,B,ivB,ivC) : Contracted Inner product (double summation)
  455.   =====================
  456.   C_I_T(A,sA,tA,B,sB,tB) : short form, assumes ivC = APPEND(ivA',ivB'),
  457.                ivA', ivB' : ivA, ivB less summation indices
  458.                sA,tA : location of 'sS', 'tT' in ivA
  459.                sB,tB : location of 'sS', 'tT' in ivB
  460.  
  461.      ivC : index vect.of contracted product, dim(ivC)=rank(A)+rank(B)-4
  462.        ivA and ivB must each contain 'sS' and 'tT' (summ.indices)
  463.        Example: The text-book formula  C_i = A_si_t B_t_s becomes
  464.  
  465.            C_i := CI_T(A_ij_k,[sS,iI,tT],B_i_j,[tT,sS],[iI])
  466.  
  467.  
  468. 3.4 Differential Tensor Operations.
  469. ===================================
  470.   Note: 'Di' stands for d/dx__i
  471.  
  472.   OD_T(A,x) : Ordinary derivative of a tensor (Dm A_ij.._kl..).
  473.   =========
  474.      A may be a scalar. Note that rank(OD_T) is one higher than rank(A).
  475.      The new covariant index is assumed to be appended at the end of the
  476.      index string.  Thus A_ij.._kl.. becomes A_ij.._kl.._m .
  477.  
  478.      with  A := [x1 COS(x2), x1 SIN(x2)]  ,  x := [x1, x2]  ,
  479.  
  480.                / COS(x2)  -x1 SIN(x2) \
  481.      OD_T(A,x) =>  |              |
  482.                \ SIN(x2)   x1 COS(x2) /
  483.  
  484.   CD_T(A,ncov,weight,x,C_ij_k) : Covariant derivative of a tensor.
  485.   ============================
  486.      A        : mixed tensor with structure A_ij.._kl.. (covariant indices
  487.           followed by contravariant indices). May be a scalar.
  488.      ncov   : number of covariant indices (i,j,..)
  489.      weight : weight of tensor ( = 0 for absolute tensor,
  490.           = 1 for density, = n for relative tensor of weight n)
  491.      x        : coordinate vector [x1,x2,x3,...]
  492.      C_ij_k : Christoffel symbol of the 2nd kind.
  493.  
  494.      To handle more elaborately structured tensors (e.g. A_i_j_k_lm)
  495.      use TP_T to first create the required structure and use it again
  496.      again after CD_T to transform back to the original structure.
  497.  
  498.      Note that rank(CD_T) is one higher than rank(A). The new covariant
  499.      index is assumed to be appended at the end of the index string.
  500.      Thus A_ij.._kl.. becomes A_ij.._kl.._m .
  501.      Example:
  502.  
  503.        with  A := g__ij (contravariant metric tensor in 3 dimensions)
  504.  
  505.                  // 0 0 0 \   / 0 0 0 \   / 0 0 0 \\
  506.     CD_T(A,0,0,x,C_ij_k) =>  || 0 0 0 | , | 0 0 0 | , | 0 0 0 ||
  507.                  \\ 0 0 0 /   \ 0 0 0 /   \ 0 0 0 //
  508.  
  509.   LD_T(A,v,ncov,weight,x) : Lie derivative of A relative to vector v
  510.   =======================
  511.      A        : mixed tensor with structure A_ij.._kl.. (covariant indices
  512.           followed by contravariant indices). May be a scalar.
  513.      ncov   : number of covariant indices (i,j,..) of A
  514.      weight : weight of tensor A ( = 0 for absolute tensor,
  515.           = 1 for density, = n for relative tensor of weight n)
  516.      v        : contravariant vector
  517.      x        : coordinate vector [x1,x2,x3,...]
  518.  
  519.      To handle more elaborately structured tensors (e.g. A_i_j_k_lm)
  520.      use TP_T to first create the required structure and use it again
  521.      after LD_T to transform back to the original structure.
  522.      Note that the Lie derivative of a tensor A is a tensor of the same
  523.      structure and weight as A.
  524.  
  525.      Example:  with
  526.  
  527.      A_i := [U(X,Y),V(X,Y)] (covariant vector) , x := [X,Y] , v := x
  528.  
  529.       LD_T(A,v,1,0,x) =>  [X dU/dX + Y dU/dY +U , X dV/dX + Y dV/dY +V]
  530.  
  531.   DV_T(A,ncov,weight,sA,x,C_ij_k) : (Covariant) Divergence of a Tensor
  532.   ===============================
  533.      A        : mixed tensor with structure A_ij.._kl.. and at least one
  534.           contravariant index).
  535.      ncov   : number of covariant indices (i,j,..) of A
  536.      weight : weight of tensor A ( = 0 for absolute tensor,
  537.           = 1 for density, = n for relative tensor of weight n)
  538.      sA     : location of summ.index in index vector of A ( > ncov)
  539.      x        : coordinate vector [x1,x2,x3,...]
  540.      C_ij_k : Christoffel symbol (2nd kind)
  541.  
  542.      To handle more elaborately structured tensors (e.g. A_i_j_k_lm)
  543.      use TP_T to first create the required structure and use it again
  544.      after LD_T to transform back to the original structure.
  545.      Note that rank(DV_T) is one lower than rank(A). The index vector of
  546.      the result is the index vector of A with the summ.index left out.
  547.      Example:  If G_i_j is the (mixed) Einstein tensor in 4-space
  548.  
  549.         DV_T(G_i_j,1,0,2,x,C_ij_k) => [0,0,0,0]
  550.  
  551.   GC_T(A,x) : Generalized Curl (GD_ij..r_kl..s Ds A_kl..),
  552.   ===========          GD : generalized Kronecker delta
  553.      A : covariant tensor (or scalar).
  554.      The rank of the result is one higher than the original and the
  555.      new covariant index is appended at the right. Example:
  556.  
  557.      with A := [A1,A2,A3]  ,  x := [X,Y,Z]
  558.  
  559.          /     0       dA1/dY - dA2/dX  dA1/dZ - dA3/dX\
  560.     GC_T(A,x) => |dA2/dX - dA1/dY      0        dA2/dZ - dA3/dY|
  561.          \dA3/dX - dA1/dZ  dA3/dY - dA2/dZ       0       /
  562.  
  563.  
  564. 3.5 Coordinate Transformation.
  565. ==============================
  566.   Let the new coordinate vector be x_ := [x1_,x2_,x3_,...] and let
  567.   x = [x(x_)] be the functions expressing the old coordinates in terms
  568.   of the new ones.
  569.  
  570.   JACOB(x,x_) : Jacobian matrix of the transformation. Example:
  571.   ===========
  572.    with  x := [x1_ COS(x2_) , x1_ SIN(x2_)]  ,    x_ := [x1_,x2_] ,
  573.  
  574.                / COS(x2_)  -x1_ SIN(x2_) \
  575.        JACOB(x,x_) =>  |             |
  576.                \ SIN(x2_)   x1_ COS(x2_) /
  577.  
  578.   TF_T(A,ncov,weight,JM,JM_) : Transform a tensor to new coordinates.
  579.   ==========================
  580.      A        : mixed tensor with structure A_ij.._kl.. (covariant indices
  581.           followed by contravariant indices)
  582.      ncov   : number of covariant indices (i,j,..)
  583.      weight : weight of tensor ( = 0 for absolute tensor,
  584.           = 1 for density, = n for relative tensor of weight n)
  585.      JM     : Jacobian matrix of transformation ( := JACOB(x,x_) )
  586.      JM_    : Inverse Jacobian matrix ( := JM^-1 )
  587.  
  588.      To handle more elaborately structured tensors (e.g. A_i_j_k_lm)
  589.      use TP_T to first create the required structure and use it again
  590.      after TF_T to transform back to the original structure.
  591.      Example:
  592.  
  593.                  / COS(x2_)  -x1_ SIN(x2_) \
  594.      with  A := [a,b]  ,  JM :=  |               |  ,
  595.                  \ SIN(x2_)   x1_ COS(x2_) /
  596.  
  597.      TF_T(A,1,0,JM,JM_) =>
  598.           [a COS(x2_) + b SIN(x2_) , b x1_ COS(x2_) - a x1_ SINx2_)]
  599.  
  600.  
  601. 3.6 Special Tensors.
  602. ====================
  603.   Note: Different text books use different isomers for the various
  604.     special tensors. Except for the Ricci and Einstein tensors (R_ij
  605.     and G_ij) the definitions given in Korn & Korn: Mathematical
  606.     Handbook for Scientists and Engineers (chapter 16) are adopted
  607.     here. The definitions of R_ij and G_ij were made to agree with
  608.     more recent texts on General Relativity, which has the effect of
  609.     changing the signs of these tensors.
  610.  
  611.   DELTA(dim) : Kronecker Delta (D_i_j),
  612.   ==========
  613.      dim  : tensor dimension
  614.  
  615.   GDELTA(ncov,dim) : Generalized Kronecker Delta (GD_ij.._kl..)
  616.   ================
  617.      ncov : number of covariant indices (= no.of contravariant indices)
  618.      dim  : dimension
  619.  
  620.   EPS(dim) : Permutation tensor, rank = dimension (E_ij.. or E__ij..)
  621.   ========
  622.      dim  : tensor dimension
  623.  
  624.   CHRIS1(g_ij,x) : Christoffel symbol of the 1st kind (C_ijk)
  625.   ==============
  626.      g_ij  : covariant metric tensor
  627.      x       : coordinate 'vector'.
  628.  
  629.   CHRIS2(g_ij,g__ij,x) : Christoffel symbol of the 2nd kind (C_ij_k)
  630.   ====================
  631.      g_ij  : covariant metric tensor
  632.      g__ij : contravariant metric tensor
  633.      x       : coordinate 'vector'.
  634.  
  635.   RIEM1(C_ijk,C_ij_k,x) : Riemann curvature tensor of the 1st kind
  636.   =====================                      (R_ijkl)
  637.      C_ijk  : Christoffel symbol (1st kind)
  638.      C_ij_k : Christoffel symbol (2nd kind)
  639.      x        : coordinate 'vector'
  640.  
  641.   EL_RIEM1(C_ijk,C_ij_k,x,i,j,k,l) : Element of Riemann tens. (1st kind)
  642.   ================================
  643.      C_ijk   : Christoffel symbol (1st kind)
  644.      C_ij_k  : Christoffel symbol (2nd kind)
  645.      x         : coordinate 'vector'
  646.      i,j,k,l : numeric indices of desired element R_ijkl
  647.  
  648.   RIEM2(C_ij_k,x) : Riemann curvature tensor of the 2nd kind (R__i_jkl
  649.   ===============                    = g__is R_sjkl)
  650.      C_ij_k : Christoffel symbol (2nd kind)
  651.      x        : coordinate 'vector'
  652.  
  653.   EL_RIEM2(C_ij_k,x,i,j,k,l) : Element of Riemann tensor of the 2nd kind
  654.   ==========================
  655.      C_ij_k  : Christoffel symbol (2nd kind)
  656.      x         : coordinate 'vector'
  657.      i,j,k,l : numeric indices of desired element R_ijk_l
  658.  
  659.   RICCI(C_ij_k,x) : Covariant Ricci tensor (R_ij = R__s_isj = -R__s_ijs)
  660.   ===============
  661.      C_ij_k : Christoffel symbol (2nd kind)
  662.  
  663.   EINST(R_ij,g_ij,g__ij) : Covariant Einstein tensor (G_ij)
  664.   ======================
  665.      R_ij   : covariant Ricci Tensor
  666.      g_ij   : covariant metric tensor
  667.      g__ij  : contravariant metric tensor
  668.  
  669.   WEYL(R_ijkl,R_ij,g_ij) : Weyl Tensor (Conformal Tensor)
  670.   ======================
  671.      R_ijkl : Riemann curvature tensor (1st kind)
  672.      R_ij   : covariant Ricci tensor
  673.      g_ij   : covariant metric tensor
  674.  
  675.  
  676. 3.7 Miscellaneous Functions.
  677. ============================
  678.  
  679.   DI_NZEL( NZEL_T(A) ), DI_GNZE( GNZE(A) )
  680.   ========================================
  681.      These functions, when applied to the expressions resulting from
  682.      NZEL_T or GNZE_T decrement all indices in the display by 1. This
  683.      makes it easier to compare elements with tensors that use a
  684.      [0,...(dim-1)] index range rather than the DERIVE [1,...dim] range.
  685.  
  686.  
  687.         ================== END OF FILE =================
  688.