File r34.1/lib/physop.log artifact 9d2d305623 part of check-in 3af273af29


REDUCE 3.4.1, 15-Jul-92 ...

1: 
(PHYSOP)


COMMENT
        test file for the PHYSOP package;

% load_package physop;  % Load a compiled version of the physop package.
showtime;


Time: 0 ms

linelength(72)$


% Example 1: Quantum Mechanics of a Dirac particle in an external
%                      electromagnetic field
VECOP P,A,K;


SCALOP M;


NONCOM P,A;


PHYSINDEX J,L;


oporder M,K,A,P;



% we have to set off allfac here since otherwise there appear
% spurious negative powers in the printed output
 off allfac;


FOR ALL J,L LET COMM(P(J),A(L))=K(J)*A(L);


H:= COMMUTE(P**2/(2*M),E/(4*M**2)*(P DOT A));


          -1    -1    -1
H := (E*(M  )*(M  )*(M  )*K(IDX1)*K(IDX1)*K(IDX2)*A(IDX2)

             -1    -1    -1
       + E*(M  )*(M  )*(M  )*K(IDX1)*K(IDX1)*A(IDX2)*P(IDX2)

             -1    -1    -1
       + E*(M  )*(M  )*(M  )*K(IDX1)*K(IDX2)*A(IDX2)*P(IDX1)

             -1    -1    -1
       + E*(M  )*(M  )*(M  )*K(IDX1)*A(IDX2)*P(IDX1)*P(IDX2)

             -1    -1    -1
       + E*(M  )*(M  )*(M  )*K(IDX1)*K(IDX2)*A(IDX2)*P(IDX1)

             -1    -1    -1
       + E*(M  )*(M  )*(M  )*K(IDX1)*A(IDX2)*P(IDX1)*P(IDX2))

     /8

showtime;


Time: 272 ms

%assign the corresponding value to the adjoint of H
H!+ := adj H;


  +                  +          +          +          +
(H ) := (2*E*(P(IDX1) )*(P(IDX2) )*(A(IDX2) )*(K(IDX1) )

              -1      -1      -1                +          +
         *(M!+  )*(M!+  )*(M!+  ) + 2*E*(P(IDX1) )*(A(IDX2) )

                  +          +      -1      -1      -1
         *(K(IDX1) )*(K(IDX2) )*(M!+  )*(M!+  )*(M!+  ) + E

                  +          +          +          +      -1
         *(P(IDX2) )*(A(IDX2) )*(K(IDX1) )*(K(IDX1) )*(M!+  )

              -1      -1              +          +
         *(M!+  )*(M!+  ) + E*(A(IDX2) )*(K(IDX1) )

                  +          +      -1      -1      -1
         *(K(IDX1) )*(K(IDX2) )*(M!+  )*(M!+  )*(M!+  ))/8

showtime;


Time: 272 ms

% note the ordering of operators in the result!
% enhance the readability of the output
 on allfac;


ON CONTRACT;


H;


       3   2            2
(E*M!-1 *(K *K DOT A + K *A DOT P + 2*A DOT P*K DOT P

           + 2*K DOT A*K DOT P))/8

showtime;


Time: 102 ms

% Example 2: Virasoro Algebra from Conformal Field Theory


operator  del;

  % this is just a definition of a delta function
for all n such that numberp n let del(n) =
     if n=0 then 1
     else 0;



scalop l;


noncom l,l;


state bra,ket;


% commutation relation of the operator l;
for all n,m let comm(l(n),l(m)) =
      (m-n)*l(n+m)+c/12*(m**3-m)*del(n+m)*unit;

 %modified 1.1

for all n let l!+(n) = l(-n);




% relation for the states
for all h let bra!+(h) = ket(h);


for all p,q let bra(q) | ket(p) = del(p-q);



for all r,h such that r < 0 or (r <2 and h=0) let
             l(r) | ket(h) = 0;



for all r,h such that r > 0 or (r  > -2 and h = 0) let
             bra(h) | l(r) = 0;



% define a procedure to calculate V.E.V.
procedure Vak(X);
bra(0) | X | ket(0);


VAK


% and now some calculations;
MA:= adj(l(3)*l(5))*l(3)*l(5);


          2
MA := 20*C *UNIT + 332*C*UNIT + 2*C*L(5)*L(-5)

       + 10*C*L(3)*L(-3) + 80*C*L(0) + 2*L(8)*L(-3)*L(-5)

       + 4*L(8)*L(-8) + L(5)*L(3)*L(-3)*L(-5)

       + 2*L(5)*L(3)*L(-8) + 6*L(5)*L(0)*L(-5)

       + 8*L(5)*L(-2)*L(-3) + 60*L(5)*L(-5)

       + 8*L(3)*L(2)*L(-5) + 10*L(3)*L(0)*L(-3)

                                                 2
       + 112*L(3)*L(-3) + 64*L(2)*L(-2) + 60*L(0)  + 556*L(0)
  %modified 1.1
showtime;


Time: 357 ms


% here is the VEV of m
vak(Ma);


4*C*(5*C + 83)

showtime;


Time: 119 ms

% and now calculate another matrix element

matel := bra(1) | ma  | ket(1);

        *************** WARNING: ***************
Evaluation incomplete due to missing elementary relations

             2
MATEL := 20*C  + 332*C + BRA(1) | (L(0) | 556*KET(1))

          + BRA(1) | (L(0) | 80*C*KET(1))

          + BRA(1) | (L(0)*L(0) | 60*KET(1))
  %modified 1.1
showtime;


Time: 102 ms

% this evaluation is incomplete so supply the missing relation
for all h let l(0) | ket(h) = h*ket(h);


% and reevaluate matel
matel := matel;


               2
MATEL := 4*(5*C  + 103*C + 154)

showtime;


Time: 34 ms



% Example 4: some manipulations with gamma matrices to demonstrate
%            the use of commutators and anticommutators


off allfac;


vecop gamma,q;


tensop sigma(2);


antisymmetric sigma;


noncom gamma,gamma;


noncom sigma,gamma;


physindex mu,nu;


operator delta;


for all mu,nu let anticomm(gamma(mu),gamma(nu))=2*delta(mu,nu)*unit,
                  comm(gamma(mu),gamma(nu))=2*I*sigma(mu,nu);



oporder p,q,gamma,sigma;


off allfac;


on anticom;


(gamma dot p)*(gamma dot q);


P(IDX4)*Q(IDX5)*GAMMA(IDX4)*GAMMA(IDX5)

showtime;


Time: 51 ms


off anticom;


(gamma dot p)*(gamma dot q);


P(IDX6)*Q(IDX7)*GAMMA(IDX6)*GAMMA(IDX7)

showtime;


Time: 17 ms


commute((gamma dot p),(gamma dot q));


2*I*P(IDX8)*Q(IDX9)*SIGMA(IDX8,IDX9)

showtime;


Time: 17 ms

anticommute((gamma dot p),(gamma dot q));


 - 2*I*P(IDX10)*Q(IDX11)*SIGMA(IDX10,IDX11)

 + 2*P(IDX10)*Q(IDX11)*GAMMA(IDX10)*GAMMA(IDX11)

on anticom;


anticommute((gamma dot p),(gamma dot q));


2*DELTA(IDX13,IDX12)*P(IDX12)*Q(IDX13)

showtime;


Time: 85 ms


end;


Time: 0 ms


Quitting


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]