# This file---intended for use with MAPLE V for Windows ver. 2---is an aid 
# to check some formulae of the paper ``Computer algebra in spinor 
# calculations'' by Franco Piazzese, contained in ``Clifford Algebras with 
# Numeric and Symbolic Computations'', R. Ab\lamowicz, P. Lounesto, J. M. 
# Parra (eds.), Birkhauser, Boston (1996).

# Equations (17), (18), (22) and (23) are checked in the following sections 
# #1,#2,#3 and #4, respectively. The orthonormal properties of the rotated 
# basis (cf. section 4 of the quoted paper) are checked in section #5.

# Author's address: Physics Department. Politecnico. Corso Duca degli Abruzzi 
# 24. 10129 - Torino, Italy. E-mail: piazzese@polito.it

# March 29,1996.
############################################################################

> with(linalg):

> #1

> X:=matrix(2,2,[x3,x1-I*x2,x1+I*x2,-x3]);
> Q:=matrix(2,2,[phi1,-phi2x,phi2,phi1x]);
> Qx:=matrix(2,2,[phi1x,phi2x,-phi2,phi1]);
> Y:=evalm(Q&*X&*Qx):

> y1:=collect((Y[2,1]+Y[1,2])/2,[x1,x2,x3]); 
> y2:=collect((Y[2,1]-Y[1,2])/(2*I),[x1,x2,x3]); 
> y3:=collect((Y[1,1]-Y[2,2])/2,[x1,x2,x3]);
> A11:=coeff(y1,x1);
> A12:=coeff(y1,x2);
> A13:=coeff(y1,x3);
> A21:=coeff(y2,x1);
> A22:=coeff(y2,x2); 
> A23:=coeff(y2,x3);
> A31:=coeff(y3,x1); 
> A32:=coeff(y3,x2);
> A33:=coeff(y3,x3);
> # The above expressions coincide with the (17) of the paper.

> ############################################################################

> #2

> Phi:=matrix(2,1,[phi1,phi2]);
> Phitilde:=matrix(2,1,[-phi2x,phi1x]); 
> Phix:=matrix(1,2,[phi1x,phi2x]); 
> Phitildex:=matrix(1,2,[-phi2,phi1]);
> sigma[1]:=matrix(2,2,[0,1,1,0]);sigma[2]:=matrix(2,2,[0,-I,I,0]);sigma[3]:=matrix(2,2,[1,0,0,-1]);
> expand(A11-evalm((Phix&*sigma[1]&*Phitilde+Phitildex&*sigma[1]&*Phi)/2)[1,1]); 
> expand(A21-evalm((Phix&*sigma[2]&*Phitilde+Phitildex&*sigma[2]&*Phi)/2)[1,1]); 
> expand(A31-evalm((Phix&*sigma[3]&*Phitilde+Phitildex&*sigma[3]&*Phi)/2)[1,1]); 
> expand(A12-evalm((Phix&*sigma[1]&*Phitilde-Phitildex&*sigma[1]&*Phi)*I/2)[1,1]); 
> expand(A22-evalm((Phix&*sigma[2]&*Phitilde-Phitildex&*sigma[2]&*Phi)*I/2)[1,1]); 
> expand(A32-evalm((Phix&*sigma[3]&*Phitilde-Phitildex&*sigma[3]&*Phi)*I/2)[1,1]); 
> expand(A13-evalm(Phix&*sigma[1]&*Phi)[1,1]); 
> expand(A23-evalm(Phix&*sigma[2]&*Phi)[1,1]); 
> expand(A33-evalm(Phix&*sigma[3]&*Phi)[1,1]);
> # We conclude that expressions (18) coincide with the (17) (cf. paper).

############################################################################

> #3

