PHYSOP.LOG 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
  2. COMMENT
  3. test file for the PHYSOP package;
  4. % load_package physop; % Load a compiled version of the physop package.
  5. % showtime;
  6. linelength(72)$
  7. % Example 1: Quantum Mechanics of a Dirac particle in an external
  8. % electromagnetic field
  9. VECOP P,A,K;
  10. SCALOP M;
  11. NONCOM P,A;
  12. PHYSINDEX J,L;
  13. oporder M,K,A,P;
  14. % we have to set off allfac here since otherwise there appear
  15. % spurious negative powers in the printed output
  16. off allfac;
  17. FOR ALL J,L LET COMM(P(J),A(L))=K(J)*A(L);
  18. H:= COMMUTE(P**2/(2*M),E/(4*M**2)*(P DOT A));
  19. -1 -1 -1
  20. h := (e*(m )*(m )*(m )*k(idx1)*k(idx1)*k(idx2)*a(idx2)
  21. -1 -1 -1
  22. + e*(m )*(m )*(m )*k(idx1)*k(idx1)*a(idx2)*p(idx2)
  23. -1 -1 -1
  24. + e*(m )*(m )*(m )*k(idx1)*k(idx2)*a(idx2)*p(idx1)
  25. -1 -1 -1
  26. + e*(m )*(m )*(m )*k(idx1)*a(idx2)*p(idx1)*p(idx2)
  27. -1 -1 -1
  28. + e*(m )*(m )*(m )*k(idx1)*k(idx2)*a(idx2)*p(idx1)
  29. -1 -1 -1
  30. + e*(m )*(m )*(m )*k(idx1)*a(idx2)*p(idx1)*p(idx2))/8
  31. % showtime;
  32. %assign the corresponding value to the adjoint of H
  33. H!+ := adj H;
  34. + + + + + -1 -1
  35. (h ) := (2*e*(p(idx1) )*(p(idx2) )*(a(idx2) )*(k(idx1) )*(m!+ )*(m!+ )
  36. -1 + + + +
  37. *(m!+ ) + 2*e*(p(idx1) )*(a(idx2) )*(k(idx1) )*(k(idx2) )
  38. -1 -1 -1 + + +
  39. *(m!+ )*(m!+ )*(m!+ ) + e*(p(idx2) )*(a(idx2) )*(k(idx1) )
  40. + -1 -1 -1 + +
  41. *(k(idx1) )*(m!+ )*(m!+ )*(m!+ ) + e*(a(idx2) )*(k(idx1) )
  42. + + -1 -1 -1
  43. *(k(idx1) )*(k(idx2) )*(m!+ )*(m!+ )*(m!+ ))/8
  44. % showtime;
  45. % note the ordering of operators in the result!
  46. % enhance the readability of the output
  47. on allfac;
  48. ON CONTRACT;
  49. H;
  50. 3
  51. (e*m!-1
  52. 2 2
  53. *(k *k dot a + k *a dot p + 2*a dot p*k dot p + 2*k dot a*k dot p))/8
  54. % showtime;
  55. % Example 2: Virasoro Algebra from Conformal Field Theory
  56. operator del;
  57. % this is just a definition of a delta function
  58. for all n such that numberp n let del(n) =
  59. if n=0 then 1
  60. else 0;
  61. scalop l;
  62. noncom l,l;
  63. state bra,ket;
  64. % commutation relation of the operator l;
  65. for all n,m let comm(l(n),l(m)) =
  66. (m-n)*l(n+m)+c/12*(m**3-m)*del(n+m)*unit;
  67. %modified 1.1
  68. for all n let l!+(n) = l(-n);
  69. % relation for the states
  70. for all h let bra!+(h) = ket(h);
  71. for all p,q let bra(q) | ket(p) = del(p-q);
  72. for all r,h such that r < 0 or (r <2 and h=0) let
  73. l(r) | ket(h) = 0;
  74. for all r,h such that r > 0 or (r > -2 and h = 0) let
  75. bra(h) | l(r) = 0;
  76. % define a procedure to calculate V.E.V.
  77. procedure Vak(X);
  78. bra(0) | X | ket(0);
  79. vak
  80. % and now some calculations;
  81. MA:= adj(l(3)*l(5))*l(3)*l(5);
  82. 2
  83. ma := 20*c *unit + 332*c*unit + 2*c*l(5)*l(-5) + 10*c*l(3)*l(-3)
  84. + 80*c*l(0) + 2*l(8)*l(-3)*l(-5) + 4*l(8)*l(-8)
  85. + l(5)*l(3)*l(-3)*l(-5) + 2*l(5)*l(3)*l(-8) + 6*l(5)*l(0)*l(-5)
  86. + 8*l(5)*l(-2)*l(-3) + 60*l(5)*l(-5) + 8*l(3)*l(2)*l(-5)
  87. 2
  88. + 10*l(3)*l(0)*l(-3) + 112*l(3)*l(-3) + 64*l(2)*l(-2) + 60*l(0)
  89. + 556*l(0)
  90. %modified 1.1
  91. % showtime;
  92. % here is the VEV of m
  93. vak(Ma);
  94. 4*c*(5*c + 83)
  95. % showtime;
  96. % and now calculate another matrix element
  97. matel := bra(1) | ma | ket(1);
  98. *************** WARNING: ***************
  99. Evaluation incomplete due to missing elementary relations
  100. 2
  101. matel := 20*c + 332*c + bra(1) | (l(0) | 556*ket(1))
  102. + bra(1) | (l(0) | 80*c*ket(1))
  103. + bra(1) | (l(0)*l(0) | 60*ket(1))
  104. %modified 1.1
  105. % showtime;
  106. % this evaluation is incomplete so supply the missing relation
  107. for all h let l(0) | ket(h) = h*ket(h);
  108. % and reevaluate matel
  109. matel := matel;
  110. 2
  111. matel := 4*(5*c + 103*c + 154)
  112. % showtime;
  113. % Example 4: some manipulations with gamma matrices to demonstrate
  114. % the use of commutators and anticommutators
  115. off allfac;
  116. vecop gamma,q;
  117. tensop sigma(2);
  118. antisymmetric sigma;
  119. noncom gamma,gamma;
  120. noncom sigma,gamma;
  121. physindex mu,nu;
  122. operator delta;
  123. for all mu,nu let anticomm(gamma(mu),gamma(nu))=2*delta(mu,nu)*unit,
  124. comm(gamma(mu),gamma(nu))=2*I*sigma(mu,nu);
  125. oporder p,q,gamma,sigma;
  126. off allfac;
  127. on anticom;
  128. (gamma dot p)*(gamma dot q);
  129. p(idx4)*q(idx5)*gamma(idx4)*gamma(idx5)
  130. % showtime;
  131. off anticom;
  132. (gamma dot p)*(gamma dot q);
  133. p(idx6)*q(idx7)*gamma(idx6)*gamma(idx7)
  134. % showtime;
  135. commute((gamma dot p),(gamma dot q));
  136. 2*i*p(idx8)*q(idx9)*sigma(idx8,idx9)
  137. % showtime;
  138. anticommute((gamma dot p),(gamma dot q));
  139. - 2*i*p(idx10)*q(idx11)*sigma(idx10,idx11)
  140. + 2*p(idx10)*q(idx11)*gamma(idx10)*gamma(idx11)
  141. on anticom;
  142. anticommute((gamma dot p),(gamma dot q));
  143. 2*delta(idx13,idx12)*p(idx12)*q(idx13)
  144. % showtime;
  145. end;
  146. (TIME: physop 1010 1010)