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