lie1234.red 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270
  1. module lie1234;
  2. % n-dimensional Lie algebras up to n=4.
  3. % Author: Carsten and Franziska Schoebel.
  4. % e-mail: cschoeb@aix550.informatik.uni-leipzig.de .
  5. % Copyright (c) 1993 The Leipzig University, Computer Science Dept.
  6. % All Rights Reserved.
  7. algebraic;
  8. operator liealg,comtab;
  9. algebraic procedure lieclass(dim);
  10. begin
  11. if not(dim=1 or dim=2 or dim=3 or dim=4) then
  12. symbolic rederr "dimension out of range";
  13. symbolic(if gettype 'liestrin neq 'ARRAY then
  14. rederr "liestrin not ARRAY");
  15. if length liestrin neq {dim+1,dim+1,dim+1} then
  16. symbolic rederr "dimension of liestrin out of range";
  17. if dim=1 then <<if symbolic !*tr_lie then
  18. write "one-dimensional Lie algebra";
  19. lie_class:={liealg(1),comtab(0)}>> else
  20. if dim=2 then lie2(liestrin(1,2,1),liestrin(1,2,2)) else
  21. if dim=3 then <<matrix lie3_ff(3,3);
  22. for i:=1:3 do <<lie3_ff(1,i):=liestrin(1,2,i);
  23. lie3_ff(2,i):=liestrin(1,3,i);
  24. lie3_ff(3,i):=liestrin(2,3,i)>>;
  25. lie3(lie3_ff);clear lie3_ff>> else
  26. <<array cc(4,4,4);
  27. for i:=1:4 do for j:=1:4 do for k:=1:4 do
  28. cc(i,j,k):=liestrin(i,j,k);
  29. lie4();clear cc>>;return lie_class
  30. end;
  31. algebraic procedure lie2(f,g);
  32. BEGIN
  33. IF G=0 THEN
  34. IF F=0 THEN liemat:=MAT((1,0),(0,1))
  35. ELSE liemat:=MAT((0,-1/F),(F,0))
  36. ELSE liemat:=MAT((1/G,0),(F,G));
  37. IF (F=0 AND G=0) THEN <<if symbolic !*tr_lie then
  38. WRITE "The given Lie algebra is commutative";
  39. lie_class:={liealg(2),comtab(0)}>>
  40. ELSE <<if symbolic !*tr_lie then
  41. write "[X,Y]=Y";lie_class:={liealg(2),comtab(1)}>>
  42. END;
  43. algebraic procedure lie3(ff);
  44. BEGIN
  45. MATRIX liemat(3,3),l_f(3,3);
  46. ARRAY l_jj(3);
  47. l_f:=ff;
  48. FOR N:=1:3 DO
  49. l_jj(N):=l_f(1,N)*(-l_f(2,1)-l_f(3,2))+
  50. l_f(2,N)*(l_f(1,1)-l_f(3,3))+
  51. l_f(3,N)*(l_f(1,2)+l_f(2,3));
  52. IF NOT(l_jj(1)=0 AND l_jj(2)=0 AND l_jj(3)=0) THEN
  53. <<clear lie3_ff,liemat,l_f,l_jj;
  54. symbolic rederr "not a Lie algebra">>;
  55. IF l_f=MAT((0,0,0),(0,0,0),(0,0,0)) THEN
  56. <<if symbolic !*tr_lie then WRITE "Your Lie algebra is commutative";
  57. lie_class:={liealg(3),comtab(0)};liemat:=liemat**0>> ELSE
  58. IF DET(l_f) NEQ 0 THEN com3(ff) ELSE
  59. IF independ(1,2,ff)=1 THEN com2(ff,1,2) ELSE
  60. IF independ(1,3,ff)=1 THEN com2(ff,1,3) ELSE
  61. IF independ(2,3,ff)=1 THEN com2(ff,2,3) ELSE
  62. com1(ff);
  63. CLEAR l_jj,l_f
  64. END;
  65. algebraic procedure independ(I,J,F0);
  66. BEGIN MATRIX F1(3,3);
  67. F1:=F0;
  68. IF (F1(I,1)*F1(J,2)-F1(I,2)*F1(J,1)=0 AND
  69. F1(I,2)*F1(J,3)-F1(I,3)*F1(J,2)=0 AND
  70. F1(I,1)*F1(J,3)-F1(I,3)*F1(J,1)=0) THEN RETURN 0
  71. ELSE RETURN 1
  72. END;
  73. algebraic procedure com1(F2);
  74. BEGIN
  75. SCALAR ALPHA,AA,BB;
  76. INTEGER R,I,J,M,N,Z1;
  77. MATRIX F3(3,3);
  78. ARRAY l_C(3,3,3);
  79. F3:=F2;
  80. FOR M:=3 STEP -1 UNTIL 1 DO
  81. FOR N:=3 STEP -1 UNTIL 1 DO
  82. IF F3(M,N) NEQ 0 THEN I:=M;
  83. IF I=1 THEN <<I:=1;J:=2>> ELSE
  84. IF I=2 THEN <<I:=1;J:=3>> ELSE <<I:=2;J:=3>>;
  85. FOR K:=1:3 DO
  86. <<l_C(1,2,K):=F3(1,K);l_C(2,1,K):=-F3(1,K);
  87. l_C(1,3,K):=F3(2,K);l_C(3,1,K):=-F3(2,K);
  88. l_C(2,3,K):=F3(3,K);l_C(3,2,K):=-F3(3,K)>>;
  89. Z1:=0;
  90. FOR U:=3 STEP -1 UNTIL 1 DO
  91. FOR V:=3 STEP -1 UNTIL 1 DO
  92. IF l_C(I,J,1)*l_C(V,1,U)+l_C(I,J,2)*l_C(V,2,U)+
  93. l_C(I,J,3)*l_C(V,3,U) NEQ 0
  94. THEN <<M:=U;N:=V;Z1:=1>>;
  95. IF Z1=0 THEN
  96. <<A1:=MAT((1,0,0),(0,1,0),(l_C(1,2,1),l_C(1,2,2),l_C(1,2,3)));
  97. A2:=MAT((1,0,0),(0,0,1),(l_C(1,3,1),l_C(1,3,2),l_C(1,3,3)));
  98. A3:=MAT((0,1,0),(0,0,1),(l_C(2,3,1),l_C(2,3,2),l_C(2,3,3)));
  99. IF DET(A1) NEQ 0 THEN liemat:=A1 ELSE
  100. IF DET(A2) NEQ 0 THEN liemat:=A2 ELSE liemat:=A3;
  101. if symbolic !*tr_lie then
  102. WRITE "[X,Y]=Z";lie_class:={liealg(3),comtab(1)}>> ELSE
  103. <<ALPHA:=(l_C(I,J,1)*l_C(N,1,M)+l_C(I,J,2)*l_C(N,2,M)+
  104. l_C(I,J,3)*l_C(N,3,M))/l_C(I,J,M);
  105. A1:=MAT((0,0,0),(0,0,0),(l_C(I,J,1),l_C(I,J,2),l_C(I,J,3)));
  106. A1(1,N):=1/ALPHA;A1(2,1):=1;
  107. IF DET(A1) NEQ 0 THEN R:=1 ELSE
  108. <<A1(2,1):=0;A1(2,2):=1;
  109. IF DET(A1) NEQ 0 THEN R:=2 ELSE
  110. <<A1(2,2):=0;A1(2,3):=1;R:=3>>>>;
  111. AA:=l_C(N,R,M)/(ALPHA*l_C(I,J,M));
  112. BB:=(l_C(I,J,1)*l_C(R,1,M)+l_C(I,J,2)*l_C(R,2,M)+
  113. l_C(I,J,3)*l_C(R,3,M))/l_C(I,J,M);
  114. IF AA=0 THEN liemat:=MAT((1,0,0),(-BB,1,0),(0,0,1))*A1 ELSE
  115. liemat:=MAT((1,0,0),(BB/AA,-1/AA,1),(0,0,1))*A1;
  116. if symbolic !*tr_lie then
  117. WRITE "[X,Z]=Z";lie_class:={liealg(3),comtab(2)}>>;
  118. CLEAR A1,A2,A3,l_C,F3
  119. END;
  120. algebraic procedure com2(F2,M,N);
  121. BEGIN SCALAR Z1,ALPHA,ALPHA1,ALPHA2,BETA,BETA1,BETA2;
  122. MATRIX F3(3,3);
  123. F3:=F2;
  124. A1:=MAT((F3(M,1),F3(M,2),F3(M,3)),
  125. (F3(N,1),F3(N,2),F3(N,3)),(0,0,0));
  126. A1(3,1):=1;Z1:=DET(A1);
  127. IF Z1 NEQ 0 THEN
  128. <<ALPHA1:=(-F3(N,3)*(F3(M,2)*F3(1,2)+F3(M,3)*F3(2,2))+
  129. F3(N,2)*(F3(M,2)*F3(1,3)+F3(M,3)*F3(2,3)))/Z1;
  130. ALPHA2:=(-F3(N,3)*(F3(N,2)*F3(1,2)+F3(N,3)*F3(2,2))+
  131. F3(N,2)*(F3(N,2)*F3(1,3)+F3(N,3)*F3(2,3)))/Z1;
  132. BETA1:=(F3(M,3)*(F3(M,2)*F3(1,2)+F3(M,3)*F3(2,2))-
  133. F3(M,2)*(F3(M,2)*F3(1,3)+F3(M,3)*F3(2,3)))/Z1;
  134. BETA2:=(F3(M,3)*(F3(N,2)*F3(1,2)+F3(N,3)*F3(2,2))-
  135. F3(M,2)*(F3(N,2)*F3(1,3)+F3(N,3)*F3(2,3)))/Z1>>
  136. ELSE
  137. <<A1(3,1):=0;A1(3,2):=1;Z1:=DET(A1);
  138. IF Z1 NEQ 0 THEN
  139. <<ALPHA1:=(-F3(N,3)*(F3(M,1)*F3(1,1)-F3(M,3)*F3(3,1))+
  140. F3(N,1)*(F3(M,1)*F3(1,3)-F3(M,3)*F3(3,3)))/Z1;
  141. ALPHA2:=(-F3(N,3)*(F3(N,1)*F3(1,1)-F3(N,3)*F3(3,1))+
  142. F3(N,1)*(F3(N,1)*F3(1,3)-F3(N,3)*F3(3,3)))/Z1;
  143. BETA1:=(F3(M,3)*(F3(M,1)*F3(1,1)-F3(M,3)*F3(3,1))-
  144. F3(M,1)*(F3(M,1)*F3(1,3)-F3(M,3)*F3(3,3)))/Z1;
  145. BETA2:=(F3(M,3)*(F3(N,1)*F3(1,1)-F3(N,3)*F3(3,1))-
  146. F3(M,1)*(F3(N,1)*F3(1,3)-F3(N,3)*F3(3,3)))/Z1>>
  147. ELSE
  148. <<A1(3,2):=0;A1(3,3):=1;Z1:=DET(A1);
  149. ALPHA1:=(F3(N,2)*(F3(M,1)*F3(2,1)+F3(M,2)*F3(3,1))-
  150. F3(N,1)*(F3(M,1)*F3(2,2)+F3(M,2)*F3(3,2)))/Z1;
  151. ALPHA2:=(F3(N,2)*(F3(N,1)*F3(2,1)+F3(N,2)*F3(3,1))-
  152. F3(N,1)*(F3(N,1)*F3(2,2)+F3(N,2)*F3(3,2)))/Z1;
  153. BETA1:=(-F3(M,2)*(F3(M,1)*F3(2,1)+F3(M,2)*F3(3,1))+
  154. F3(M,1)*(F3(M,1)*F3(2,2)+F3(M,2)*F3(3,2)))/Z1;
  155. BETA2:=(-F3(M,2)*(F3(N,1)*F3(2,1)+F3(N,2)*F3(3,1))+
  156. F3(M,1)*(F3(N,1)*F3(2,2)+F3(N,2)*F3(3,2)))/Z1>>>>;
  157. IF (ALPHA2=0 AND BETA1=0 AND ALPHA1=BETA2) THEN
  158. <<liemat:=MAT((1,0,0),(0,1,0),(0,0,1/ALPHA1))*A1;
  159. if symbolic !*tr_lie then
  160. WRITE "[X,Z]=X, [Y,Z]=Y";lie_class:={liealg(3),comtab(3)}>> ELSE
  161. <<IF ALPHA2 NEQ 0 THEN
  162. <<ALPHA:=ALPHA1+BETA2;BETA:=ALPHA2*BETA1-ALPHA1*BETA2;
  163. A2:=MAT((0,BETA1-ALPHA1*BETA2/ALPHA2,0),
  164. (1,-ALPHA1/ALPHA2,0),(0,0,1))>> ELSE
  165. IF BETA1 NEQ 0 THEN
  166. <<ALPHA:=1+ALPHA1/BETA2;BETA:=-ALPHA1/BETA2;
  167. A2:=MAT((-ALPHA1*BETA2/BETA1,0,0),
  168. (-(BETA2**2)/BETA1,BETA2,0),(0,0,1/BETA2))>> ELSE
  169. <<ALPHA:=ALPHA1+BETA2;BETA:=-ALPHA1*BETA2;
  170. A2:=MAT((1,1,0),(1/ALPHA1,1/BETA2,0),(0,0,1))>>;
  171. IF ALPHA=0 THEN
  172. <<liemat:=MAT((1,0,0),(0,SQRT(ABS(BETA)),0),
  173. (0,0,1/SQRT(ABS(BETA))))*A2*A1;
  174. if symbolic !*tr_lie then
  175. WRITE "[X,Z]=",BETA/ABS(BETA),"Y, [Y,Z]=X";
  176. if BETA>0 then lie_class:={liealg(3),comtab(4)} else
  177. lie_class:={liealg(3),comtab(5)}>>
  178. ELSE
  179. <<liemat:=MAT((1,0,0),(0,-ALPHA,0),(0,0,-1/ALPHA))*A2*A1;
  180. if symbolic !*tr_lie then
  181. WRITE "[X,Z]=-X+",BETA/(ALPHA**2),"Y, [Y,Z]=X";
  182. lie_class:={liealg(3),comtab(6),BETA/(ALPHA**2)}>>>>;
  183. CLEAR A1,A2,F3
  184. END;
  185. algebraic procedure com3(F2);
  186. BEGIN MATRIX l_K(3,3),F3(3,3);
  187. F3:=F2;
  188. l_K(1,1):=F3(1,2)**2+2*F3(1,3)*F3(2,2)+F3(2,3)**2;
  189. l_K(1,2):=-F3(1,1)*F3(1,2)+F3(1,3)*F3(3,2)-
  190. F3(2,1)*F3(1,3)+F3(2,3)*F3(3,3);
  191. l_K(1,3):=-F3(1,1)*F3(2,2)-F3(1,2)*F3(3,2)-
  192. F3(2,1)*F3(2,3)-F3(2,2)*F3(3,3);
  193. l_K(2,1):=l_K(1,2);
  194. l_K(2,2):=F3(1,1)**2-2*F3(1,3)*F3(3,1)+F3(3,3)**2;
  195. l_K(2,3):=F3(1,1)*F3(2,1)+F3(1,2)*F3(3,1)-
  196. F3(3,1)*F3(2,3)-F3(3,2)*F3(3,3);
  197. l_K(3,1):=l_K(1,3);
  198. l_K(3,2):=l_K(2,3);
  199. l_K(3,3):=F3(2,1)**2+2*F3(2,2)*F3(3,1)+F3(3,2)**2;
  200. IF NOT(NUMBERP(l_K(1,1)) AND
  201. NUMBERP(l_K(1,1)*l_K(2,2)-l_K(1,2)*l_K(2,1)) AND
  202. NUMBERP(DET(l_K))) THEN
  203. <<WRITE "Is ",-l_K(1,1),">0 and ",
  204. l_K(1,1)*l_K(2,2)-l_K(1,2)*l_K(2,1),">0 and ",
  205. -DET(l_K),">0 ? (y/n) and press <RETURN>";
  206. HE:=SYMBOLIC READ();
  207. IF HE=y THEN so3(F2) ELSE so21(F2)>> ELSE
  208. IF (-l_K(1,1)>0 AND l_K(1,1)*l_K(2,2)-l_K(1,2)*l_K(2,1)>0 AND
  209. -DET(l_K)>0) THEN so3(F2) ELSE so21(F2);
  210. CLEAR l_K,F3
  211. END;
  212. algebraic procedure so3(F4);
  213. BEGIN SCALAR S,TT,Q,R,ALPHA;
  214. MATRIX F5(3,3);
  215. F5:=F4;
  216. S:=F5(2,2)/ABS(F5(2,2));
  217. TT:=ABS(F5(1,2)**2+F5(1,3)*F5(2,2));
  218. R:=F5(1,1)-F5(1,2)*F5(2,1)/F5(2,2);
  219. ALPHA:=TT*(-R*R-((F5(2,1)/F5(2,2))**2+F5(3,1)/F5(2,2))*TT);
  220. Q:=1/SQRT(ALPHA);
  221. liemat(1,1):=1/(S*SQRT(TT));
  222. liemat(1,2):=0;
  223. liemat(1,3):=0;
  224. liemat(2,1):=Q*R;
  225. liemat(2,2):=0;
  226. liemat(2,3):=-Q*TT/F5(2,2);
  227. liemat(3,1):=-Q*S*SQRT(TT)*F5(2,1)/F5(2,2);
  228. liemat(3,2):=-Q*S*SQRT(TT);
  229. liemat(3,3):=Q*S*SQRT(TT)*F5(1,2)/F5(2,2);
  230. if symbolic !*tr_lie then
  231. WRITE "[X,Y]=Z, [X,Z]=-Y, [Y,Z]=X";lie_class:={liealg(3),comtab(7)};
  232. CLEAR F5;
  233. END;
  234. algebraic procedure so21(F4);
  235. BEGIN SCALAR GAM,EPS,S,TT,Q,R,ALPHA;
  236. MATRIX l_G(3,3),F5(3,3);
  237. F5:=F4;
  238. liemat:=MAT((1,0,0),(0,1,0),(0,0,1));
  239. IF F5(2,2)=0 THEN
  240. IF F5(1,3) NEQ 0 THEN <<liemat:=MAT((1,0,0),(0,0,1),(0,1,0));
  241. l_G(1,1):=F5(2,1);l_G(1,2):=F5(2,3);l_G(1,3):=F5(2,2);
  242. l_G(2,1):=F5(1,1);l_G(2,2):=F5(1,3);l_G(2,3):=F5(1,2);
  243. l_G(3,1):=-F5(3,1);l_G(3,2):=-F5(3,3);l_G(3,3):=-F5(3,2);
  244. F5:=l_G>> ELSE
  245. IF F5(3,1) NEQ 0 THEN <<liemat:=MAT((0,1,0),(1,0,0),(0,0,1));
  246. l_G(1,1):=-F5(1,2);l_G(1,2):=-F5(1,1);l_G(1,3):=-F5(1,3);
  247. l_G(2,1):=F5(3,2);l_G(2,2):=F5(3,1);l_G(2,3):=F5(3,3);
  248. l_G(3,1):=F5(2,2);l_G(3,2):=F5(2,1);l_G(3,3):=F5(2,3);
  249. F5:=l_G>> ELSE
  250. <<liemat:=MAT((1,0,1),(1,0,0),(0,1,0));
  251. l_G(1,1):=-F5(2,3);l_G(1,2):=F5(2,3)-F5(2,1);l_G(1,3):=0;
  252. l_G(2,1):=-F5(3,3);l_G(2,2):=2*F5(1,1);
  253. l_G(2,3):=F5(1,2)-F5(3,2);
  254. l_G(3,1):=0;l_G(3,2):=F5(1,1);l_G(3,3):=F5(1,2);
  255. F5:=l_G>>;
  256. IF F5(1,2)**2+F5(1,3)*F5(2,2)=0 THEN
  257. <<GAM:=-F5(1,2)/F5(2,2);EPS:=F5(1,1)-F5(1,2)*F5(2,1)/F5(2,2);
  258. IF 1/4*(F5(3,2)**2+F5(3,1)*F5(2,2))-EPS*F5(2,2)/2=0 THEN
  259. <<liemat:=MAT((0,0,1),(0,2/EPS,2*GAM/EPS),(1,0,0))*liemat;
  260. l_G(1,1):=2*GAM*F5(3,2)/EPS-F5(3,3);
  261. l_G(1,2):=-F5(3,2);l_G(1,3):=-2*F5(3,1)/EPS;
  262. l_G(2,1):=0;l_G(2,2):=-EPS*F5(2,2)/2;l_G(2,3):=-F5(2,1);
  263. l_G(3,1):=0;l_G(3,2):=0;l_G(3,3):=-2;F5:=l_G>> ELSE
  264. <<liemat:=MAT((1/2,0,1/2),(0,1/EPS,GAM/EPS),(-1/2,0,1/2))*liemat;
  265. l_G(1,1):=-F5(3,1)/(2*EPS);l_G(1,2):=-F5(3,2)/2;
  266. l_G(1,3):=F5(3,1)/(2*EPS)-1;
  267. l_G(2,1):=F5(2,1)/2;l_G(2,2):=F5(2,2)*EPS/2;
  268. l_G(2,3):=-F5(2,1)/2;l_G(3,1):=F5(3,1)/(2*EPS)+1;
  269. l_G(3,2):=F5(3,2)/2;l_G(3,3):=-F5(3,1)/(2*EPS);F5:=l_G>>>>;
  270. IF NOT(NUMBERP(F5(1,2)**2+F5(1,3)*F5(2,2))) THEN
  271. <<WRITE "Is ",F5(1,2)**2+F5(1,3)*F5(2,2),
  272. "<0 ? (y/n) and press <RETURN>";
  273. HE:=SYMBOLIC READ();
  274. IF HE=y THEN
  275. <<S:=F5(2,2)/ABS(F5(2,2));
  276. TT:=ABS(F5(1,2)**2+F5(1,3)*F5(2,2));
  277. R:=F5(1,1)-F5(1,2)*F5(2,1)/F5(2,2);
  278. ALPHA:=TT*(-R*R-((F5(2,1)/F5(2,2))**2+F5(3,1)/F5(2,2))*TT);
  279. Q:=1/SQRT(ABS(ALPHA));
  280. l_G(1,1):=-Q*S*SQRT(TT)*F5(2,1)/F5(2,2);
  281. l_G(1,2):=-Q*S*SQRT(TT);
  282. l_G(1,3):=Q*S*SQRT(TT)*F5(1,2)/F5(2,2);
  283. l_G(2,1):=1/(S*SQRT(TT));
  284. l_G(2,2):=0;
  285. l_G(2,3):=0;
  286. l_G(3,1):=Q*R;
  287. l_G(3,2):=0;
  288. l_G(3,3):=-Q*TT/F5(2,2);
  289. liemat:=l_G*liemat>> ELSE
  290. <<S:=F5(2,2)/ABS(F5(2,2));
  291. TT:=F5(1,2)**2+F5(1,3)*F5(2,2);
  292. R:=F5(1,1)-F5(1,2)*F5(2,1)/F5(2,2);
  293. ALPHA:=TT*(R*R-((F5(2,1)/F5(2,2))**2+F5(3,1)/F5(2,2))*TT);
  294. Q:=1/SQRT(ABS(ALPHA));
  295. IF NOT(NUMBERP(ALPHA)) THEN
  296. <<WRITE "Is ",ALPHA,">0 ? (y/n) and press <RETURN>";
  297. HE:=SYMBOLIC READ();
  298. IF HE=y THEN
  299. <<l_G(1,1):=1/(S*SQRT(TT));
  300. l_G(1,2):=0;
  301. l_G(1,3):=0;
  302. l_G(2,1):=Q*R;
  303. l_G(2,2):=0;
  304. l_G(2,3):=Q*TT/F5(2,2);
  305. l_G(3,1):=Q*S*SQRT(TT)*F5(2,1)/F5(2,2);
  306. l_G(3,2):=Q*S*SQRT(TT);
  307. l_G(3,3):=-Q*S*SQRT(TT)*F5(1,2)/F5(2,2);
  308. liemat:=l_G*liemat>> ELSE
  309. <<l_G(1,1):=1/(S*SQRT(TT));
  310. l_G(1,2):=0;
  311. l_G(1,3):=0;
  312. l_G(2,1):=Q*S*SQRT(TT)*F5(2,1)/F5(2,2);
  313. l_G(2,2):=Q*S*SQRT(TT);
  314. l_G(2,3):=-Q*S*SQRT(TT)*F5(1,2)/F5(2,2);
  315. l_G(3,1):=Q*R;
  316. l_G(3,2):=0;
  317. l_G(3,3):=Q*TT/F5(2,2);
  318. liemat:=l_G*liemat>>>> ELSE
  319. IF ALPHA>0 THEN
  320. <<l_G(1,1):=1/(S*SQRT(TT));
  321. l_G(1,2):=0;
  322. l_G(1,3):=0;
  323. l_G(2,1):=Q*R;
  324. l_G(2,2):=0;
  325. l_G(2,3):=Q*TT/F5(2,2);
  326. l_G(3,1):=Q*S*SQRT(TT)*F5(2,1)/F5(2,2);
  327. l_G(3,2):=Q*S*SQRT(TT);
  328. l_G(3,3):=-Q*S*SQRT(TT)*F5(1,2)/F5(2,2);
  329. liemat:=l_G*liemat>> ELSE
  330. <<l_G(1,1):=1/(S*SQRT(TT));
  331. l_G(1,2):=0;
  332. l_G(1,3):=0;
  333. l_G(2,1):=Q*S*SQRT(TT)*F5(2,1)/F5(2,2);
  334. l_G(2,2):=Q*S*SQRT(TT);
  335. l_G(2,3):=-Q*S*SQRT(TT)*F5(1,2)/F5(2,2);
  336. l_G(3,1):=Q*R;
  337. l_G(3,2):=0;
  338. l_G(3,3):=Q*TT/F5(2,2);
  339. liemat:=l_G*liemat>>>>>> ELSE
  340. IF F5(1,2)**2+F5(1,3)*F5(2,2)<0 THEN
  341. <<S:=F5(2,2)/ABS(F5(2,2));
  342. TT:=ABS(F5(1,2)**2+F5(1,3)*F5(2,2));
  343. R:=F5(1,1)-F5(1,2)*F5(2,1)/F5(2,2);
  344. ALPHA:=TT*(-R*R-((F5(2,1)/F5(2,2))**2+F5(3,1)/F5(2,2))*TT);
  345. Q:=1/SQRT(ABS(ALPHA));
  346. l_G(1,1):=-Q*S*SQRT(TT)*F5(2,1)/F5(2,2);
  347. l_G(1,2):=-Q*S*SQRT(TT);
  348. l_G(1,3):=Q*S*SQRT(TT)*F5(1,2)/F5(2,2);
  349. l_G(2,1):=1/(S*SQRT(TT));
  350. l_G(2,2):=0;
  351. l_G(2,3):=0;
  352. l_G(3,1):=Q*R;
  353. l_G(3,2):=0;
  354. l_G(3,3):=-Q*TT/F5(2,2);
  355. liemat:=l_G*liemat>> ELSE
  356. <<S:=F5(2,2)/ABS(F5(2,2));
  357. TT:=F5(1,2)**2+F5(1,3)*F5(2,2);
  358. R:=F5(1,1)-F5(1,2)*F5(2,1)/F5(2,2);
  359. ALPHA:=TT*(R*R-((F5(2,1)/F5(2,2))**2+F5(3,1)/F5(2,2))*TT);
  360. Q:=1/SQRT(ABS(ALPHA));
  361. IF NOT(NUMBERP(ALPHA)) THEN
  362. <<WRITE "Is ",ALPHA,">0 ? (y/n) and press <RETURN>";
  363. HE:=SYMBOLIC READ();
  364. IF HE=y THEN
  365. <<l_G(1,1):=1/(S*SQRT(TT));
  366. l_G(1,2):=0;
  367. l_G(1,3):=0;
  368. l_G(2,1):=Q*R;
  369. l_G(2,2):=0;
  370. l_G(2,3):=Q*TT/F5(2,2);
  371. l_G(3,1):=Q*S*SQRT(TT)*F5(2,1)/F5(2,2);
  372. l_G(3,2):=Q*S*SQRT(TT);
  373. l_G(3,3):=-Q*S*SQRT(TT)*F5(1,2)/F5(2,2);
  374. liemat:=l_G*liemat>> ELSE
  375. <<l_G(1,1):=1/(S*SQRT(TT));
  376. l_G(1,2):=0;
  377. l_G(1,3):=0;
  378. l_G(2,1):=Q*S*SQRT(TT)*F5(2,1)/F5(2,2);
  379. l_G(2,2):=Q*S*SQRT(TT);
  380. l_G(2,3):=-Q*S*SQRT(TT)*F5(1,2)/F5(2,2);
  381. l_G(3,1):=Q*R;
  382. l_G(3,2):=0;
  383. l_G(3,3):=Q*TT/F5(2,2);
  384. liemat:=l_G*liemat>>>> ELSE
  385. IF ALPHA>0 THEN
  386. <<l_G(1,1):=1/(S*SQRT(TT));
  387. l_G(1,2):=0;
  388. l_G(1,3):=0;
  389. l_G(2,1):=Q*R;
  390. l_G(2,2):=0;
  391. l_G(2,3):=Q*TT/F5(2,2);
  392. l_G(3,1):=Q*S*SQRT(TT)*F5(2,1)/F5(2,2);
  393. l_G(3,2):=Q*S*SQRT(TT);
  394. l_G(3,3):=-Q*S*SQRT(TT)*F5(1,2)/F5(2,2);
  395. liemat:=l_G*liemat>> ELSE
  396. <<l_G(1,1):=1/(S*SQRT(TT));
  397. l_G(1,2):=0;
  398. l_G(1,3):=0;
  399. l_G(2,1):=Q*S*SQRT(TT)*F5(2,1)/F5(2,2);
  400. l_G(2,2):=Q*S*SQRT(TT);
  401. l_G(2,3):=-Q*S*SQRT(TT)*F5(1,2)/F5(2,2);
  402. l_G(3,1):=Q*R;
  403. l_G(3,2):=0;
  404. l_G(3,3):=Q*TT/F5(2,2);
  405. liemat:=l_G*liemat>>>>;
  406. if symbolic !*tr_lie then
  407. WRITE "[X,Y]=Z, [X,Z]=Y, [Y,Z]=X";lie_class:={liealg(3),comtab(8)};
  408. CLEAR l_G,F5
  409. END;
  410. algebraic procedure lie4();
  411. BEGIN
  412. SCALAR LAM,JAC1,JAC2,JAC3,JAC4;
  413. INTEGER P1,M1,M2,M3,DIML1;
  414. MATRIX l_F(6,4);
  415. ARRAY ORDV(12);
  416. ORDV(1):=ORDV(3):=ORDV(7):=1;ORDV(2):=ORDV(5):=ORDV(9):=2;
  417. ORDV(4):=ORDV(6):=ORDV(11):=3;ORDV(8):=ORDV(10):=ORDV(12):=4;
  418. FOR I:=1:4 DO
  419. <<l_F(1,I):=CC(1,2,I);l_F(2,I):=CC(1,3,I);l_F(3,I):=CC(2,3,I);
  420. l_F(4,I):=CC(1,4,I);l_F(5,I):=CC(2,4,I);l_F(6,I):=CC(3,4,I);
  421. CC(1,1,I):=CC(2,2,I):=CC(3,3,I):=CC(4,4,I):=0;
  422. CC(2,1,I):=-l_F(1,I);CC(3,1,I):=-l_F(2,I);CC(3,2,I):=-l_F(3,I);
  423. CC(4,1,I):=-l_F(4,I);CC(4,2,I):=-l_F(5,I);CC(4,3,I):=-l_F(6,I)>>;
  424. FOR S:=1:4 DO
  425. <<JAC1:=FOR R:=1:4 SUM
  426. CC(1,2,R)*CC(R,3,S)+CC(2,3,R)*CC(R,1,S)+CC(3,1,R)*CC(R,2,S);
  427. JAC2:=FOR R:=1:4 SUM
  428. CC(1,2,R)*CC(R,4,S)+CC(2,4,R)*CC(R,1,S)+CC(4,1,R)*CC(R,2,S);
  429. JAC3:=FOR R:=1:4 SUM
  430. CC(1,3,R)*CC(R,4,S)+CC(3,4,R)*CC(R,1,S)+CC(4,1,R)*CC(R,3,S);
  431. JAC4:=FOR R:=1:4 SUM
  432. CC(2,3,R)*CC(R,4,S)+CC(3,4,R)*CC(R,2,S)+CC(4,2,R)*CC(R,3,S);
  433. IF (JAC1 NEQ 0 OR JAC2 NEQ 0 OR JAC3 NEQ 0 OR JAC4 NEQ 0 ) THEN
  434. S:=4>>;
  435. IF (JAC1 NEQ 0 OR JAC2 NEQ 0 OR JAC3 NEQ 0 OR JAC4 NEQ 0 )THEN
  436. <<clear l_F,ORDV,CC;symbolic rederr "not a Lie algebra">>;
  437. M1:=0;
  438. FOR S:=1:6 DO
  439. FOR TT:=1:4 DO
  440. IF l_F(S,TT) NEQ 0 THEN <<M1:=S;P1:=TT;S:=6;TT:=4>>;
  441. IF M1=0 THEN DIML1:=0 ELSE
  442. IF M1=6 THEN DIML1:=1 ELSE
  443. <<M2:=0;
  444. FOR S:=M1+1:6 DO
  445. <<LAM:=l_F(S,P1)/l_F(M1,P1);
  446. FOR TT:=1:4 DO
  447. IF l_F(S,TT) NEQ LAM*l_F(M1,TT) THEN <<M2:=S;S:=6;TT:=4>>>>;
  448. IF M2=0 THEN DIML1:=1 ELSE
  449. IF M2=6 THEN DIML1:=2 ELSE
  450. <<M3:=0;
  451. FOR S:=M2+1:6 DO
  452. IF NOT(DET(MAT((l_F(M1,2),l_F(M1,3),l_F(M1,4)),
  453. (l_F(M2,2),l_F(M2,3),l_F(M2,4)),
  454. (l_F(S,2),l_F(S,3),l_F(S,4))))=0 AND
  455. DET(MAT((l_F(M1,1),l_F(M1,3),l_F(M1,4)),
  456. (l_F(M2,1),l_F(M2,3),l_F(M2,4)),
  457. (l_F(S,1),l_F(S,3),l_F(S,4))))=0 AND
  458. DET(MAT((l_F(M1,1),l_F(M1,2),l_F(M1,4)),
  459. (l_F(M2,1),l_F(M2,2),l_F(M2,4)),
  460. (l_F(S,1),l_F(S,2),l_F(S,4))))=0 AND
  461. DET(MAT((l_F(M1,1),l_F(M1,2),l_F(M1,3)),
  462. (l_F(M2,1),l_F(M2,2),l_F(M2,3)),
  463. (l_F(S,1),l_F(S,2),l_F(S,3))))=0)
  464. THEN <<M3:=S;S:=6>>;
  465. IF M3=0 THEN DIML1:=2 ELSE DIML1:=3>>>>;
  466. IF DIML1=0 THEN
  467. <<if symbolic !*tr_lie then WRITE "Your Lie algebra is commutative";
  468. lie_class:={liealg(4),comtab(0)};
  469. liemat:=mat((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1))>> ELSE
  470. IF DIML1=3 THEN
  471. com43(ORDV(2*M1-1),ORDV(2*M1),ORDV(2*M2-1),ORDV(2*M2),
  472. ORDV(2*M3-1),ORDV(2*M3)) ELSE
  473. IF DIML1=1 THEN
  474. com41(ORDV(2*M1-1),ORDV(2*M1),P1) ELSE
  475. com42(ORDV(2*M1-1),ORDV(2*M1),ORDV(2*M2-1),ORDV(2*M2));
  476. CLEAR ORDV,l_F
  477. END;
  478. algebraic procedure com41(I1,J1,P1);
  479. BEGIN SCALAR Y1,Y2,Y3,BETA1,BETA2,BETA3,BETA4,BETA5,BETA6;
  480. MATRIX liemat(4,4);
  481. FOR I:=1:4 DO liemat(1,I):=CC(I1,J1,I);
  482. IF P1=1 THEN <<Y1:=2;Y2:=3;Y3:=4>> ELSE
  483. IF P1=2 THEN <<Y1:=1;Y2:=3;Y3:=4>> ELSE
  484. IF P1=3 THEN <<Y1:=1;Y2:=2;Y3:=4>> ELSE
  485. <<Y1:=1;Y2:=2;Y3:=3>>;
  486. liemat(2,Y1):=liemat(3,Y2):=liemat(4,Y3):=1;
  487. BETA1:=(FOR L:=1:4 SUM CC(I1,J1,L)*CC(L,Y1,P1))/CC(I1,J1,P1);
  488. BETA2:=(FOR L:=1:4 SUM CC(I1,J1,L)*CC(L,Y2,P1))/CC(I1,J1,P1);
  489. BETA3:=CC(Y1,Y2,P1)/CC(I1,J1,P1);
  490. BETA4:=(FOR L:=1:4 SUM CC(I1,J1,L)*CC(L,Y3,P1))/CC(I1,J1,P1);
  491. BETA5:=CC(Y1,Y3,P1)/CC(I1,J1,P1);
  492. BETA6:=CC(Y2,Y3,P1)/CC(I1,J1,P1);
  493. IF (BETA1=0 AND BETA2=0 AND BETA3=0 AND BETA4=0 AND BETA5=0) THEN
  494. <<liemat:=MAT((1,0,0,0),(0,0,0,1),(0,0,1,0),(0,1,0,0))*liemat;
  495. BETA3:=-BETA6;BETA6:=0>> ELSE
  496. IF (BETA1=0 AND BETA2=0 AND BETA3=0) THEN
  497. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,0,1),(0,0,1,0))*liemat;
  498. BETA2:=BETA4;BETA3:=BETA5;BETA4:=BETA5:=0;BETA6:=-BETA6>>;
  499. IF (BETA1=0 AND BETA2=0) THEN
  500. <<liemat:=MAT((BETA3,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  501. Y1:=BETA4;Y2:=BETA5/BETA3;Y3:=BETA6/BETA3>> ELSE
  502. IF BETA1=0 THEN
  503. <<liemat:=MAT((1,0,0,0),(-BETA3/BETA2,1,0,0),(0,0,1/BETA2,0),
  504. (0,0,0,1))*liemat;Y1:=BETA4;
  505. Y2:=BETA5-BETA3*BETA4/BETA2;Y3:=BETA6/BETA2>> ELSE
  506. <<liemat:=MAT((1,0,0,0),(BETA3/BETA1,-BETA2/BETA1,1,0),
  507. (0,1/BETA1,0,0),(0,0,0,1))*liemat;
  508. Y1:=BETA4;Y2:=(BETA3*BETA4-BETA2*BETA5)/BETA1;
  509. Y3:=BETA5/BETA1>>;
  510. IF (BETA1=0 AND BETA2=0) THEN
  511. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,Y3,-Y2,1),(0,0,1,0))*liemat;
  512. if symbolic !*tr_lie then
  513. WRITE "[X,Z]=W";lie_class:={liealg(4),comtab(2)}>> ELSE
  514. <<IF Y1=0 THEN
  515. liemat:=MAT((1,0,0,0),(0,1,0,0),(-Y3,0,0,-1),(0,0,1,1))*liemat ELSE
  516. liemat:=MAT((1,0,0,0),(0,1,0,0),(-Y3/Y1,0,1,-1/Y1),(0,0,0,1/Y1))*
  517. liemat;
  518. if symbolic !*tr_lie then
  519. WRITE "[W,Z]=W";lie_class:={liealg(4),comtab(1)}>>
  520. END;
  521. algebraic procedure com42(I1,J1,I2,J2);
  522. BEGIN SCALAR D,D1,D2,D3,D4,A1,A2,A3,A4,A5,B1,B2,B3,B4,B5;
  523. MATRIX liemat(4,4);
  524. ARRAY SOL(1,4);
  525. FOR I:=1:4 DO <<liemat(1,I):=CC(I1,J1,I);liemat(2,I):=CC(I2,J2,I)>>;
  526. liemat(3,1):=liemat(4,2):=1;IF (D:=DET(liemat)) NEQ 0 THEN
  527. <<D1:=1;D2:=2;D3:=3;D4:=4>> ELSE
  528. <<liemat(4,2):=0;liemat(4,3):=1;IF (D:=DET(liemat)) NEQ 0 THEN
  529. <<D1:=1;D2:=3;D3:=2;D4:=4;D:=-D>> ELSE
  530. <<liemat(3,1):=0;liemat(3,2):=1;IF (D:=DET(liemat)) NEQ 0 THEN
  531. <<D1:=2;D2:=3;D3:=1;D4:=4>> ELSE
  532. <<liemat(3,2):=liemat(4,3):=0;liemat(3,1):=liemat(4,4):=1;
  533. IF (D:=DET(liemat)) NEQ 0 THEN
  534. <<D1:=1;D2:=4;D3:=2;D4:=3>> ELSE
  535. <<liemat(3,1):=0;liemat(3,2):=1;IF (D:=DET(liemat)) NEQ 0 THEN
  536. <<D1:=2;D2:=4;D3:=1;D4:=3;D:=-D>> ELSE
  537. <<liemat(3,2):=0;liemat(3,3):=1;D:=DET(liemat);
  538. D1:=3;D2:=4;D3:=1;D4:=2>>
  539. >>>>>>>>;
  540. A1:=FOR R:=1:4 SUM ( CC(I1,J1,R)*CC(R,D1,D3)*CC(I2,J2,D4)-
  541. CC(I1,J1,R)*CC(R,D1,D4)*CC(I2,J2,D3))/D;
  542. B1:=FOR R:=1:4 SUM (-CC(I1,J1,R)*CC(R,D1,D3)*CC(I1,J1,D4)+
  543. CC(I1,J1,R)*CC(R,D1,D4)*CC(I1,J1,D3))/D;
  544. A2:=FOR R:=1:4 SUM ( CC(I2,J2,R)*CC(R,D1,D3)*CC(I2,J2,D4)-
  545. CC(I2,J2,R)*CC(R,D1,D4)*CC(I2,J2,D3))/D;
  546. B2:=FOR R:=1:4 SUM (-CC(I2,J2,R)*CC(R,D1,D3)*CC(I1,J1,D4)+
  547. CC(I2,J2,R)*CC(R,D1,D4)*CC(I1,J1,D3))/D;
  548. A3:=FOR R:=1:4 SUM ( CC(I1,J1,R)*CC(R,D2,D3)*CC(I2,J2,D4)-
  549. CC(I1,J1,R)*CC(R,D2,D4)*CC(I2,J2,D3))/D;
  550. B3:=FOR R:=1:4 SUM (-CC(I1,J1,R)*CC(R,D2,D3)*CC(I1,J1,D4)+
  551. CC(I1,J1,R)*CC(R,D2,D4)*CC(I1,J1,D3))/D;
  552. A4:=FOR R:=1:4 SUM ( CC(I2,J2,R)*CC(R,D2,D3)*CC(I2,J2,D4)-
  553. CC(I2,J2,R)*CC(R,D2,D4)*CC(I2,J2,D3))/D;
  554. B4:=FOR R:=1:4 SUM (-CC(I2,J2,R)*CC(R,D2,D3)*CC(I1,J1,D4)+
  555. CC(I2,J2,R)*CC(R,D2,D4)*CC(I1,J1,D3))/D;
  556. A5:=( CC(D1,D2,D3)*CC(I2,J2,D4)-CC(D1,D2,D4)*CC(I2,J2,D3))/D;
  557. B5:=(-CC(D1,D2,D3)*CC(I1,J1,D4)+CC(D1,D2,D4)*CC(I1,J1,D3))/D;
  558. findcentre(A1,A2,A3,A4,A5,B1,B2,B3,B4,B5);
  559. IF NOTTRIV=0 THEN trivcent(A1,A2,A3,A4,A5,B1,B2,B3,B4,B5)
  560. ELSE
  561. IF (SOL(1,3)=0 AND SOL(1,4)=0) THEN
  562. IF SOL(1,1)=0 THEN
  563. <<liemat:=MAT((0,1,0,0),(1,0,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  564. centincom(B1,B3,B5,A1,A3,A5)>> ELSE
  565. <<liemat:=MAT((1,SOL(1,2)/SOL(1,1),0,0),(0,1,0,0),(0,0,1,0),
  566. (0,0,0,1))*liemat;centincom(A2,A4,A5,
  567. B2-SOL(1,2)/SOL(1,1)*A2,B4-SOL(1,2)/SOL(1,1)*A4,
  568. B5-SOL(1,2)/SOL(1,1)*A5)>> ELSE
  569. IF DET(MAT((1,0,0,0),(0,1,0,0),
  570. (SOL(1,1),SOL(1,2),SOL(1,3),SOL(1,4)),(0,0,0,1)))=0 THEN
  571. <<liemat:=MAT((1,0,0,0),(0,1,0,0),
  572. (SOL(1,1),SOL(1,2),SOL(1,3),SOL(1,4)),(0,0,1,0))*liemat;
  573. centoutcom(A1,A2,B1,B2)>> ELSE
  574. <<liemat:=MAT((1,0,0,0),(0,1,0,0),
  575. (SOL(1,1),SOL(1,2),SOL(1,3),SOL(1,4)),(0,0,0,1))*liemat;
  576. centoutcom(A3,A4,B3,B4)>>;
  577. CLEAR SOL,NOTTRIV
  578. END;
  579. algebraic procedure findcentre(A1,A2,A3,A4,A5,B1,B2,B3,B4,B5);
  580. BEGIN INTEGER FLAG;
  581. SCALAR HELP;
  582. NOTTRIV:=0;FLAG:=0;
  583. CENT:=MAT((A1,A2,0,-A5),(A3,A4,A5,0),(B1,B2,0,-B5),
  584. (B3,B4,B5,0),(0,0,A1,A3),(0,0,A2,A4),
  585. (0,0,B1,B3),(0,0,B2,B4));
  586. FOR I:=1:4 DO
  587. IF (CENT(I,1) NEQ 0 AND FLAG=0) THEN
  588. <<FLAG:=1;FOR J:=1:4 DO
  589. <<HELP:=CENT(1,J);CENT(1,J):=CENT(I,J);CENT(I,J):=HELP>>>>;
  590. IF FLAG=0 THEN <<NOTTRIV:=1;SOL(1,1):=1>> ELSE
  591. <<FOR I:=2:4 DO <<HELP:=CENT(I,1)/CENT(1,1);
  592. FOR J:=1:4 DO CENT(I,J):=CENT(I,J)-HELP*CENT(1,J)>>;
  593. FLAG:=0;
  594. FOR I:=2:4 DO
  595. IF (CENT(I,2) NEQ 0 AND FLAG=0) THEN
  596. <<FLAG:=1;FOR J:=2:4 DO
  597. <<HELP:=CENT(2,J);CENT(2,J):=CENT(I,J);CENT(I,J):=HELP>>>>;
  598. IF FLAG=0 THEN <<NOTTRIV:=1;SOL(1,1):=-CENT(1,2);
  599. SOL(1,2):=CENT(1,1)>> ELSE
  600. <<FOR I:=3:4 DO <<HELP:=CENT(I,2)/CENT(2,2);
  601. FOR J:=2:4 DO CENT(I,J):=CENT(I,J)-HELP*CENT(2,J)>>;
  602. FLAG:=0;
  603. FOR I:=3:8 DO
  604. IF (CENT(I,3) NEQ 0 AND FLAG=0) THEN
  605. <<FLAG:=1;FOR J:=3:4 DO
  606. <<HELP:=CENT(3,J);CENT(3,J):=CENT(I,J);CENT(I,J):=HELP>>>>;
  607. IF FLAG=0 THEN <<NOTTRIV:=1;
  608. SOL(1,1):=(CENT(1,2)*CENT(2,3)/CENT(2,2)-CENT(1,3))/CENT(1,1);
  609. SOL(1,2):=-CENT(2,3)/CENT(2,2);SOL(1,3):=1>> ELSE
  610. <<FOR I:=4:8 DO <<HELP:=CENT(I,3)/CENT(3,3);
  611. FOR J:=3:4 DO CENT(I,J):=CENT(I,J)-HELP*CENT(3,J)>>;
  612. FLAG:=0;
  613. FOR I:=4:8 DO
  614. IF (CENT(I,4) NEQ 0 AND FLAG=0) THEN
  615. <<FLAG:=1;CENT(4,4):=CENT(I,4)>>;
  616. IF FLAG=0 THEN <<NOTTRIV:=1;
  617. SOL(1,1):=(-(CENT(2,3)*CENT(3,4)/CENT(3,3)-CENT(2,4))*
  618. CENT(1,2)/CENT(2,2)+CENT(3,4)*CENT(1,3)/
  619. CENT(3,3)-CENT(1,4))/CENT(1,1);
  620. SOL(1,2):=(CENT(2,3)*CENT(3,4)/CENT(3,3)-CENT(2,4))/
  621. CENT(2,2);
  622. SOL(1,3):=-CENT(3,4)/CENT(3,3);SOL(1,4):=1>>
  623. >>>>>>;
  624. CLEAR CENT
  625. END;
  626. algebraic procedure centincom(A,C,E,B,D,F);
  627. BEGIN SCALAR V1,W1,V2,W2;
  628. IF C=0 THEN IF D=0 THEN
  629. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,0,1),(0,0,1,0))*liemat;
  630. V1:=A;V2:=-E;W1:=B;W2:=-F>> ELSE
  631. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,1,-B/D),(0,0,0,1))*liemat;
  632. V1:=C;V2:=E;W1:=D;W2:=F>> ELSE
  633. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,1,-A/C),(0,0,0,1))*liemat;
  634. V1:=C;V2:=E;W1:=D;W2:=F>>;
  635. IF W1=0 THEN
  636. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,-V2/W2,V1/W2,0),(0,0,0,1/V1))*
  637. liemat;
  638. if symbolic !*tr_lie then
  639. WRITE "[X,Z]=W, [Y,Z]=X";lie_class:={liealg(4),comtab(6)}>> ELSE
  640. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,-W2/(W1*V2-W2*V1),
  641. W1*W1/(W1*V2-W2*V1),0),(0,0,0,1/W1))*
  642. MAT((1,0,0,0),(V1,W1,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  643. if symbolic !*tr_lie then
  644. WRITE "[X,Z]=X, [Y,Z]=W";lie_class:={liealg(4),comtab(7)}>>
  645. END;
  646. algebraic procedure centoutcom(A,C,B,D);
  647. BEGIN INTEGER FLAG;
  648. SCALAR ALPHA,BETA;
  649. FLAG:=0;
  650. IF C NEQ 0 THEN
  651. <<liemat:=MAT((0,B-A*D/C,0,0),(1,-A/C,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  652. ALPHA:=A+D;BETA:=B*C-A*D>> ELSE
  653. IF B NEQ 0 THEN
  654. <<liemat:=MAT((-A*D/B,0,0,0),(-D*D/B,D,0,0),(0,0,1,0),(0,0,0,1/D))*
  655. liemat;
  656. ALPHA:=1+A/D;BETA:=-A/D>> ELSE
  657. IF A NEQ D THEN
  658. <<liemat:=MAT((1,1,0,0),(1/A,1/D,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  659. ALPHA:=A+D;BETA:=-A*D>> ELSE
  660. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1/A))*liemat;
  661. FLAG:=1>>;
  662. IF FLAG=1 THEN
  663. <<if symbolic !*tr_lie then
  664. WRITE "[W,Z]=W, [X,Z]=X";lie_class:={liealg(4),comtab(10)}>> ELSE
  665. IF ALPHA=0 THEN
  666. <<liemat:=MAT((1,0,0,0),(0,SQRT(ABS(BETA)),0,0),(0,0,1,0),
  667. (0,0,0,1/SQRT(ABS(BETA))))*liemat;
  668. if symbolic !*tr_lie then
  669. WRITE "[W,Z]=",BETA/ABS(BETA),"X, [X,Z]=W";
  670. if BETA>0 then lie_class:={liealg(4),comtab(11)} else
  671. lie_class:={liealg(4),comtab(8)}>> ELSE
  672. <<liemat:=MAT((1,0,0,0),(0,-ALPHA,0,0),(0,0,1,0),
  673. (0,0,0,-1/ALPHA))*liemat;
  674. if symbolic !*tr_lie then
  675. WRITE "[W,Z]=-W+",BETA/(ALPHA**2),"X, [X,Z]=W";
  676. lie_class:={liealg(4),comtab(9),BETA/(ALPHA**2)}>>
  677. END;
  678. algebraic procedure trivcent(A1,A2,A3,A4,A5,B1,B2,B3,B4,B5);
  679. BEGIN INTEGER FLAG;
  680. SCALAR HE,HELP,ALPHA,BETA,C1,C2,C3,C4,C5,
  681. D1,D2,D3,D4,D5,P,E1,E2,E3,E4,E5,E6;
  682. IF (A1*B2-A2*B1)=0 THEN
  683. IF (A3*B4-A4*B3)=0 THEN
  684. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,1,1),(0,0,0,1))*liemat;
  685. A1:=A1+A3;B1:=B1+B3;A2:=A2+A4;B2:=B2+B4>> ELSE
  686. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,0,1),(0,0,1,0))*liemat;
  687. HELP:=A1;A1:=A3;A3:=HELP;HELP:=A2;A2:=A4;A4:=HELP;
  688. HELP:=B1;B1:=B3;B3:=HELP;HELP:=B2;B2:=B4;B4:=HELP;
  689. A5:=-A5;B5:=-B5>>;
  690. IF A2 NEQ 0 THEN <<ALPHA:=A1+B2;BETA:=A2*B1-A1*B2;
  691. IF ALPHA=0 THEN
  692. <<C1:=0;C2:=B1-A1*B2/A2;C3:=SQRT(ABS(BETA));C4:=-C3*A1/A2;
  693. C5:=1/C3;D1:=A1/(A2*C2);D2:=C5;D3:=1/C2;D4:=0;D5:=C3;
  694. IF NOT(NUMBERP(BETA)) THEN
  695. <<WRITE "Is ",BETA,">0 ? (y/n) and press <RETURN>";
  696. HE:=SYMBOLIC READ();
  697. IF HE=y THEN FLAG:=2 ELSE FLAG:=3>> ELSE
  698. IF BETA>0 THEN FLAG:=2 ELSE FLAG:=3>> ELSE
  699. <<C1:=0;C2:=B1-A1*B2/A2;C3:=-ALPHA;C4:=ALPHA*A1/A2;
  700. C5:=1/C3;D1:=A1/(A2*C2);D2:=C5;D3:=1/C2;D4:=0;D5:=C3;
  701. FLAG:=4;P:=BETA/(ALPHA*ALPHA)>>>> ELSE
  702. IF B1 NEQ 0 THEN <<ALPHA:=1+A1/B2;BETA:=-A1/B2;
  703. IF ALPHA=0 THEN
  704. <<C1:=-A1*B2/B1;C2:=0;C3:=-SQRT(ABS(BETA))*B2/B1;C4:=-C3*B1;
  705. C5:=1/C4;D1:=1/C1;D2:=0;D3:=-1/(A1*B2);D4:=C5;D5:=C4;
  706. IF NOT(NUMBERP(BETA)) THEN
  707. <<WRITE "Is ",BETA,">0 ? (y/n) and press <RETURN>";
  708. HE:=SYMBOLIC READ();
  709. IF HE=y THEN FLAG:=2 ELSE FLAG:=3>> ELSE
  710. IF BETA>0 THEN FLAG:=2 ELSE FLAG:=3>> ELSE
  711. <<C1:=-A1*B2/B1;C2:=0;C3:=ALPHA*B2/B1;C4:=-ALPHA*B2;
  712. C5:=1/C4;D1:=1/C1;D2:=0;D3:=-1/(A1*B2);D4:=C5;D5:=C4;
  713. FLAG:=4;P:=BETA/(ALPHA*ALPHA)>>>> ELSE
  714. IF A1 NEQ B2 THEN <<ALPHA:=A1+B2;BETA:=-A1*B2;
  715. IF ALPHA=0 THEN
  716. <<C1:=1;C2:=1;C3:=SQRT(ABS(BETA))/A1;C4:=SQRT(ABS(BETA))/B2;
  717. C5:=1/SQRT(ABS(BETA));HELP:=1/B2-1/A1;D1:=1/(B2*HELP);
  718. D2:=-C5/HELP;D3:=-1/(A1*HELP);D4:=-D2;D5:=1/C5;
  719. IF NOT(NUMBERP(BETA)) THEN
  720. <<WRITE "Is ",BETA,">0 ? (y/n) and press <RETURN>";
  721. HE:=SYMBOLIC READ();
  722. IF HE=y THEN FLAG:=2 ELSE FLAG:=3>> ELSE
  723. IF BETA>0 THEN FLAG:=2 ELSE FLAG:=3>> ELSE
  724. <<C1:=1;C2:=1;C3:=-ALPHA/A1;C4:=-ALPHA/B2;C5:=-1/ALPHA;
  725. HELP:=1/B2-1/A1;D1:=1/(B2*HELP);D2:=1/(ALPHA*HELP);
  726. D3:=-1/(A1*HELP);D4:=-D2;D5:=-ALPHA;
  727. FLAG:=4;P:=BETA/(ALPHA*ALPHA)>>>> ELSE
  728. <<C1:=1;C2:=0;C3:=0;C4:=1;C5:=1/A1;
  729. D1:=1;D2:=0;D3:=0;D4:=1;D5:=A1;FLAG:=1>>;
  730. liemat:=MAT((C1,C2,0,0),(C3,C4,0,0),(0,0,C5,0),(0,0,0,1))*liemat;
  731. E1:=D1*(C1*A3+C2*A4)+D3*(C1*B3+C2*B4);
  732. E2:=D2*(C1*A3+C2*A4)+D4*(C1*B3+C2*B4);
  733. E3:=D1*(C3*A3+C4*A4)+D3*(C3*B3+C4*B4);
  734. E4:=D2*(C3*A3+C4*A4)+D4*(C3*B3+C4*B4);
  735. E5:=C5*A5*D1+C5*B5*D3;
  736. E6:=C5*A5*D2+C5*B5*D4;
  737. IF FLAG=4 THEN
  738. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,E1+E4,1),(0,0,1,0))*liemat;
  739. A1:=-E4;A2:=E1+E3+E4;A3:=-1;A4:=1;A5:=-E5;
  740. B1:=P*(E1+E4)+E2;B2:=E4;B3:=P;B4:=0;B5:=-E6>> ELSE
  741. IF FLAG=1 THEN
  742. IF (E1+E4=0) THEN
  743. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,0,1),(0,0,1,0))*liemat;
  744. A1:=E1;A2:=E3;A3:=1;A4:=0;A5:=-E5;
  745. B1:=E2;B2:=E4;B3:=0;B4:=1;B5:=-E6>> ELSE
  746. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,E1+E4,-2),(0,0,0,1))*liemat;
  747. A1:=E4-E1;A2:=-2*E3;A3:=E1;A4:=E3;A5:=E5*(E1+E4);
  748. B1:=-2*E2;B2:=E1-E4;B3:=E2;B4:=E4;B5:=E6*(E1+E4)>>;
  749. IF (FLAG=1 OR FLAG=4) THEN
  750. IF A1*B2-A2*B1=0 THEN
  751. IF B1=0 THEN
  752. <<liemat:=MAT((A2,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  753. FLAG:=5;E1:=A3;E2:=B3*A2;E3:=A4/A2;E4:=B4;E5:=A5/A2;
  754. E6:=B5>> ELSE
  755. <<liemat:=MAT((A1,B1,0,0),(1,0,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  756. FLAG:=5;E1:=(A1*B3+B1*B4)/B1;
  757. E2:=A1*A3+B1*A4-A1*(A1*B3+B1*B4)/B1;E3:=B3/B1;
  758. E4:=A3-A1*B3/B1;E5:=B5/B1;E6:=A5-B5*A1/B1>> ELSE
  759. <<IF A2 NEQ 0 THEN
  760. <<BETA:=A2*B1-A1*B2;C1:=0;C2:=B1-A1*B2/A2;
  761. C3:=SQRT(ABS(BETA));C4:=-C3*A1/A2;C5:=1/C3;
  762. D1:=A1/(A2*C2);D2:=C5;D3:=1/C2;D4:=0;D5:=C3>> ELSE
  763. IF B1 NEQ 0 THEN
  764. <<BETA:=-A1/B2;C1:=-A1*B2/B1;C2:=0;
  765. C3:=-SQRT(ABS(BETA))*B2/B1;C4:=-C3*B1;C5:=1/C4;
  766. D1:=1/C1;D2:=0;D3:=-1/(A1*B2);D4:=C5;D5:=C4>> ELSE
  767. <<BETA:=-A1*B2;C1:=1;C2:=1;C3:=SQRT(ABS(BETA))/A1;
  768. C4:=SQRT(ABS(BETA))/B2;C5:=1/SQRT(ABS(BETA));
  769. HELP:=1/B2-1/A1;D1:=1/(B2*HELP);D2:=-C5/HELP;
  770. D3:=-1/(A1*HELP);D4:=-D2;D5:=1/C5>>;
  771. IF NOT(NUMBERP(BETA)) THEN
  772. <<WRITE "Is ",BETA,">0 ? (y/n) and press <RETURN>";
  773. HE:=SYMBOLIC READ();
  774. IF HE=y THEN FLAG:=2 ELSE FLAG:=3>> ELSE
  775. IF BETA>0 THEN FLAG:=2 ELSE FLAG:=3;
  776. liemat:=MAT((C1,C2,0,0),(C3,C4,0,0),(0,0,C5,0),(0,0,0,1))*liemat;
  777. E1:=D1*(C1*A3+C2*A4)+D3*(C1*B3+C2*B4);
  778. E2:=D2*(C1*A3+C2*A4)+D4*(C1*B3+C2*B4);
  779. E3:=D1*(C3*A3+C4*A4)+D3*(C3*B3+C4*B4);
  780. E4:=D2*(C3*A3+C4*A4)+D4*(C3*B3+C4*B4);
  781. E5:=C5*A5*D1+C5*B5*D3;
  782. E6:=C5*A5*D2+C5*B5*D4>>;
  783. IF FLAG=2 THEN
  784. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(-E5/E1,-E6/E1,1,0),
  785. (0,0,-E2/E1,1/E1))*liemat;
  786. liemat:=MAT((1/2,1/2,0,0),(1/2,-1/2,0,0),(0,0,1/2,1/2),
  787. (0,0,-1/2,1/2))*liemat;
  788. if symbolic !*tr_lie then
  789. WRITE "[W,Y]=W, [X,Z]=X";lie_class:={liealg(4),comtab(3)}>> ELSE
  790. IF FLAG=3 THEN
  791. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(-E5/E1,-E6/E1,1,0),
  792. (0,0,E2/E1,1/E1))*liemat;
  793. if symbolic !*tr_lie then
  794. WRITE "-[W,Y]=[X,Z]=X, [X,Y]=[W,Z]=W";
  795. lie_class:={liealg(4),comtab(4)}>> ELSE
  796. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(-E5/E1,-E6/E1,1,0),
  797. (0,0,-E3/E1,1/E1))*liemat;
  798. if symbolic !*tr_lie then
  799. WRITE "[X,Y]=[W,Z]=W, [X,Z]=X";lie_class:={liealg(4),comtab(5)}>>;
  800. END;
  801. algebraic procedure com43(I1,J1,I2,J2,I3,J3);
  802. BEGIN INTEGER LL;
  803. MATRIX liemat(4,4),BB(4,4),FF(3,3);
  804. ARRAY l_Z(4,4,3);
  805. FOR I:=1:4 DO
  806. <<CC(2,1,I):=-CC(1,2,I);CC(3,1,I):=-CC(1,3,I);
  807. CC(3,2,I):=-CC(2,3,I);CC(4,1,I):=-CC(1,4,I);
  808. CC(4,2,I):=-CC(2,4,I);CC(4,3,I):=-CC(3,4,I);
  809. CC(1,1,I):=CC(2,2,I):=CC(3,3,I):=CC(4,4,I):=0;
  810. liemat(1,I):=CC(I1,J1,I);liemat(2,I):=CC(I2,J2,I);
  811. liemat(3,I):=CC(I3,J3,I)>>;
  812. liemat(4,1):=1;IF DET(liemat) NEQ 0 THEN LL:=1 ELSE
  813. FOR J:=2:4 DO <<liemat(4,J-1):=0;liemat(4,J):=1;
  814. IF DET(liemat) NEQ 0 THEN <<LL:=J;J:=4>>>>;
  815. BB:=1/liemat;
  816. FOR I:=1:3 DO
  817. <<l_Z(1,2,I):=FOR R:=1:4 SUM FOR S:=1:4 SUM FOR TT:=1:4 SUM
  818. liemat(1,R)*liemat(2,S)*CC(R,S,TT)*BB(TT,I);
  819. l_Z(1,3,I):=FOR R:=1:4 SUM FOR S:=1:4 SUM FOR TT:=1:4 SUM
  820. liemat(1,R)*liemat(3,S)*CC(R,S,TT)*BB(TT,I);
  821. l_Z(2,3,I):=FOR R:=1:4 SUM FOR S:=1:4 SUM FOR TT:=1:4 SUM
  822. liemat(2,R)*liemat(3,S)*CC(R,S,TT)*BB(TT,I);
  823. l_Z(1,4,I):=FOR R:=1:4 SUM FOR TT:=1:4 SUM
  824. liemat(1,R)*CC(R,LL,TT)*BB(TT,I);
  825. l_Z(2,4,I):=FOR R:=1:4 SUM FOR TT:=1:4 SUM
  826. liemat(2,R)*CC(R,LL,TT)*BB(TT,I);
  827. l_Z(3,4,I):=FOR R:=1:4 SUM FOR TT:=1:4 SUM
  828. liemat(3,R)*CC(R,LL,TT)*BB(TT,I)>>;
  829. FOR I:=1:3 DO
  830. <<FF(1,I):=l_Z(1,2,I);FF(2,I):=l_Z(1,3,I);FF(3,I):=l_Z(2,3,I)>>;
  831. LL:=0;
  832. FOR I:=1:3 DO FOR J:=1:3 DO
  833. IF FF(I,J) NEQ 0 THEN <<LL:=1;I:=3;J:=3>>;
  834. IF LL=0 THEN comcom0() ELSE
  835. IF DET(FF)=0 THEN comcom1() ELSE comcom3();
  836. CLEAR BB,FF,l_Z
  837. END;
  838. algebraic procedure comcom0();
  839. BEGIN SCALAR HE,A1,B1,C1,A2,B2,C2,A3,B3,C3,AA1,BB1,CC1,
  840. AA2,BB2,CC2,AL1,BE1,GA1,AL2,BE2,GA2,R,S,P,Q;
  841. A1:=l_Z(1,4,1);B1:=l_Z(1,4,2);C1:=l_Z(1,4,3);
  842. A2:=l_Z(2,4,1);B2:=l_Z(2,4,2);C2:=l_Z(2,4,3);
  843. A3:=l_Z(3,4,1);B3:=l_Z(3,4,2);C3:=l_Z(3,4,3);
  844. IF (A3=0 AND B3=0) THEN
  845. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1/C3))*liemat;
  846. AL1:=A1/C3;BE1:=B1/C3;GA1:=C1/C3;
  847. AL2:=A2/C3;BE2:=B2/C3;GA2:=C2/C3>> ELSE
  848. <<IF (A3=0 AND B3 NEQ 0) THEN
  849. <<liemat:=MAT((0,B3,C3,0),(1,0,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  850. AA1:=B2+C3;BB1:=B3*A2;CC1:=B3*C2-B2*C3;
  851. AA2:=B1/B3;BB2:=A1;CC2:=C1-B1*C3/B3>> ELSE
  852. <<liemat:=MAT((A3,B3,C3,0),(0,1,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  853. AA1:=A1+B3*A2/A3+C3;BB1:=A3*B1-A1*B3-B3*B3*A2/A3+B3*B2;
  854. CC1:=A3*C1-A1*C3-B3*A2*C3/A3+B3*C2;
  855. AA2:=A2/A3;BB2:=B2-A2*B3/A3;CC2:=C2-A2*C3/A3>>;
  856. <<liemat:=MAT((1,0,0,0),(0,1,-AA2,0),(0,0,1,0),(0,0,0,1))*liemat;
  857. CC1:=CC1+BB1*AA2;CC2:=CC2+BB2*AA2;AA2:=0>>;
  858. IF (BB1=0 AND AA1=BB2 AND CC2 NEQ 0) THEN
  859. <<liemat:=MAT((0,0,1,0),(0,1,0,0),(1,-CC1/CC2,0,0),(0,0,0,1/AA1))*
  860. liemat;
  861. AL1:=0;BE1:=CC1/(AA1*CC2);GA1:=1/AA1;
  862. AL2:=CC2/AA1;BE2:=1;GA2:=0>> ELSE
  863. IF (BB1=0 AND AA1 NEQ BB2 AND CC2 NEQ 0) THEN
  864. <<A1:=1/(BB2-AA1);B1:=(BB2*AA1-BB2*BB2+CC1)/(CC2*(AA1-BB2));
  865. liemat:=MAT((1,0,0,0),(0,1,0,0),(A1,B1,1,0),(0,0,0,1/BB2))*liemat;
  866. AL1:=(AA1-CC1*A1)/BB2;BE1:=-B1*CC1/BB2;GA1:=CC1/BB2;
  867. AL2:=-CC2*A1/BB2;BE2:=1-B1*CC2/BB2;GA2:=CC2/BB2>>ELSE
  868. IF(BB1=0 AND CC2=0) THEN
  869. <<liemat:=MAT((1,0,0,0),(0,0,1,0),(0,1,0,0),(0,0,0,1/BB2))*liemat;
  870. AL1:=AA1/BB2;BE1:=CC1/BB2;AL2:=1/BB2;GA1:=BE2:=GA2:=0>>
  871. ELSE
  872. <<R:=-AA1-BB2;S:=AA1*BB2-CC1;P:=S-R*R/3;
  873. Q:=2*R*R*R/27-S*R/3+BB2*CC1-BB1*CC2;
  874. C1:=(-Q/2+SQRT(Q*Q/4+P*P*P/27))**(1/3)+
  875. (-Q/2-SQRT(Q*Q/4+P*P*P/27))**(1/3)-R/3;
  876. A1:=(C1-BB2)/BB1;B1:=(C1-BB2)*(C1-AA1)/BB1;
  877. liemat:=MAT((1,0,0,0),(0,0,1,0),(A1,1,B1,0),(0,0,0,1/C1))*liemat;
  878. AL1:=(AA1-A1*BB1)/C1;BE1:=(CC1-B1*BB1)/C1;
  879. GA1:=BB1/C1;AL2:=1/C1;BE2:=GA2:=0>>>>;
  880. IF GA2 NEQ 0 THEN
  881. <<liemat:=MAT((1,-GA1/GA2,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  882. AA1:=AL1-GA1*AL2/GA2;BB1:=BE1+AL1*GA1/GA2-AL2*GA1*GA1/
  883. (GA2*GA2)-GA1*BE2/GA2;AA2:=AL2;BB2:=BE2+AL2*GA1/GA2;CC2:=GA2>>
  884. ELSE <<liemat:=MAT((0,1,0,0),(1,0,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  885. AA1:=BE2;BB1:=AL2;AA2:=BE1;BB2:=AL1;CC2:=GA1>>;
  886. IF (AA2=0 AND AA1-BB1-BB2=0 AND -AA1-BB1+BB2=0 AND CC2=0)
  887. THEN c0111(AA1,AA1) ELSE
  888. <<IF AA2=0 THEN
  889. IF (AA1-BB1-BB2) NEQ 0 THEN
  890. <<liemat:=MAT((1,0,0,0),(1,1,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  891. AA2:=AA1-BB1-BB2;BB2:=BB1+BB2;AA1:=AA1-BB1>> ELSE
  892. IF (-AA1-BB1+BB2) NEQ 0 THEN
  893. <<liemat:=MAT((1,0,0,0),(-1,1,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  894. AA2:=-AA1-BB1+BB2;BB2:=BB2-BB1;AA1:=AA1+BB1>> ELSE
  895. <<liemat:=MAT((0,0,1,0),(0,1,0,0),(1,0,0,0),(0,0,0,1/AA1))*liemat;
  896. AA2:=CC2/AA1;BB2:=1;CC2:=0;AA1:=1/AA1>>;
  897. liemat:=MAT((1,-AA1/AA2,AA1*CC2/AA2,0),(0,1,0,0),(0,0,1,0),
  898. (0,0,0,1))*liemat;
  899. BE1:=BB1-AA1*BB2/AA2;
  900. AL2:=AA2;BE2:=AA1+BB2;GA2:=CC2-AA1*CC2;
  901. liemat:=MAT((1,0,0,0),(-BE2,BE1,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  902. AA1:=BE2; AA2:=AL2*BE1;CC2:=GA2*BE1;
  903. IF (CC2 NEQ 0 AND AA2=(1-AA1)) THEN
  904. <<liemat:=MAT((1,0,0,0),(1,1,0,0),(0,0,CC2,0),(0,0,0,1))*liemat;
  905. AL1:=AA1-1;
  906. IF AL1=1 THEN
  907. <<if symbolic !*tr_lie then
  908. WRITE "[W,Z]=W+X, [X,Z]=X+Y, [Y,Z]=Y";
  909. lie_class:={liealg(4),comtab(12)}>>
  910. ELSE <<liemat:=MAT((0,0,1,0),(0,1,0,0),(1,1/(AL1-1),
  911. 1/((AL1-1)*(AL1-1)),0),(0,0,0,1/AL1))*liemat;
  912. liemat:=MAT((0,1,0,0),(1/AL1,0,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  913. if symbolic !*tr_lie then
  914. WRITE "[W,Z]=",1/AL1,"W+X, [X,Z]=",1/AL1,"X, [Y,Z]=Y";
  915. lie_class:={liealg(4),comtab(15),1/AL1}>>>> ELSE
  916. <<IF CC2 NEQ 0 THEN
  917. liemat:=MAT((1,0,-CC2/(1-AA2-AA1),0),(0,1,(-1+AA1)*
  918. CC2/(1-AA2-AA1),0),(0,0,CC2/(1-AA2-AA1),0),
  919. (0,0,0,1))*liemat;
  920. liemat:=MAT((1,0,0,0),(AA1/2,1,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  921. R:=(AA1*AA1/4+AA2);
  922. IF R=0 THEN
  923. <<if symbolic !*tr_lie then
  924. WRITE "[W,Z]=",AA1/2,"W+X, [X,Z]=",AA1/2,"X, [Y,Z]=Y";
  925. lie_class:={liealg(4),comtab(15),AA1/2}>> ELSE
  926. <<liemat:=MAT((SQRT(ABS(R)),0,0,0),(0,1,0,0),(0,0,1,0),
  927. (0,0,0,1))*liemat;
  928. IF NOT(NUMBERP(R)) THEN
  929. <<WRITE "Is ",R,"<0 ? (y/n) and press <RETURN>";
  930. HE:=SYMBOLIC READ();
  931. IF HE=y THEN
  932. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,1,0),
  933. (0,0,0,SQRT(ABS(1/R))))*liemat;
  934. S:=AA1/(2*SQRT(ABS(R)));
  935. if symbolic !*tr_lie then
  936. WRITE "[W,Z]=",S,"W+X, [X,Z]=-W+",S,"X, [Y,Z]=",
  937. SQRT(ABS(1/R)),"Y";
  938. lie_class:={liealg(4),comtab(14),S,SQRT(ABS(1/R))}>>
  939. ELSE
  940. <<liemat:=MAT((1,0,0,0),(1,1,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  941. liemat:=MAT((-2*SQRT(ABS(R)),SQRT(ABS(R)),0,0),
  942. (0,SQRT(ABS(R)),0,0),(0,0,1,0),(0,0,0,1))*liemat;
  943. <<c0111(AA1/2-SQRT(ABS(R)),AA1/2+SQRT(ABS(R)))>>>>>> ELSE
  944. IF R<0 THEN
  945. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,1,0),
  946. (0,0,0,SQRT(ABS(1/R))))*liemat;
  947. S:=AA1/(2*SQRT(ABS(R)));
  948. if symbolic !*tr_lie then
  949. WRITE "[W,Z]=",S,"W+X, [X,Z]=-W+",S,"X, [Y,Z]=",
  950. SQRT(ABS(1/R)),"Y";
  951. lie_class:={liealg(4),comtab(14),S,SQRT(ABS(1/R))}>>
  952. ELSE
  953. <<liemat:=MAT((1,0,0,0),(1,1,0,0),(0,0,1,0),(0,0,0,1))*liemat;
  954. liemat:=MAT((-2*SQRT(ABS(R)),SQRT(ABS(R)),0,0),
  955. (0,SQRT(ABS(R)),0,0),(0,0,1,0),(0,0,0,1))*liemat;
  956. c0111(AA1/2-SQRT(ABS(R)),AA1/2+SQRT(ABS(R)))>>>>
  957. >>>>
  958. END;
  959. algebraic procedure c0111(MY,NY);
  960. BEGIN
  961. liemat:=MAT((0,0,1,0),(1,0,0,0),(0,1,0,0),(0,0,0,1))*liemat;
  962. if symbolic !*tr_lie then
  963. WRITE "[W,Z]=W, [X,Z]=",MY,"X, [Y,Z]=",NY,"Y";
  964. lie_class:={liealg(4),comtab(13),MY,NY}
  965. END;
  966. ALGEBRAIC PROCEDURE COMCOM1();
  967. BEGIN INTEGER II;
  968. SCALAR HE,A1,A2,A3,B2,B3,C2,C3,HELP;
  969. MATRIX A11(4,4),A22(4,4),A33(4,4),CCC(3,3);
  970. HELP:=0;
  971. FOR M:=1:3 DO FOR N:=1:3 DO
  972. IF FF(M,N) NEQ 0 THEN <<II:=M;M:=3;N:=3>>;
  973. A11:=MAT((1,0,0,0),(0,1,0,0),(FF(II,1),FF(II,2),FF(II,3),0),
  974. (0,0,0,1));
  975. A22:=MAT((1,0,0,0),(0,0,1,0),(FF(II,1),FF(II,2),FF(II,3),0),
  976. (0,0,0,1));
  977. A33:=MAT((0,1,0,0),(0,0,1,0),(FF(II,1),FF(II,2),FF(II,3),0),
  978. (0,0,0,1));
  979. IF DET(A11) NEQ 0 THEN liemat:=A11*liemat ELSE
  980. IF DET(A22) NEQ 0 THEN liemat:=A22*liemat ELSE liemat:=A33*liemat;
  981. liemat:=MAT((0,0,1,0),(1,0,0,0),(0,1,0,0),(0,0,0,1))*liemat;
  982. A11:=1/liemat;
  983. FOR M:=1:3 DO FOR N:=1:3 DO
  984. CCC(M,N):=FOR I:=1:4 SUM FOR J:=1:4 SUM FOR K:=1:4 SUM
  985. liemat(M,I)*liemat(4,J)*CC(I,J,K)*A11(K,N);
  986. A1:=CCC(1,1);A2:=CCC(2,1);A3:=CCC(3,1);B2:=CCC(2,2);
  987. B3:=CCC(3,2);C2:=CCC(2,3);C3:=CCC(3,3);
  988. IF A1=0 THEN
  989. <<IF C2=0 THEN
  990. IF B3=0 THEN
  991. <<liemat:=MAT((1,0,0,0),(0,1,1,0),(0,0,1,0),(0,0,0,1))*liemat;
  992. A2:=A2+A3;C2:=-2*B2>> ELSE
  993. <<liemat:=MAT((1,0,0,0),(0,1,B2/B3,0),(0,0,1,0),(0,0,0,1))*liemat;
  994. A2:=A2+A3*B2/B3;C2:=-3*B2*B2/B3;B2:=2*B2>>;
  995. HELP:=B2*B2+C2*B3;C3:=SQRT(ABS(HELP));
  996. liemat:=MAT((C2/C3,0,0,0),(0,1,0,0),(0,B2/C3,C2/C3,0),
  997. (0,A3*C3/HELP,-A2*C3/HELP,C3/HELP))*liemat;
  998. if symbolic !*tr_lie then
  999. WRITE "[X,Y]=W, [X,Z]=",HELP/ABS(HELP),"Y, [Y,Z]=X";
  1000. if HELP>0 then lie_class:={liealg(4),comtab(19)} else
  1001. lie_class:={liealg(4),comtab(20)}>> ELSE
  1002. <<liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,1,0),
  1003. (0,2*A3/A1,-2*A2/A1,2/A1))*liemat;
  1004. B2:=2*B2/A1;C2:=2*C2/A1;B3:=2*B3/A1;C3:=2*C3/A1;
  1005. IF B3 NEQ 0 THEN
  1006. <<liemat:=MAT((1,0,0,0),(0,1,(1-B2)/B3,0),(0,0,1,0),(0,0,0,1))*liemat;
  1007. C2:=C2+(1-B2)*(C3-1)/B3;B2:=C3:=1;
  1008. IF C2=0 THEN
  1009. <<liemat:=MAT((-1,0,0,0),(0,0,1,0),(0,1,0,0),(0,0,0,1))*liemat;
  1010. C2:=B3>> ELSE
  1011. <<A1:=B3/ABS(B3);A2:=C2/ABS(C2);A3:=SQRT(ABS(B3*C2));
  1012. liemat:=MAT((1,0,0,0),(0,(ABS(B3/C2))**(1/4),0,0),
  1013. (0,0,(ABS(C2/B3))**(1/4),0),(0,0,0,1))*liemat;
  1014. IF A1=A2 THEN
  1015. <<IF NOT(NUMBERP(A1)) THEN
  1016. <<WRITE "Is ",A1,"<0 ? (y/n) and press <RETURN>";
  1017. HE:=SYMBOLIC READ();
  1018. IF HE=y THEN A3:=-A3>> ELSE
  1019. IF A1<0 THEN A3:=-A3;
  1020. liemat:=MAT((1,0,0,0),(0,1,0,0),(0,1,1,0),(0,0,0,1))*liemat;
  1021. B2:=1-A3;C2:=A3;C3:=A3+1>> ELSE
  1022. <<HELP:=1;
  1023. IF NOT(NUMBERP(A1)) THEN
  1024. <<WRITE "Is ",A1,"<0 ? (y/n) and press <RETURN>";
  1025. HE:=SYMBOLIC READ();
  1026. IF HE=y THEN
  1027. liemat:=MAT((-1,0,0,0),(0,0,1,0),(0,1,0,0),(0,0,0,1))*
  1028. liemat>> ELSE
  1029. IF A1<0 THEN
  1030. liemat:=MAT((-1,0,0,0),(0,0,1,0),(0,1,0,0),(0,0,0,1))
  1031. *liemat;
  1032. if symbolic !*tr_lie then
  1033. WRITE "[W,Z]=2W, [X,Y]=W, [X,Z]=X-",A3,"Y, ",
  1034. "[Y,Z]=",A3,"X+Y";lie_class:={liealg(4),comtab(17),A3}>>>>>>;
  1035. IF (HELP NEQ 1) THEN
  1036. IF (C2=0 OR B2 NEQ C3) THEN
  1037. <<IF (B2 NEQ C3) THEN
  1038. liemat:=MAT((1,0,0,0),(0,1,C2/(B2-C3),0),(0,0,1,0),(0,0,0,1))*
  1039. liemat;
  1040. IF NOT(NUMBERP(B2)) THEN
  1041. <<WRITE "Is ",B2,"<1 ? (y/n) and press <RETURN>";
  1042. HE:=SYMBOLIC READ();
  1043. IF HE=y THEN
  1044. liemat:=MAT((-1,0,0,0),(0,0,1,0),(0,1,0,0),(0,0,0,1))*liemat;
  1045. HELP:=B2;B2:=C3;C3:=HELP>> ELSE
  1046. IF B2<1 THEN
  1047. <<liemat:=MAT((-1,0,0,0),(0,0,1,0),(0,1,0,0),(0,0,0,1))*liemat;
  1048. HELP:=B2;B2:=C3;C3:=HELP>>;
  1049. if symbolic !*tr_lie then
  1050. WRITE "[W,Z]=2W, [X,Y]=W, [X,Z]=",B2,"X, [Y,Z]=",C3,"Y";
  1051. lie_class:={liealg(4),comtab(16),B2-1}>> ELSE
  1052. <<liemat:=MAT((1,0,0,0),(0,1/SQRT(ABS(C2)),0,0),
  1053. (0,0,SQRT(ABS(C2)),0),(0,0,0,1))*liemat;
  1054. IF NOT(NUMBERP(C2)) THEN
  1055. <<WRITE "Is ",C2,"<0 ? (y/n) and press <RETURN>";
  1056. HE:=SYMBOLIC READ();
  1057. IF HE=y THEN
  1058. liemat:=MAT((-1,0,0,0),(0,1,0,0),(0,0,-1,0),(0,0,0,1))*
  1059. liemat>> ELSE
  1060. IF C2<0 THEN
  1061. liemat:=MAT((-1,0,0,0),(0,1,0,0),(0,0,-1,0),(0,0,0,1))*liemat;
  1062. if symbolic !*tr_lie then
  1063. WRITE "[W,Z]=2W, [X,Y]=W, [X,Z]=X+Y, [Y,Z]=Y";
  1064. lie_class:={liealg(4),comtab(18)}>>>>;
  1065. CLEAR A11,A22,A33,CCC
  1066. END;
  1067. algebraic procedure comcom3();
  1068. BEGIN INTEGER HELP;
  1069. SCALAR HE,AL,BE,GA;
  1070. MATRIX l_K(3,3),l_A(3,3);
  1071. HELP:=0;
  1072. l_K(1,1):=FF(1,2)**2+2*FF(1,3)*FF(2,2)+FF(2,3)**2;
  1073. l_K(1,2):=-FF(1,1)*FF(1,2)+FF(1,3)*FF(3,2)-
  1074. FF(2,1)*FF(1,3)+FF(2,3)*FF(3,3);
  1075. l_K(1,3):=-FF(1,1)*FF(2,2)-FF(1,2)*FF(3,2)-
  1076. FF(2,1)*FF(2,3)-FF(2,2)*FF(3,3);
  1077. l_K(2,1):=l_K(1,2);
  1078. l_K(2,2):=FF(1,1)**2-2*FF(1,3)*FF(3,1)+FF(3,3)**2;
  1079. l_K(2,3):=FF(1,1)*FF(2,1)+FF(1,2)*FF(3,1)-
  1080. FF(3,1)*FF(2,3)-FF(3,2)*FF(3,3);
  1081. l_K(3,1):=l_K(1,3);l_K(3,2):=l_K(2,3);
  1082. l_K(3,3):=FF(2,1)**2+2*FF(2,2)*FF(3,1)+FF(3,2)**2;
  1083. IF NOT(NUMBERP(l_K(1,1)) AND
  1084. NUMBERP(l_K(1,1)*l_K(2,2)-l_K(1,2)*l_K(2,1)) AND
  1085. NUMBERP(DET(l_K))) THEN
  1086. <<WRITE "Is ",-l_K(1,1),">0 and ",
  1087. l_K(1,1)*l_K(2,2)-l_K(1,2)*l_K(2,1),">0 and ",
  1088. -DET(l_K),">0 ? (y/n) and press <RETURN>";
  1089. HE:=SYMBOLIC READ();
  1090. IF HE=y THEN <<HELP:=1;lie4so3()>> ELSE lie4so21()>> ELSE
  1091. IF (-l_K(1,1)>0 AND l_K(1,1)*l_K(2,2)-l_K(1,2)*l_K(2,1)>0 AND
  1092. -DET(l_K)>0) THEN
  1093. <<HELP:=1;lie4so3()>> ELSE lie4so21();
  1094. liemat:=MAT((l_A(1,1),l_A(1,2),l_A(1,3),0),(l_A(2,1),l_A(2,2),
  1095. l_A(2,3),0), (l_A(3,1),l_A(3,2),l_A(3,3),0),(0,0,0,1))*liemat;
  1096. BB:=1/liemat;
  1097. AL:=FOR J:=1:4 SUM FOR K:=1:4 SUM FOR L:=1:4 SUM
  1098. liemat(1,J)*liemat(4,K)*CC(J,K,L)*BB(L,2);
  1099. BE:=FOR J:=1:4 SUM FOR K:=1:4 SUM FOR L:=1:4 SUM
  1100. liemat(1,J)*liemat(4,K)*CC(J,K,L)*BB(L,3);
  1101. GA:=FOR J:=1:4 SUM FOR K:=1:4 SUM FOR L:=1:4 SUM
  1102. liemat(2,J)*liemat(4,K)*CC(J,K,L)*BB(L,3);
  1103. IF HELP=1 THEN
  1104. liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,1,0),(GA,-BE,AL,1))*liemat ELSE
  1105. liemat:=MAT((1,0,0,0),(0,1,0,0),(0,0,1,0),(GA,-BE,-AL,1))*liemat;
  1106. IF HELP=1 THEN
  1107. <<if symbolic !*tr_lie then
  1108. WRITE "[W,X]=Y, [W,Y]=-X, [X,Y]=W";
  1109. lie_class:={liealg(4),comtab(21)}>> ELSE
  1110. <<if symbolic !*tr_lie then
  1111. WRITE "[W,X]=Y, [W,Y]=X, [X,Y]=W";
  1112. lie_class:={liealg(4),comtab(22)}>>;
  1113. CLEAR l_K,l_A
  1114. END;
  1115. algebraic procedure lie4so3();
  1116. BEGIN SCALAR S,TT,Q,R,ALPHA;
  1117. S:=FF(2,2)/ABS(FF(2,2));
  1118. TT:=ABS(FF(1,2)**2+FF(1,3)*FF(2,2));
  1119. R:=FF(1,1)-FF(1,2)*FF(2,1)/FF(2,2);
  1120. ALPHA:=TT*(-R*R-((FF(2,1)/FF(2,2))**2+FF(3,1)/FF(2,2))*TT);
  1121. Q:=1/SQRT(ALPHA);
  1122. l_A(1,1):=1/(S*SQRT(TT));l_A(1,2):=l_A(1,3):=l_A(2,2):=0;l_A(2,1):=Q*R;
  1123. l_A(2,3):=-Q*TT/FF(2,2);l_A(3,1):=-Q*S*SQRT(TT)*FF(2,1)/FF(2,2);
  1124. l_A(3,2):=-Q*S*SQRT(TT);l_A(3,3):=Q*S*SQRT(TT)*FF(1,2)/FF(2,2)
  1125. END;
  1126. algebraic procedure lie4so21();
  1127. BEGIN SCALAR GAM,EPS,S,TT,Q,R,ALPHA;
  1128. MATRIX l_G(3,3);
  1129. l_A:=MAT((1,0,0),(0,1,0),(0,0,1));
  1130. IF FF(2,2)=0 THEN
  1131. IF FF(1,3) NEQ 0 THEN <<l_A:=MAT((1,0,0),(0,0,1),(0,1,0));
  1132. l_G(1,1):=FF(2,1);l_G(1,2):=FF(2,3);l_G(1,3):=FF(2,2);
  1133. l_G(2,1):=FF(1,1);l_G(2,2):=FF(1,3);l_G(2,3):=FF(1,2);
  1134. l_G(3,1):=-FF(3,1);l_G(3,2):=-FF(3,3);l_G(3,3):=-FF(3,2);FF:=l_G>>
  1135. ELSE
  1136. IF FF(3,1) NEQ 0 THEN <<l_A:=MAT((0,1,0),(1,0,0),(0,0,1));
  1137. l_G(1,1):=-FF(1,2);l_G(1,2):=-FF(1,1);l_G(1,3):=-FF(1,3);
  1138. l_G(2,1):=FF(3,2);l_G(2,2):=FF(3,1);l_G(2,3):=FF(3,3);
  1139. l_G(3,1):=FF(2,2);l_G(3,2):=FF(2,1);l_G(3,3):=FF(2,3);FF:=l_G>> ELSE
  1140. <<l_A:=MAT((1,0,1),(1,0,0),(0,1,0));
  1141. l_G(1,1):=-FF(2,3);l_G(1,2):=FF(2,3)-FF(2,1);l_G(1,3):=0;
  1142. l_G(2,1):=-FF(3,3);l_G(2,2):=2*FF(1,1);l_G(2,3):=FF(1,2)-FF(3,2);
  1143. l_G(3,1):=0;l_G(3,2):=FF(1,1);l_G(3,3):=FF(1,2);FF:=l_G>>;
  1144. IF FF(1,2)**2+FF(1,3)*FF(2,2)=0 THEN
  1145. <<GAM:=-FF(1,2)/FF(2,2);EPS:=FF(1,1)-FF(1,2)*FF(2,1)/FF(2,2);
  1146. IF 1/4*(FF(3,2)**2+FF(3,1)*FF(2,2))-EPS*FF(2,2)/2=0 THEN
  1147. <<l_A:=MAT((0,0,1),(0,2/EPS,2*GAM/EPS),(1,0,0))*l_A;
  1148. l_G(1,1):=2*GAM*FF(3,2)/EPS-FF(3,3);
  1149. l_G(1,2):=-FF(3,2);l_G(1,3):=-2*FF(3,1)/EPS;
  1150. l_G(2,1):=0;l_G(2,2):=-EPS*FF(2,2)/2;l_G(2,3):=-FF(2,1);
  1151. l_G(3,1):=l_G(3,2):=0;l_G(3,3):=-2;FF:=l_G>> ELSE
  1152. <<l_A:=MAT((1/2,0,1/2),(0,1/EPS,GAM/EPS),(-1/2,0,1/2))*l_A;
  1153. l_G(1,1):=-FF(3,1)/(2*EPS);l_G(1,2):=-FF(3,2)/2;
  1154. l_G(1,3):=FF(3,1)/(2*EPS)-1;
  1155. l_G(2,1):=FF(2,1)/2;l_G(2,2):=FF(2,2)*EPS/2;
  1156. l_G(2,3):=-FF(2,1)/2;l_G(3,1):=FF(3,1)/(2*EPS)+1;
  1157. l_G(3,2):=FF(3,2)/2;l_G(3,3):=-FF(3,1)/(2*EPS);FF:=l_G>>>>;
  1158. IF NOT(NUMBERP(FF(1,2)**2+FF(1,3)*FF(2,2))) THEN
  1159. <<WRITE "Is ",FF(1,2)**2+FF(1,3)*FF(2,2),
  1160. "<0 ? (y/n) and press <RETURN>";
  1161. HE:=SYMBOLIC READ();
  1162. IF HE=y THEN
  1163. <<S:=FF(2,2)/ABS(FF(2,2));
  1164. TT:=ABS(FF(1,2)**2+FF(1,3)*FF(2,2));
  1165. R:=FF(1,1)-FF(1,2)*FF(2,1)/FF(2,2);
  1166. ALPHA:=TT*(-R*R-((FF(2,1)/FF(2,2))**2+FF(3,1)/FF(2,2))*TT);
  1167. Q:=1/SQRT(ABS(ALPHA));
  1168. l_G(1,1):=-Q*S*SQRT(TT)*FF(2,1)/FF(2,2);
  1169. l_G(1,2):=-Q*S*SQRT(TT);l_G(1,3):=Q*S*SQRT(TT)*FF(1,2)/FF(2,2);
  1170. l_G(2,1):=1/(S*SQRT(TT));l_G(2,2):=l_G(2,3):=0;
  1171. l_G(3,1):=Q*R;l_G(3,2):=0;l_G(3,3):=-Q*TT/FF(2,2);l_A:=l_G*l_A>> ELSE
  1172. <<S:=FF(2,2)/ABS(FF(2,2));
  1173. TT:=FF(1,2)**2+FF(1,3)*FF(2,2);
  1174. R:=FF(1,1)-FF(1,2)*FF(2,1)/FF(2,2);
  1175. ALPHA:=TT*(R*R-((FF(2,1)/FF(2,2))**2+FF(3,1)/FF(2,2))*TT);
  1176. Q:=1/SQRT(ABS(ALPHA));
  1177. IF NOT(NUMBERP(ALPHA)) THEN
  1178. <<WRITE "Is ",ALPHA,">0 ? (y/n) and press <RETURN>";
  1179. HE:=SYMBOLIC READ();
  1180. IF HE =y THEN
  1181. <<l_G(1,1):=1/(S*SQRT(TT));l_G(1,2):=l_G(1,3):=0;
  1182. l_G(2,1):=Q*R;l_G(2,2):=0;l_G(2,3):=Q*TT/FF(2,2);
  1183. l_G(3,1):=Q*S*SQRT(TT)*FF(2,1)/FF(2,2);l_G(3,2):=Q*S*SQRT(TT);
  1184. l_G(3,3):=-Q*S*SQRT(TT)*FF(1,2)/FF(2,2);l_A:=l_G*l_A>> ELSE
  1185. <<l_G(1,1):=1/(S*SQRT(TT));l_G(1,2):=l_G(1,3):=0;
  1186. l_G(2,1):=Q*S*SQRT(TT)*FF(2,1)/FF(2,2);l_G(2,2):=Q*S*SQRT(TT);
  1187. l_G(2,3):=-Q*S*SQRT(TT)*FF(1,2)/FF(2,2);
  1188. l_G(3,1):=Q*R;l_G(3,2):=0;l_G(3,3):=Q*TT/FF(2,2);
  1189. l_A:=l_G*l_A>>>> ELSE
  1190. IF ALPHA>0 THEN
  1191. <<l_G(1,1):=1/(S*SQRT(TT));l_G(1,2):=l_G(1,3):=0;
  1192. l_G(2,1):=Q*R;l_G(2,2):=0;l_G(2,3):=Q*TT/FF(2,2);
  1193. l_G(3,1):=Q*S*SQRT(TT)*FF(2,1)/FF(2,2);l_G(3,2):=Q*S*SQRT(TT);
  1194. l_G(3,3):=-Q*S*SQRT(TT)*FF(1,2)/FF(2,2);l_A:=l_G*l_A>> ELSE
  1195. <<l_G(1,1):=1/(S*SQRT(TT));l_G(1,2):=l_G(1,3):=0;
  1196. l_G(2,1):=Q*S*SQRT(TT)*FF(2,1)/FF(2,2);l_G(2,2):=Q*S*SQRT(TT);
  1197. l_G(2,3):=-Q*S*SQRT(TT)*FF(1,2)/FF(2,2);
  1198. l_G(3,1):=Q*R;l_G(3,2):=0;l_G(3,3):=Q*TT/FF(2,2);l_A:=l_G*l_A>>
  1199. >>>> ELSE
  1200. IF FF(1,2)**2+FF(1,3)*FF(2,2)<0 THEN
  1201. <<S:=FF(2,2)/ABS(FF(2,2));
  1202. TT:=ABS(FF(1,2)**2+FF(1,3)*FF(2,2));
  1203. R:=FF(1,1)-FF(1,2)*FF(2,1)/FF(2,2);
  1204. ALPHA:=TT*(-R*R-((FF(2,1)/FF(2,2))**2+FF(3,1)/FF(2,2))*TT);
  1205. Q:=1/SQRT(ABS(ALPHA));
  1206. l_G(1,1):=-Q*S*SQRT(TT)*FF(2,1)/FF(2,2);
  1207. l_G(1,2):=-Q*S*SQRT(TT);l_G(1,3):=Q*S*SQRT(TT)*FF(1,2)/FF(2,2);
  1208. l_G(2,1):=1/(S*SQRT(TT));l_G(2,2):=l_G(2,3):=0;
  1209. l_G(3,1):=Q*R;l_G(3,2):=0;l_G(3,3):=-Q*TT/FF(2,2);
  1210. l_A:=l_G*l_A>> ELSE
  1211. <<S:=FF(2,2)/ABS(FF(2,2));
  1212. TT:=FF(1,2)**2+FF(1,3)*FF(2,2);
  1213. R:=FF(1,1)-FF(1,2)*FF(2,1)/FF(2,2);
  1214. ALPHA:=TT*(R*R-((FF(2,1)/FF(2,2))**2+FF(3,1)/FF(2,2))*TT);
  1215. Q:=1/SQRT(ABS(ALPHA));
  1216. IF NOT(NUMBERP(ALPHA)) THEN
  1217. <<WRITE "Is ",ALPHA,">0 ? (y/n) and press <RETURN>";
  1218. HE:=SYMBOLIC READ();
  1219. IF HE =y THEN
  1220. <<l_G(1,1):=1/(S*SQRT(TT));l_G(1,2):=l_G(1,3):=0;
  1221. l_G(2,1):=Q*R;l_G(2,2):=0;l_G(2,3):=Q*TT/FF(2,2);
  1222. l_G(3,1):=Q*S*SQRT(TT)*FF(2,1)/FF(2,2);l_G(3,2):=Q*S*SQRT(TT);
  1223. l_G(3,3):=-Q*S*SQRT(TT)*FF(1,2)/FF(2,2);l_A:=l_G*l_A>> ELSE
  1224. <<l_G(1,1):=1/(S*SQRT(TT));l_G(1,2):=l_G(1,3):=0;
  1225. l_G(2,1):=Q*S*SQRT(TT)*FF(2,1)/FF(2,2);l_G(2,2):=Q*S*SQRT(TT);
  1226. l_G(2,3):=-Q*S*SQRT(TT)*FF(1,2)/FF(2,2);
  1227. l_G(3,1):=Q*R;l_G(3,2):=0;l_G(3,3):=Q*TT/FF(2,2);
  1228. l_A:=l_G*l_A>>>> ELSE
  1229. IF ALPHA>0 THEN
  1230. <<l_G(1,1):=1/(S*SQRT(TT));l_G(1,2):=l_G(1,3):=0;
  1231. l_G(2,1):=Q*R;l_G(2,2):=0;l_G(2,3):=Q*TT/FF(2,2);
  1232. l_G(3,1):=Q*S*SQRT(TT)*FF(2,1)/FF(2,2);l_G(3,2):=Q*S*SQRT(TT);
  1233. l_G(3,3):=-Q*S*SQRT(TT)*FF(1,2)/FF(2,2);l_A:=l_G*l_A>> ELSE
  1234. <<l_G(1,1):=1/(S*SQRT(TT));l_G(1,2):=l_G(1,3):=0;
  1235. l_G(2,1):=Q*S*SQRT(TT)*FF(2,1)/FF(2,2);l_G(2,2):=Q*S*SQRT(TT);
  1236. l_G(2,3):=-Q*S*SQRT(TT)*FF(1,2)/FF(2,2);
  1237. l_G(3,1):=Q*R;l_G(3,2):=0;l_G(3,3):=Q*TT/FF(2,2);l_A:=l_G*l_A>>>>;
  1238. CLEAR l_G
  1239. END;
  1240. endmodule;
  1241. end;