> siderels:={sin(theta/2)^2+cos(theta/2)^2=1, cos(theta/2)^2-sin(theta/2)^2=cos(theta), 
> 2*sin(theta/2)*cos(theta/2)=sin(theta)};
> sost1:=[phi1=exp(-I*(phi+psi)/2)*cos(theta/2), phi2=-I*exp(I*(phi-psi)/2)*sin(theta/2), 
> phi1x=exp(I*(phi+psi)/2)*cos(theta/2), phi2x=I*exp(-I*(phi-psi)/2)*sin(theta/2)];
> A11a:=simplify(simplify(subs(sost1,A11),'exp'),siderels); 
> A21a:=simplify(simplify(subs(sost1,A21),'exp'),siderels); 
> A31a:=simplify(simplify(subs(sost1,A31),'exp'),siderels); 
> A12a:=simplify(simplify(subs(sost1,A12),'exp'),siderels); 
> A22a:=simplify(simplify(subs(sost1,A22),'exp'),siderels); 
> A32a:=simplify(simplify(subs(sost1,A32),'exp'),siderels); 
> A13a:=simplify(simplify(subs(sost1,A13),'exp'),siderels); 
> A23a:=simplify(simplify(subs(sost1,A23),'exp'),siderels); 
> A33a:=simplify(simplify(subs(sost1,A33),'exp'),siderels);
> # The above expressions coincide with the (22) of the paper.

############################################################################

> #4

> sost2:=[phi1=exp(-I*(psi+phi)/2)*cos(theta/2), phi2=exp(-I*(psi-phi)/2)*sin(theta/2), 
> phi1x=exp(I*(psi+phi)/2)*cos(theta/2), phi2x=exp(I*(psi-phi)/2)*sin(theta/2)];
> A11b:=simplify(simplify(subs(sost2,A11),'exp'),siderels); 
> A21b:=simplify(simplify(subs(sost2,A21),'exp'),siderels); 
> A31b:=simplify(simplify(subs(sost2,A31),'exp'),siderels); 
> A12b:=simplify(simplify(subs(sost2,A12),'exp'),siderels); 
> A22b:=simplify(simplify(subs(sost2,A22),'exp'),siderels); 
> A32b:=simplify(simplify(subs(sost2,A32),'exp'),siderels); 
> A13b:=simplify(simplify(subs(sost2,A13),'exp'),siderels); 
> A23b:=simplify(simplify(subs(sost2,A23),'exp'),siderels); 
> A33b:=simplify(simplify(subs(sost2,A33),'exp'),siderels);

> # The above expressions coincide with the (23) of the paper.

> ############################################################################

> #5

> factor(expand(A11^2+A21^2+A31^2)); 
> factor(expand(A12^2+A22^2+A32^2)); 
> factor(expand(A13^2+A23^2+A33^2)); 
> factor(expand(A11*A12+A21*A22+A31*A32)); 
> factor(expand(A11*A13+A21*A23+A31*A33)); 
> factor(expand(A13*A12+A23*A22+A33*A32));
> # (Recall that: phi1 phi1x+phi2 phi2x=1, cf. (16)).

> simplify(factor(expand(A11a^2+A21a^2+A31a^2)),'trig'); 
> simplify(factor(expand(A12a^2+A22a^2+A32a^2)),'trig'); 
> simplify(factor(expand(A13a^2+A23a^2+A33a^2)),'trig'); 
> simplify(factor(expand(A11a*A12a+A21a*A22a+A31a*A32a)),'trig'); 
> simplify(factor(expand(A11a*A13a+A21a*A23a+A31a*A33a)),'trig'); 
> simplify(factor(expand(A13a*A12a+A23a*A22a+A33a*A32a)),'trig');

> simplify(factor(expand(A11b^2+A21b^2+A31b^2)),'trig'); 
> simplify(factor(expand(A12b^2+A22b^2+A32b^2)),'trig'); 
> simplify(factor(expand(A13b^2+A23b^2+A33b^2)),'trig'); 
> simplify(factor(expand(A11b*A12b+A21b*A22b+A31b*A32b)),'trig'); 
> simplify(factor(expand(A11b*A13b+A21b*A23b+A31b*A33b)),'trig'); 
> simplify(factor(expand(A13b*A12b+A23b*A22b+A33b*A32b)),'trig');
> # This proves the orthonormal properties of the rotated basis.

> #End of file
