ATENSOR - REDUCE program for tensor simplification
aa r X i v : . [ c s . S C ] N ov ATENSOR – REDUCE program for tensorsimplification
V.A.Ilyin ∗ and A.P.Kryukov † Institute of Nuclear Physics, Moscow State University119899, Moscow, RussiaJuly 1996
PROGRAM SUMMARY
Title of program:
ATENSOR
Catalogue number:Program available from:
CPC Program Li-brary, Queen’s University of Belfast, N. Ireland(see application form in this issue).
License provisions: none
Computer:
Any computers where REDUCE [7]can be installed
Operation system: see above.
Programming language:
REDUCE-3.4, 3.5
No. of bits in a word: No. of lines in distributed program, includingtest data, etc.:
Keywords:
Tensor, symmetry, multiterm linearidentities, dummy indices, simplification, per-mutation group, REDUCE, computer algebra.
Nature of physical problem:
Simplification oftensor expressions with taking into accountmultiterm linear identities, symmetry relationsand renaming dummy indices. This problemis important for the calculations in the gravitytheory, differential geometry, other fields whereindexed objects arise. ∗ E-mail: [email protected] † E-mail: [email protected]
Method of solution:
The group algebra tech-nique for permutation group is applied to con-struct a canonical subspace and the effectivealgorithm for the corresponding projection.
Restriction on the complexity of the problem:
Computer operative memory is the severest re-striction.
Running time:
It depends on the problem. Forexample the expression contained contractionof Riemann tensor with antisymmetric tensorof second order ǫ µν ∗ R µνλκ − ǫ αβ ∗ R λκβα requireabout 82s CPU time on HP9000/735 with 8Mfor REDUCE. References: [1] V.A.Ilyin and A.P.Kryukov, in Proc. of theInt. Symp. of Symbolic. and Algebraic Com-putation (ISSAC’91), July 15-17, 1991, Bonn,Ed. by S.Watt, ACM Press (1991) 224.[2] V.A.Ilyin and A.P.Kryukov, in ”New Com-puting techniques in Physics Research II”,Proc. of AIHENP-92, Ed. by D.Perret-Gallix,World Scientific, Singapore (1992) 639-348 ONG WRITE-UP1 Introduction
Objects with indices are often used in math-ematics and physics. Tensors are classicalexamples here [1, 2]. Indexed objects canhave very complicated and intricated prop-erties. For example the Riemann tensor hassymmetry properties with respect to permu-tation of indices. Moreover it satisfies thecyclic identity [1]. There are a number oflinear identities with many terms in the caseof Riemann-Cartan geometry with torsion[2].So there is a problem of reduction ofexpressions which contain indexed objects,called ”tensor expressions” below.Two reduction strategies can be used.First, the corresponding expressions areexpanded in terms of basic elements to re-solve symmetries and identities in the ex-plicit form. However, this way requires in-troducing a lot of objects of different typesand rules for their management. In the Rie-mann tensor case, these are the Christofelsymbol, the metric tensor, and their deriva-tives. As a rule, this leads to large inter-mediate expressions. Furthermore, such anapproach fails, for instance, in the case ofgeometry with torsion.Second strategy is to consider indexedobjects as formal objects with some prop-erties. Note that if we consider tensorswhich have only symmetries correspond-ing to permutation indices and renamingdummy ones then the problem can be solvedin terms of double cosets of permutationgroup [3]. However, if linear identities withmany terms ( >
2) are present, this approachfails because the summation operator leavesthe group framework. Our approach to the problem of simpli-fication of tensor expressions is based onthe consideration of tensor expressions asvectors in some linear space. The prelimi-nary version of this idea was proposed in [4].The advanced version of the algorithm waspresented at ISSAC’91 [8] and AIHENP-92[9]. Here we present a program in which weimplement the proposed algorithm in RE-DUCE and give a detailed description of theprogram. We generalized the algorithm tothe case of tensor multiplication.Complementary approach was developedin [11]. Here Young diagram technique wasused to solve the simplification problem insome specific case. Namely, when dummyindices are allowed only between basic ten-sors for which generic symmetry relationsand multiterm linear identities should beimposed. Although this algorithm is a pow-erful tool in ‘indicial tensor calculations’ ofasymptotic expansions of heat kernels of dif-ferential operators it fails in general case.From the user’s point of view, there arethree groups of tensor properties: S - symmetry with respect to index permu-tations; I - linear identities. D - invariance with respect to renamings ofdummy indices;As an illustration, for the Riemann cur-vature tensor these properties are: S: R abcd = R cdab , R abcd = − R bacd ; I: R abcd + R acdb + R adbc = 0; D: R abcd R ckmn R dlps = R abdc R dkmn R clps . Note that multiterm linear identities willproduce many rewriting rules which cancomplicate the problem essentially.The problem under investigation can beformulated as a question: whether two ten-sor expressions are equal or not, taking intoaccount S-I-D properties?
Then the prob-2em of simplest (shortest) canonical form forgiven expression arises as a central one.
Let us give some definitions.Under basic tensors we will understandthe object with finite number of indiceswhich can have such properties as symmetry and multiterm linear identities .Then, under tensor expression we will un-derstand any expression which can be ob-tained from basic tensors with the help ofthe following operations: • summation with integer coefficients; • multiplication (commutative) of basictensors .We assume that all terms in the tensorexpression have the same number of indices.Some pairs of them are marked as dummyones. The set of nondummy names haveto be the same for each term in the tensorexpression. The names of dummies can bearbitrary. To start with, let us consider the case of onebasic tensor and tensor expressions whichare linear combinations of this basic tensorwith integer coefficients (i.e. without multi-plication of tensors).Let a tensor F has indices µ , . . . , µ n .There are n ! formally different objects F π ( µ ,...,µ n ) , π = (cid:26) · · · nπ (1) · · · π ( n ) (cid:27) ∈ S n , The symmetry relations are partial case of lin-ear identities indeed Including contraction of indices. where S n is the group of permutations of theset (1 , . . . , n ) and π ( µ , . . . , µ n ) ≡ ( π ( µ ) , . . . , π ( µ n )). If F has symmetries with respect to in-dex permutations it means that there is asubgroup H ∈ S n such that F h ◦ π − d ( h ) · F π = 0 , ∀ h ∈ S n ; d ( h ) ∈ R ; h ◦ π ≡ ( π ( h ( µ )) , . . . , π ( h ( µ n ))) . Multiterm linear identities can be writtenin the following form X π ∈ S n α π · F π = 0 , α π ∈ R . If some pairs of dummy indices arepresent without any loss of generality wemay suppose that their names are alreadynormalized in some way, i.e. they havefixed names. Therefore one can only ex-change these names: 1) change names in-side each pair and 2) change pairs of thesenames. With this restriction the exchangingof dummy indices means that a subgroup M ∈ S n exists such that F π ◦ m ( µ , ··· ,µ n ) = F π , ∀ m ∈ M, π ∈ S n . Let us consider now the group algebra of S n [5]. This is a linear space R n ! in whichunit vectors correspond to permutations: R n ! ∋ e π ↔ π ∈ S n . The vectors e π are orthogonal to eachother in the Euclidean metric. The difference in actions of H and M on S n in the discussed relations ( h ◦ π and π ◦ m ) isconnected with the different nature of these trans-formations: the symmetry acts upon place of in-dices while dummy indices renaming acts upon thenames.
3o we have an explicit isomorphism be-tween tensor expressions and points in R n ! : X π α π · e π ↔ X π α π · F π , In terms of R n ! , the left hand sides of the S-I-D relations correspond to the vectors e h ◦ π − d ( h ) e π , e π ◦ m − e π , n ! X k =1 α k e k , (1) h ∈ H, m ∈ M, π ∈ S n . These vectors span some subspace K ∈ R n ! . We denote its dimension as K .Now we can split group algebra of S n intoorthogonal components in terms of the Eu-clidean metric R n ! = K ⊕ Q . It is obvious that all points of R n ! lyingin K correspond to tensor expressions whichare equal to zero due to the S-I-D proper-ties. Thus, any two points A and A ′ lying onthe plane parallel to K correspond to equalexpressions:( A − A ′ ) ↔ X π ∈ S n α SIDπ · F π = 0 . The ( n ! − K ) dimensional subspace Q could be chosen as a set of canonical el-ements: a point A Q can be determinedas a canonical representative of the S-I-D equivalence class of A . Then one can con-clude that the problem of comparing ten-sor expressions may be solved by compar-ing their canonical representatives. Suchan approach was developed in [4] wherethe Gramm-Schmidt orthogonalization pro-cedure was used as a main technical method.However, this procedure requires too much time and computer memory during execu-tions.In [8] the authors proposed an effectiveprocedure where another subspace, denotedbelow as L , had been considered as a set ofcanonical elements. In the next section wegive a concise formulation of this procedure. Let’s designate vectors (1) as V k = n ! X j =1 α kj e j , k = (1 , ..., ˜ K ) . (2)Then we construct new vectors by recur-rent applying (with steps m = 1 , . . . , ˜ K ) ofthe following transformation:— if V m − m = 0 then define k m by firstnonzero coefficient in V m − m and let V mk ≡ V m − k , k = 1 , . . . , k m ; V mk ≡ V m − k − m X i =1 α m − kj i α m − k i j i V m − k i , k > k m ; (3)— if V m − m = 0 then V mk ≡ V m − k . As a result, we have a set of nonzero vec-tors V ( K ) k which span the subspace K . Notethat all nonzero vectors V ( K ) k are linearly in-dependent. Indeed, let us reorder the unitvectors( e , . . . , e n ! ) −→ ( e j , . . . , e j m , . . . ) . Then the vectors V ( K ) k with k ≥ k m willhave zero projections onto the unit vectors e j i ( i < m ). In other words, the set V ( K ) k hasa ”triangle” form in this reordered basis. Itis evident that a number of nonzero vectors V ( K ) k is equal to K - the dimension of the S-I-D subspace K .We have made some optimization in ad-dition to the transformation (3):4 n each step m all already constructednonzero vectors V ( K ) k i ( i < m ) are improvedby the following transformation : V mk i → V mk i − α mk i j m α mk m j m V mk m , i < m. (4)Such optimization doesn’t spoil the ”tri-angle” structure and vectors V ki with k S-I-D relations asa product of basic ones.Then the expression is elaborated, tak-ing into account additional relations origi-nated from the multiplication rule (in ourcase from the commutativity). Let us con-sider a tensor tt with two indices as an ex-ample. If we multiply it by itself, say as tt ( i, j ) ∗ tt ( k, l ), the additional symmetry ap-pears: tt ( i, j ) ∗ tt ( k, l ) = tt ( k, l ) ∗ tt ( i, j ) . We consider all such permutations andadd the corresponding elements to the S-I-D relations. Then we perform the ”trian-gle” procedure (3,4) to construct the full K subspace, and use the procedure (5) for thecanonical representative calculation . Here { } means that this set has a single point- zero vector. It is clear how to generalize the algorithm tothe case of a noncommutative finite algebra of basictensors. In such cases, more complicated relationswill appear instead of the simple symmetry writtenabove. However, in any case they will be linearidentities which can be elaborated naturally in theframework of our approach. Some definitions Let us give some definitions which we use inthe following.1. K - basis is a general name for ”trian-gle” set of linear independent vectors V ( K ) k ( k = k , . . . , k K ).2. K - basis is the K -basis for a basic ten-sor considered as a separate tensor ex-pression, taking into account its sym-metries and linear identities only.3. K M - basis is the K - basis of the expres-sion under consideration which arisesfrom K - bases of basic tensors and re-lations generated by their multiplica-tion.4. K D - basis is the completion of the K M - basis up to the full K - basis of theexpression under consideration, tak-ing into account relations which arisefrom renamings of dummy indices.We shall also call this basis the full K - basis .5. To sieve some S − I − D vector meansto do the step m of the ”triangle” pro-cedure (3).6. To rearrange some S − I − D vectormeans to do the step m of the ”trian-gle” procedure (4).7. To sieve some vector A by a K - basis means to apply the transformation(5). There are two sets of operations. One is per-formed due to the introduction of new basictensors, and the result of these operations is the construction of the new K -bases. An-other set of operations is connected with thesimplification of tensor expressions itself.The starting procedure for the construc-tion of K -bases is T SY M (section 8.4),and the algorithm is:1. Generate full list of S-I vectors (1): L S − I = { v } .2. Let K = K where K is initial basis(may be empty).3. If the list L S − I is empty then finish.4. Take the next vector v from L S − I and delete it from this list: L S − I → L S − I / { v } .5. Sieve the vector v through the K -basis (transformation (3), procedure sieve pv , section 7.7). The result isa new vector v ′ .6. If v ′ = 0 then insert v ′ in the K -basisand rearrange the basis (transforma-tion (4), procedure insert pv , section7.7).7. Repeat from step 3.All K -bases are stored. There is a pos-sibility to delete any basic tensor from thelist of tensors and so to delete its K -basis(section 8.3).The algorithm of simplification of tensorexpressions is:1. If there is no multiplication of tensorsor there are no new S-I relations dueto their multiplication then go to step‘ ’.2. Expand the K -bases involved up tothe necessary rank of the permutation6roup corresponding to the multipli-cation of basic tensors in the expres-sion elaborated (procedure t upright ,section 7.5), and collect the obtainedrelations as the initial K -basis of theconsidered expression.3. Complete the K -basis by additionalvectors which arise from the multi-plication (see section 4) by the algo-rithm of the K -basis construction (seeabove). The result is the K M -basis forthe expression under simplification.4. Dummies. Complete the K M -basisby vectors corresponding to the rela-tions which arise from renamings ofdummy indices (if they are present).The result is the K D -basis - the full K -basis for the expression under sim-plification.5. Sieve the tensor expression throughthe K D -basis (transformation (5),procedure sieve t , section 7.7). Theresult is the construction of the canon-ical representative for the expression.Any K M and K D -bases are not storedand are constructed each time an expressionis simplified. ATENSOR program consists of the follow-ing blocks: • interface with REDUCE system; • generator of permutations; • p-vector arithmetics; • tensor arithmetics; • generator of the multiplication rela-tions; • generator of the dummy relations; • utilities to work with K -bases. Interface with REDUCE is implemented bydefining of a domain [10]. This is a natu-ral way to implement a new object in RE-DUCE. We should define the following setof procedures: Operation Internal proc. Commentminus t minus Unary minusplus t plus Summtimes t times Productdifference t difference Substructionzerop t zerop Does tensorequal zero?prepfn t prepprifn t pri Print functionintequiv tintequiv Is tensor equi-valent tointeger The following procedures must be definefor completeness but can not be used as op-erations for tensors. These procedures pro-duce an error message if called.7 peration Internal proc. Commentexpt t expt Powerquotient t quotientdivide t dividegcd t gcd Great commondividerminusp t minusp Is tensornegative?onep t onep Does tensorequal 1?i2d i2tensor Transformintegerto tensorWe also define the domain name( T EN SOR ) and the tag (! : T EN SOR ).To complete the interface with REDUCE,we add the tag of the tensor domain to theglobal variable DOM AIN LIST ! ∗ This method supports the input process oftensor expressions and provides calls of the cor-responding internal procedures automatically. This block implements generation of permuta-tions of N order and includes some proceduresfor working with them. All procedures workwith the packed and the unpacked form of per-mutations. Unpacked form of a permutation p is a listof numbers : p = ( d d ... d k ) , ≤ d i ≤ k ≤ . Packed form is the corresponding number: p = d d ...d k . For example, p = (1 2 3 4 5) and p = 12345 . The transformation of a permutation fromone form to another is made automatically.The packed form is more economic with respect see section 9 for details. to computer memory, but requires more time toproceed. There is the global variable ! ∗ ppacked .If it is T (the default value) then all permuta-tions are packed; if N IL then they are storedin the unpacked form.We use the well known algorithm for gener-ation of permutations [12]. We implement thefollowing procedures: • mkunitp ( n ) – generates the unit elementof S n ; • pf ind ( p , p ) – returns x such that p = x ◦ p ; • prev ( p ) – returns reverse permutation x such that x ◦ p = 1; • psign ( p ) – returns ( − k , where k is thenumber of transpositions which are nec-essary to apply to the permutation p toget the identical permutation. • pmult ( p , p ) – returns the permutation x = p ◦ p ; • pappl ( p, l ) – returns l with the elementspermuted by p , so that l is replaced by p ( l ).There are some utilities to work with per-mutations:– pupright ( p, d ) – extends the permutation p ∈ S n to the right up to the element of S n + d with the identical permutation ofthe extra indices (this utility is used forthe elaboration of multiplication of basictensors);– puplef t ( p, d ) – extends the permutation p ∈ S n to the left up to the element of S n + d with the identical permutation ofthe extra indices (this utility is used forthe elaboration of multiplication of basictensors);– pappend ( p , p ) - concatenates the per-mutation p ∈ S n with the permutation p ∈ S n . Returns the element of S n + n ; pkp ( p ) – packs the permutation p ;– unpkp ( p ) – unpacks the permutation p . P -vectors are one of the main objects in theprogram. They represent the vector in R n –the group algebra of S n . In the program theyare implemented as a REDUCE domain [10].Internal structure of p -vector is: p − vector ::= (! : pv . p − list ) p − list ::= N IL | ( coef f . perm ) . p − listcoef f ::= integer All the standard operations are defined for p -vectors because they form a domain.The following procedures are used for tensorsimplification: • pv sort ( pv ) – sorts the p -list so that allpermutation will be ordered, e.g. p i >p j ∀ i < j ; • pv compress ( pv ) – removes all termswith zero coefficient; • pv renorm ( pv ) – reduces the first coeffi-cient (in integer numbers), i.e. pv → pv/GCD ( c , c , ... ) where c i arethe coefficients.Some utilities are available to work with p -vectors:– pappl pv ( p, pv ) – applies the permuta-tion p to the p -vector pv .Returns p ′ = P i c i pmult ( p, p i ) where pv = P i c i p i ;– pv applp ( pv, v ) – applies the p -vector pv to the permutation p .Returns p ′ = P i c i pmult ( p i , p ) where pv = P i c i p i ;– pv upright ( pv, d ) - expands the p -vector pv to the right.Returns p ′ = P i c i pupright ( p i , d ) where pv = P i c i p i ; – pv uplef t ( pv, d ) - extends the p -vector pv to the left.Returns p ′ = P i c i puplef t ( p i , d ) where pv = P i c i p i . Tensors are the main objects in the program.They represent tensor expressions. In the pro-gram they are implemented as a REDUCE do-main [10].The internal structure of a tensor is: tensor ::= (! : tensor i − tensor ... i − tensor k ) i − tensor ::= ( t − header t − list ) t − list ::= N IL | p − list . t − listt − header ::= ( t − name i − list ) t − name ::= ( t t ... t k ) i − list ::= ( i i ... i l )where t , t , ..., t k are basic tensors identifiers,and i , i , ..., i l are indices (identifiers).Let us consider an example tensor expres-sion and its representation in the internal no-tations.Let tt ( i, j ) be a tensor of second order. Theinternal representation is(! : tensor ((( tt ) ( i j )) (1 . tt ( i, j ) + tt ( j, i )will have the internal representation(! : tensor ((( tt ) ( i j )) (1 . 21) (1 . t simp . The resultof this procedure is the canonical form of thetensor expression, i.e. the sieved vector t ′ ∈ L . The main procedures of the tensor multiplica-tion block are the following: t split ( tt ) - splits a term of the tensorexpression into the list of basic tensorsas factors; • t f use ( tf , tf ) - combines tensor factors tf and tf into the product. This oper-ation is reverse to the previous one; • addmultsym ( t , t ) - adds symmetry andmultiterm linear identity relations gen-erated by the multiplication to the K -basis.Some utilities are available to work with ten-sors. • t upright ( tt, th ) - extends the tensor tt to the right with respect to the t -header th ; • t uplef t ( tt, th ) - extends the tensor tt tothe left with respect to the t -header th ; • t pri ( tt ) - outputs the tensor tt in thenatural form. Dummy relations are created in the process ofevaluation of a tensor expressions. Their num-ber may be very large and unpredictable in ad-vance. Therefore we do not save D -relations incontrast to S and I ones. This leads to the lossof time but saves the memory.During simplification of tensor expressionswe use internal names for indices. Originalnames are saved and used in the I/O process.Thus, if we have, for example, a dummy index i (really there are two such names in the expres-sion considered) then it will be replaced withtwo internal names: nn and mm, where mm = nn + 1. The original name isstored as a special property of the new ones.The dummy block produces relations gen-erated by renamings of dummies. The mainprocedures are the following: • adddummy ( tt ) - adds the new relationsto the K -basis; • dl get ( il ) - returns the list of dummy in-dices from the index list il ; • il simp ( il ) - replaces original names ofthe dummy indices with their internalnames; • mk dsym ( t ) - returns the list of tensorrelations with changed dummy indices ineach pair; • mk ddsym ( t ) - returns the list of tensorrelations with permuted pairs of dummyindices. This block contains the procedures for workingwith K -bases.All K -bases for various tensor expressionsare stored as lists in the global variable! ∗ basis ::= ( k − basis k − basis ... )The structure of the basis is: k − basis ::= ( t − header ) . t − list where the header t and the list t are definedabove.The main procedures are the following: • sieve pv ( pv, b ) – sieves the p -vector pv using the basis b . This procedure isused for the construction of the K -basis(”triangle” transformation (3,4)) and forthe simplification of tensors expressions(projection to the canonical element (5)).This is the main step of the function sieve t .; • reduce pv ( pv, qv ) - reduces the p -vector pv with respect to the p -vector qv . Thisis the main step of the function sieve pv .; insert pv ( pv, b ) - inserts the p -vector pv into the basis b . This procedure also re-arranges b with respect to pv . • sieve t ( tt ) - sieves the tensor tt using thecorresponding K -basis. The first step ofthis procedure is generation of relationsdue to renamings of dummies and thecorresponding completion of K M up to K D -basis. In this section we describes the main globalvariables which allow a user to control thework. We show the default values in brackets. • ! ∗ ppacked ( T ) - are permutations storedin packed form? • ! ∗ debug ( N IL ) - switches the debug out-put on. To simplify the user interface, we restricted thenumber of additional commands. The names ofthese commands are very similar to the stan-dard REDUCE ones used in similar cases. K BASI S The command KBASIS prints the tensor K -basis.The number of vectors in the basis, i.e. thedimension of the corresponding subspace K , istyped in the last line of the output. Format ofthis command is: KBASIS tt , tt , ..., tt n ;Here tt , tt , ..., tt n are tensor names.To output the K -basis in the case of the mul-tiplication of two or more tensors, it is neces-sary to use the following format of the com-mand: KBASIS t ( t , ..., t k ) , . . . ;Here t , t , . . . are the names of tensor factors.If some names have not been declared as ten-sors the message is produced ***** basis1 *** Invalid as tensor: tt T EN SOR The command T EN SOR declares new tensors.Format of this command is: T EN SOR t , t , ..., t n ;Here t , t , ..., t n are identifiers. The number ofindices will be fixed during the first evaluationof a tensor expressions.If some names have been declared as tensorsalready the message is produced: +++ tt is already declared as tensor. T C LEAR The command T CLEAR removes tensors fromthe list of tensors. Format of this command is: T CLEAR t , t , ..., t n ;Here t , t , ..., t n are the names of tensor (iden-tifiers).If some names have not been declared as ten-sors the message is produced +++ xxx is not a tensor.Note: All K -bases where any of t i is in-cluded as a factor will be lost. T SY M The command T SY M defines symmetry rela-tions of basic tensors. Format of this commandis: T SY M te , te , ..., te k ;Here te , te , ..., te k are linear combinations ofbasic tensors with integer coefficients not con-taining without dummy indices. ll relations correspond to the left handside of the symmetry equations. For example,for antisymmetric tensor we have the relation AA ( i, j ) + AA ( j, i ) = 0. Thus, the correspond-ing input format is: T SY M AA ( I, J ) + AA ( J, I ); The standard algebraic operations are availablefor tensors:+ sum of tensors; − difference of tensors or negation; ∗ multiplication of tensors.We assume that two indices with identicalnames means the summation over their values(the Einstein convention) - they are dummyones. Thus, the multiplication of two tensorsmay be either a direct product, or it can con-tain contractions of dummy indices.Examples: t ( i, j ) ∗ t ( j, k ); t ( i, j ) + 2 ∗ t ( j, i ); DU M M Y P RI This switch is controlled by the standard RE-DUCE commands ON / OF F . It controls theoutput process for tensor expressions. The de-fault value is OF F . DU M M Y P RI prints dummy indices withinternal names – numbers. The general ruleis:the index (2 k − 1) is contracted with the index(2 k ).Examples : T EN SOR GG ; GG ( M, M ); ⇒ GG ( M, M ) ON DU M M Y P RI ; GG ( M, M ); ⇒ GG ( M , M ) Here and below REDUCE output is given afterthe arrow ” ⇒ ”. SH ORT EST This switch is controlled by the standard RE-DUCE commands ON / OF F . It controls theoutput process for tensor expressions. The de-fault value is OF F . SHORT EST prints tensor expression inshortest form that was produced during eval-uation. Hoever, the sortest form may be non-canonical. T EN SOR C ; T SY M C ( K, L, M ) + C ( L, M, K ) + C ( M, K, L ); C ( K, L, M ) + C ( M, L, K ); ⇒ ( − ∗ C ( L, M, K ) + ( − ∗ C ( M, K, L ) + C ( M, L, K ) ON SHORT EST ; C ( K, L, M ) + C ( M, L, K ); ⇒ C ( K, L, M ) + C ( M, L, K ) Let us consider simplification of a tensor ex-pressions with n indices. The rank of the cor-responding permutation group is n and thedimension of its group algebra is n !. Letus consider two cases: when there are many S − I − D relations (so that the dimension ofthe K subspace is almost equal to n !) and whenthere are small number of S − I − D relations(so that the dimension of the K subspace issmall).In the first case, about n ! · l · k Lisp cellsare necessary to store the full K D -basis. Here l is the number of cells needed to store a singleterm of a p -vector, and k is the average numberof terms in vectors from this K D -basis. Thenumber of terms in these vectors ( k ) is about2 − O (1), and can be omitted from this estimate.In the case of a small set of symmetries andlinear identities of basic tensors, the number ofvectors in the full K D -basis is small enough,and can be omitted from this estimate. How- ver, the number of terms in a canonical rep-resentative (the expression after simplification)will be about n !.Anyway, we have to work with a practi-cally full set of permutations, which contains n ! members.Thus, the minimum computer memory nec-essary to store the elaborated expressions is notless then n ! · l · k . The typical number of Lispcells necessary to store a single term of a tensorexpressions (basic tensor) is 4. The length ofeach cell is 8 Byte. The results of calculationfor different ranks of the permutation group arecollected in the table.Rank of S n Number ofMcells Memory inMbyte9 2.9 22.610 29.0 226.811 319.3 2494.82–3 times more memory is necessary in theintermediate steps of calculations. Moderncomputers usually equipped with up to 512Mbyte memory can elaborate tensor expres-sions with not more then 10 indices with thehelp of the proposed algorithm. However, hard-ware development is very fast now, and it willbe possible to solve problems with 11 indiceswith the help of our program. Finally, we notethat it possible to modify the algorithm so thatthe memory limitations would be not so hard.However, this advantage is compensated by asignificant increase of the execution time. Tosummarize this section, we conclude that theabsolute limit for the group algebra approachdeveloped in this work is 12 indices. 10 Examples At the beginning, let us declare the names ofbasic tensors: tensor s , a , v , v , v 3; By using T SY M command we introduce the S-I relations of the basic tensors: tsym s i, j ) − s j, i ) , % Symmetric a i, j, k ) + a j, i, k ) , % Antisymm. a i, j, k ) − a j, k, i );Let us output the K -bases constructed forthe tensors a and s kbasis s , a ⇒ s j, i ) + ( − ∗ s i, j ) ⇒ ⇒ a k, i, j ) + a j, i, k ) ⇒ a k, j, i ) + ( − ∗ a j, i, k ) ⇒ a i, k, j ) + ( − ∗ a j, i, k ) ⇒ a i, j, k ) + a j, i, k ) ⇒ a j, k, i ) + a j, i, k ) ⇒ s i, j ) + s j, i ); ⇒ ∗ s i, j ) a i, j, k ) ∗ s i, j ); ⇒ a i, j, k ) ∗ v i ) ∗ v j ) ∗ v k ); ⇒ x := s i, i ); ⇒ x := s i, i ) x ∗ v i ); ⇒ s i, i ) ∗ v i )From the standard point of view, the secondoutput is incorrect due to the fact that threeindices with the same name are present. How-ever, the input has not been recognized as anerror. If one switches on the flag on dummypri ;and then repeats the previous input then onegets the following output: x ∗ v i ); ⇒ s i , i ) ∗ v i )Hence, the first two i ’s are dummies and thelast one is a free index.If a user would like to output the K -basis ofthe product of the tensors s and a , the fol- owing format of the command KBASIS hasto be used: kbasis s a ⇒ a j, i, k ) ∗ s i, j ) + a k, i, j ) ∗ s j, i ) ⇒ a j, i, k ) ∗ s j, i ) + a k, i, j ) ∗ s j, i )..... ⇒ Let us introduce the Riemann tensor and thestandard set of its S-I relations: tensor ri ; tsym ri ( i, j, k, l ) + ri ( j, i, k, l ); tsym ri ( i, j, k, l ) + ri ( i, j, l, k ); tsym ri ( i, j, k, l ) + ri ( i, k, l, j ) + ri ( i, l, j, k );The K -basis consists of 22 vectors (seeTEST RUN OUTPUT) and the full vectorspace has 4! = 24 dimensions. Thus, any ex-pressions which are linear combinations of Rie-mann tensors with permuted indices can besimplified to expressions containing only twobasic tensors .This set of properties leads us to the veryimportant symmetry property of Riemann ten-sor with respect to the exchange of pairs of in-dices: ri ( i, j, k, l ) − ri ( k, l, i, j ); ⇒ ri ( m, n, m, n ) − ri ( m, n, n, m ) ⇒ ∗ ri ( m, n, m, n ).Any tensors expressions consists of Riemantensors may be expressed through summ of 2ones: ri ( i, j, k, l ) + ri ( j, k, l, i ) + ri ( k, l, i, j ) + ri ( l, i, j, k ); ⇒ ( − ∗ ri ( l, j, i, k ) + 4 ∗ ri ( l, i, j, k )A more complicated example with multipli-cation of the Riemann tensor and the antisym- This simplification has no relation to the num-ber of independent components of the Riemann cur-vature tensor in space-time of various dimensions metric tensor a TESTRUN OUTPUT . Acknowledgements The authors are grateful to A.Grozin for usefuldiscussions.This work was supported by Russian Foun-dation for Fundamental Research (grant 93-02-14428). References [1] L.D.Landau and E.M.Lifshitz, Field The-ory , (Moscow, Nauka, 1973, in Russian);J.A.Schouten, Tensor analysis for physicist ,(Oxford, 1951).[2] A.Trautman, Symp. Math. , (1973) 139;F.W.Hehl et al., Rev. Mod. Phys. , (1976)393;Yu.N.Obukhov and P.I.Pronin, Acta PhysicaPolonica , B19 (1988) 341.[3] A.Ya.Rodionov and A.Yu.Taranov, LectureNotes in Comp. Sci. , (Proceedins of EU-ROCAL’87, 1989) 192[4] V.A.Ilyin et al., in: Proc. of IV Inter-national conference on computer algebra inphysical research (Dubna 1990, 22-26 May,USSR) Theory of group representa-tion , (Moscow, Nauka, 1976, in Russian).[6] B.Buchburger, G.E.Collins and R.Loos, Computer Algebra - symbolic and alge-braic computation , (second edition, Springer,1983).[7] A.C.Hearn, REDUCE USER’S MANUAL,version 3.3 , (The Rand publication CP78,Rev. 7.87, 1987).[8] V.A.Ilyin and A.P.Kryukov, in Proc. ofthe Int. Symp. of Symbolic. and Algebraic omputation (ISSAC’91), July 15-17, 1991,Bonn, Ed. by S.Watt, ACM Press (1991)224.[9] V.A.Ilyin and A.P.Kryukov, in ”New Com-puting techniques in Physics Research II”,Proc. of AIHENP-92, Ed. by D.Perret-Gallix, World Scientific, Singapore, (1992)639-648.[10] R.J. Bradford, A.C. Hearn, J.A. Padgetand E. Schr¨ufer, “Enlarging the REDUCE