DUMMY.LOG 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
  2. % test of DUMMY package version 1.0 running in REDUCE 3.5
  3. % DATE: 15 February 1994
  4. % Authors: A. Dresse <adresse@ulb.ac.be>
  5. % H. Caprasse <caprasse@vm1.ulg.ac.be>
  6. %
  7. % Case of commuting operator:
  8. %
  9. operator co1,co2;
  10. % declare dummy indices
  11. % first syntax : base <name>
  12. %
  13. dummy_base dv;
  14. dv
  15. % dummy indices are dv1, dv2, dv3, ...
  16. exp := co2(dv2)*co2(dv2)$
  17. c_exp := canonical(exp);
  18. 2
  19. c_exp := co2(dv1)
  20. exp := dv2*co2(dv2)*co2(dv2)$
  21. c_exp := canonical(exp);
  22. 2
  23. c_exp := co2(dv1) *dv1
  24. exp := c_exp * co1(dv3);
  25. 2
  26. exp := co1(dv3)*co2(dv1) *dv1
  27. c_exp := canonical(exp);
  28. 2
  29. c_exp := co1(dv2)*co2(dv1) *dv1
  30. % aliases for dummy indices
  31. %
  32. dummy_names i,j,k;
  33. t
  34. canonical(c_exp);
  35. 2
  36. co1(j)*co2(i) *i
  37. % remove dummy_names
  38. clear_dummy_names;
  39. t
  40. % Case of anticommuting operators
  41. %
  42. operator ao1, ao2;
  43. anticom ao1, ao2;
  44. % product of anticommuting operators with FREE indices
  45. a_exp := ao1(s1)*ao1(s2) - ao1(s2)*ao1(s1);
  46. a_exp := ao1(s1)*ao1(s2) - ao1(s2)*ao1(s1)
  47. a_exp := canonical(a_exp);
  48. a_exp := 2*ao1(s1)*ao1(s2)
  49. % the indices are summed upon, i.e. are DUMMY indices
  50. a_exp := ao1(dv1)*ao1(dv2)$
  51. canonical(a_exp);
  52. 0
  53. a_exp := ao1(dv1)*ao1(dv2) - ao1(dv2)*ao1(dv1);
  54. a_exp := ao1(dv1)*ao1(dv2) - ao1(dv2)*ao1(dv1)
  55. a_exp := canonical(a_exp);
  56. a_exp := 0
  57. a_exp := ao1(dv2,dv3)*ao2(dv1,dv2)$
  58. a_exp := canonical(a_exp);
  59. a_exp := ao1(dv2,dv1)*ao2(dv1,dv3)
  60. a_exp := ao1(dv1)*ao1(dv3)*ao2(dv3)*ao2(dv1)$
  61. a_exp := canonical(a_exp);
  62. a_exp := - ao1(dv1)*ao1(dv2)*ao2(dv1)*ao2(dv2)
  63. % Case of non commuting operators
  64. %
  65. operator no1, no2, no3;
  66. noncom no1, no2, no3;
  67. n_exp := no3(dv2)*no2(dv3)*no1(dv1) + no3(dv3)*no2(dv1)*no1(dv2)
  68. + no3(dv1)*no2(dv2)*no1(dv3);
  69. n_exp := no3(dv1)*no2(dv2)*no1(dv3) + no3(dv2)*no2(dv3)*no1(dv1)
  70. + no3(dv3)*no2(dv1)*no1(dv2)
  71. n_exp:=canonical n_exp;
  72. n_exp := 3*no3(dv3)*no2(dv2)*no1(dv1)
  73. % Case of mixed commutation properties
  74. % ***
  75. % The example below displays a restriction of the package i.e
  76. % The non commuting operators are ASSUMED to COMMUTE with the
  77. % anticommuting operators.
  78. % ***
  79. exp := co1(dv1)*ao1(dv2,dv1,dv4)*no1(dv1,dv5)*co2(dv3)*ao1(dv1,dv3);
  80. exp := co1(dv1)*co2(dv3)*(ao1(dv2,dv1,dv4)*no1(dv1,dv5)*ao1(dv1,dv3))
  81. canonical(exp);
  82. - co1(dv1)*co2(dv2)*ao1(dv2,dv1)*ao1(dv4,dv1,dv3)*no1(dv5,dv1)
  83. exp := c_exp * a_exp * no3(dv2)*no2(dv3)*no1(dv1);
  84. 2
  85. exp := - co1(dv2)*co2(dv1) *dv1*ao1(dv1)*ao1(dv2)*ao2(dv1)*ao2(dv2)*no3(dv2)
  86. *no2(dv3)*no1(dv1)
  87. can_exp := canonical(exp);
  88. 2
  89. can_exp := - co1(dv2)*co2(dv1) *dv1*ao1(dv1)*ao1(dv2)*ao2(dv1)*ao2(dv2)
  90. *no3(dv2)*no2(dv3)*no1(dv1)
  91. % Case of internal symmetries of operators
  92. %
  93. operator as1, as2;
  94. antisymmetric as1, as2;
  95. clear_dummy_base ;
  96. t
  97. dummy_base s;
  98. s
  99. % First a non trivial expression:
  100. asc_exp:=as1(s1,s2)*as1(s1,s3)*as1(s3,s4)*co1(s3)*co1(s4)+
  101. 2*as1(s1,s2)*as1(s1,s3)*as1(s3,s4)*co1(s2)*co1(s4)$
  102. canonical asc_exp;
  103. - as1(s1,s2)*as1(s1,s3)*as1(s3,s4)*co1(s3)*co1(s4)
  104. % Second simple illustrative examples:
  105. clear_dummy_base;
  106. t
  107. dummy_base dv;
  108. dv
  109. exp1 := ao1(dv1)*ao1(dv2)$
  110. canonical(exp1);
  111. 0
  112. exp2 := as1(dv1,dv2)$
  113. canonical(exp2);
  114. 0
  115. canonical(exp1*exp2);
  116. - as1(dv1,dv2)*ao1(dv1)*ao1(dv2)
  117. canonical(as1(dv1,dv2)*as2(dv2,dv1));
  118. - as1(dv1,dv2)*as2(dv1,dv2)
  119. operator ss1, ss2;
  120. symmetric ss1, ss2;
  121. exp := ss1(dv1,dv2)*ss2(dv1,dv2) - ss1(dv2,dv3)*ss2(dv2,dv3);
  122. exp := ss1(dv1,dv2)*ss2(dv1,dv2) - ss1(dv2,dv3)*ss2(dv2,dv3)
  123. canonical(exp);
  124. 0
  125. exp := as1(dv1,dv2)*as1(dv3,dv4)*as1(dv1,dv4);
  126. exp := as1(dv1,dv2)*as1(dv1,dv4)*as1(dv3,dv4)
  127. canonical(exp);
  128. 0
  129. % Indeed the result is equal to half the sum given below:
  130. %
  131. exp + sub(dv2 = dv3, dv3 = dv2, dv1 = dv4, dv4 = dv1, exp);
  132. 0
  133. exp1 := as2(dv3,dv2)*as1(dv3,dv4)*as1(dv1,dv2)*as1(dv1,dv4);
  134. exp1 := - as1(dv1,dv2)*as1(dv1,dv4)*as1(dv3,dv4)*as2(dv2,dv3)
  135. canonical(exp1);
  136. as1(dv1,dv2)*as1(dv1,dv3)*as1(dv3,dv4)*as2(dv2,dv4)
  137. exp2 := as2(dv1,dv4)*as1(dv1,dv3)*as1(dv2,dv4)*as1(dv2,dv3);
  138. exp2 := as1(dv1,dv3)*as1(dv2,dv3)*as1(dv2,dv4)*as2(dv1,dv4)
  139. canonical(exp2);
  140. as1(dv1,dv2)*as1(dv1,dv3)*as1(dv3,dv4)*as2(dv2,dv4)
  141. canonical(exp1-exp2);
  142. 0
  143. % Indeed:
  144. %
  145. exp2 - sub(dv1 = dv3, dv2 = dv1, dv3 = dv4, dv4 = dv2, exp1);
  146. 0
  147. % Declare the internal symmetry properties of the Riemann tensor
  148. %
  149. operator r;
  150. symtree (r, {!+, {!-, 1, 2}, {!-, 3, 4}});
  151. canonical( r(x,y,z,t) );
  152. - r(t,z,x,y)
  153. canonical( r(x,y,t,z) );
  154. r(t,z,x,y)
  155. canonical( r(t,z,y,x) );
  156. - r(t,z,x,y)
  157. exp := r(dv1, dv2, dv3, dv4) * r(dv2, dv1, dv4, dv3)$
  158. canonical(exp);
  159. 2
  160. r(dv4,dv3,dv2,dv1)
  161. exp := r(dv1, dv2, dv3, dv4) * r(dv1, dv3, dv2, dv4)$
  162. canonical(exp);
  163. r(dv4,dv2,dv3,dv1)*r(dv4,dv3,dv2,dv1)
  164. dummy_names i,j,k,l;
  165. t
  166. canonical(exp);
  167. r(l,j,k,i)*r(l,k,j,i)
  168. exp := r(i,j,k,l)*ao1(i,j)*ao1(k,l);
  169. exp := r(i,j,k,l)*ao1(i,j)*ao1(k,l)
  170. canonical(exp);
  171. 0
  172. exp := r(k,i,l,j)*as1(k,i)*as1(k,j);
  173. exp := as1(i,k)*as1(j,k)*r(k,i,l,j)
  174. canonical(exp);
  175. - as1(i,j)*as1(i,k)*r(l,j,k,i)
  176. clear_dummy_names;
  177. t
  178. clear_dummy_base;
  179. t
  180. exp := co1(dv3)$
  181. c_exp := canonical(exp);
  182. c_exp := co1(dv3)
  183. end;
  184. (TIME: dummy 420 420)