123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- Sun Jan 3 23:49:10 MET 1999
- REDUCE 3.7, 15-Jan-99 ...
- 1: 1:
- 2: 2: 2: 2: 2: 2: 2: 2: 2:
- 3: 3: %*********************************************************************
- % ATENSOR TEST RUN.
- %
- % V.A.Ilyin & A.P.Kryukov
- % E-mail: ilyin@theory.npi.msu.su
- % kryukov@theory.npi.msu.su
- %
- % Nucl. Phys. Inst., Moscow State Univ.
- % 119899 Moscow, RUSSIA
- %*********************************************************************
- % First of all we have to load the ATENSOR program using the one of the
- % following command:
- % 1) in "atensor.red"$ % If we load source code
- % 2) load atensor$ % If we load binary (compiled) code.
- load atensor;
- % To control of total execution time clear timer:
- showtime;
- Time: 0 ms
- % Switch on the switch TIME to control of executing time
- % for each statement.
- %on time$
- % Let us introduce the antisymmetric tensor of the second order.
- tensor a2;
- % The antisymmetric property can be expressed as:
- tsym a2(i,j)+a2(j,i);
- % The K-basis that span K subspace is:
- kbasis a2;
- a2(i,j) + a2(j,i)
- 1
- % Let us input very simple example:
- a2(k,k);
- 0
- % By the way the next two expressions looks like different ones:
- a2(i,j);
- a2(i,j)
- a2(j,i);
- a2(j,i)
- % But the difference of them has a correct value:
- a2(j,i)-a2(i,j);
- 2*a2(j,i)
- % Next examples. For this purpose we introduce 3 abstract
- % vectors - v1,v2,v3:
- tensor v1,v2,v3;
- % The following expression equal zero:
- a2(i,j)*v1(i)*v1(j);
- 0
- % It is interest that the result is consequence of the equivalence
- % of the name of tensors.
- % While the next one - not:
- a2(i,j)*v1(i)*v2(j);
- a2(i,j)*v1(i)*v2(j)
- % Well. Let us introduce the symmetric tensor of the second order.
- tensor s2;
- tsym s2(i,j)-s2(j,i);
- % Their K-basis look like for a2 excepted sign:
- kbasis s2;
- s2(j,i) + (-1)*s2(i,j)
- 1
- % Of course the contraction symmetric and antisymmetric tensors
- % equal zero:
- a2(i,j)*s2(i,j);
- 0
- % By the way, the next example not so trivial for computer...
- a2(i,j)*a2(j,k)*a2(k,i);
- 0
- % Much more interesting examples we can demonstrate with the
- % the tensor higher order. For example full antisymmetric tensor
- % of the third order:
- tensor a3;
- % The antisymmetric property we can introduce through the
- % permutation of the two first indices:
- tsym a3(i,j,k)+a3(j,i,k);
- % And the cyclic permutation all of them:
- tsym a3(i,j,k)-a3(j,k,i);
- % The K basis of a3 consist of 5 vectors:
- kbasis a3;
- a3(k,i,j) + a3(j,i,k)
- a3(k,j,i) + (-1)*a3(j,i,k)
- a3(i,k,j) + (-1)*a3(j,i,k)
- a3(i,j,k) + a3(j,i,k)
- a3(j,k,i) + a3(j,i,k)
- 5
- % In the beginning some very simple examples:
- a3(i,k,i);
- 0
- a3(i,j,k)*s2(i,j);
- 0
- % The full symmetric tensor of the third order may be introduce
- % by the similar way:
- tensor s3;
- tsym s3(i,j,k)-s3(j,i,k);
- tsym s3(i,j,k)-s3(j,k,i);
- kbasis s3;
- s3(k,j,i) + (-1)*s3(i,j,k)
- s3(k,i,j) + (-1)*s3(i,j,k)
- s3(j,k,i) + (-1)*s3(i,j,k)
- s3(j,i,k) + (-1)*s3(i,j,k)
- s3(i,k,j) + (-1)*s3(i,j,k)
- 5
- % The next examples demonstrate some calculation with them:
- s3(i,j,k)-s3(i,k,j);
- 0
- s3(i,j,k)*a2(i,j);
- 0
- a3(i,j,k)*s2(i,j);
- 0
- s3(i,j,k)*a3(i,j,k);
- 0
- % Now we consider very important physical case - Rieman tensor:
- tensor ri;
- % It has the antisymmetric property with respect to the permutation
- % of the first two indices:
- tsym ri(i,j,k,l) + ri(j,i,k,l);
- % It has the antisymmetric property with respect to the permutation
- % of the second two indices:
- tsym ri(i,j,k,l) + ri(i,j,l,k);
- % And the triple term identity with cyclic permutation the
- % third of them:
- tsym ri(i,j,k,l) + ri(i,k,l,j) + ri(i,l,j,k);
- % The corresponding K basis consist of 22(!) vectors:
- kbasis ri;
- ri(l,k,i,j) + (-1)*ri(j,i,k,l)
- ri(l,k,j,i) + ri(j,i,k,l)
- ri(l,i,k,j) + (-1)*ri(j,k,i,l)
- ri(l,i,j,k) + ri(j,k,i,l)
- ri(l,j,k,i) + (-1)*ri(j,k,i,l) + ri(j,i,k,l)
- ri(l,j,i,k) + ri(j,k,i,l) + (-1)*ri(j,i,k,l)
- ri(k,l,i,j) + ri(j,i,k,l)
- ri(k,l,j,i) + (-1)*ri(j,i,k,l)
- ri(k,i,l,j) + (-1)*ri(j,k,i,l) + ri(j,i,k,l)
- ri(k,i,j,l) + ri(j,k,i,l) + (-1)*ri(j,i,k,l)
- ri(k,j,l,i) + (-1)*ri(j,k,i,l)
- ri(k,j,i,l) + ri(j,k,i,l)
- ri(i,l,k,j) + ri(j,k,i,l)
- ri(i,l,j,k) + (-1)*ri(j,k,i,l)
- ri(i,k,l,j) + ri(j,k,i,l) + (-1)*ri(j,i,k,l)
- ri(i,k,j,l) + (-1)*ri(j,k,i,l) + ri(j,i,k,l)
- ri(i,j,l,k) + (-1)*ri(j,i,k,l)
- ri(i,j,k,l) + ri(j,i,k,l)
- ri(j,l,k,i) + ri(j,k,i,l) + (-1)*ri(j,i,k,l)
- ri(j,l,i,k) + (-1)*ri(j,k,i,l) + ri(j,i,k,l)
- ri(j,k,l,i) + ri(j,k,i,l)
- ri(j,i,l,k) + ri(j,i,k,l)
- 22
- % So we get the answer for any expressions with 3 and more terms of
- % Rieman tensors with not more then 2 terms. For example:
- ri(i,j,k,l)+ri(j,k,l,i)+ri(k,l,i,j)+ri(l,i,j,k);
- (-2)*ri(l,j,i,k) + 4*ri(l,i,j,k)
-
- % This three identities leads us to very important symmetry property with
- % respect to exchange of pairs indices:
- ri(i,j,k,l)-ri(k,l,i,j);
- 0
- % Let us start with simple example:
- ri(m,n,m,n)-ri(m,n,n,m);
- 2*ri(m,n,m,n)
- % Much more complicated example is:
- a2(m,n)*ri(m,n,c,d) + a2(k,l)*ri(c,d,l,k);
- 0
- % The answer is trivial but not so simple to obtain one.
- % The dimension of the full space is 6! = 720.
- % The K basis consists of 690 vectors (to reduce output we
- % commented the last statement):
- %kbasis ri(a2);
- % One else nontrivial examples with Riemann tensors:
- (ri(i,j,k,l)-ri(i,k,j,l))*a2(i,j);
- a2(i,j)*ri(i,j,k,l)
- ---------------------
- 2
- %***************** END OF TEST RUN ************************
- % The total execution time is:
- showtime;
- Time: 57930 ms plus GC time: 1520 ms
- $
- END$
- 4: 4: 4: 4: 4: 4: 4: 4: 4:
- Time for test: 59450 ms, plus GC time: 1520 ms
- 5: 5:
- Quitting
- Sun Jan 3 23:50:12 MET 1999
|