# Worksheet of examples from paper 'Pauli-Algebra Calculations in Maple V' by
#
# William E. Baylis                         Internet: baylis@uwindsor.ca
# Department of Physics                Phone (voice): 519-253-4232, x2647
# University of Windsor                          Fax: 519-973-7075
# Windsor, Ontario, Canada N9B 3P4
#
# published in:
# 
# Title: ``Clifford Algebras with Numeric and Symbolic Computations''
# Editors: Rafa\l Ab\lamowicz, Pertti Lounesto, Josep M. Parra
# ISBN: 0-8176-3907-1
# PUBLISHER: Birkh\"{a}user, Boston
# YEAR: 1996
#
# Instructions: Make the directory containing Pauli.tab and the *.t files
# your active directory. This can be done by selecting File-Open, moving to
# the desired directory, and then cancelling the Open command. Remember that
# the first time any command is invoked, it must be run twice to obtain a
# printout. The extra commands are encoded as  "; in this worksheet where
# required.
# 
> read `Pauli.tab`;  (Contact Bill Baylis at U. of Windsor)
> with(Palg);
# Example 1. Elements can be expressed as a sum of a scalar and a vector or
# as a linear combination of e0 (= 1), e1, e2, and e3:
> xpr1:=3+array([1,2,3]); xpr2:=6+2*e1+e2;
> evalPe(2*(xpr1+xpr2)/3);";
# Example 2. 
> Pscal(xpr1);";
> Pvec(xpr1);";
> Pbar(xpr1);";
# Example 3.
> xpr:=2*I+3*array([3*I,5,6]);
> Preal(xpr);";
> Pimag(xpr);";
> Pdag(xpr);";
# Example 4.
> mat:=Pmat(xpr1);";
> matP(mat);";
# Example 5.
> xpr1;xpr2;
> xpr1 &v xpr2;";
> xpr1 &dot xpr2;";
# Example 6.
> Pnorm(xpr2);";
> Pinv(xpr2);";
# Example 7. Reflect a paravector in a spatial plane:
> r:=t+array([x,y,z]);
> r_reflect:=e1 &v Pbar(r) &v e1;
> (r+r_reflect) &dot e1;
# Calculate the bivector (wedge product) formed by two vectors:
> v1:=array([1,2,0]); v2 := array([0,1,2]);
> bivec := Pvec(v1 &v v2);
# 
# The unit normal to the plane spanned by v1 and v2 is
> n := evalPa(bivec/(I*sqrt(Pnorm(bivec))));";
# Example 8. A numerical boost and an exact rotation:
> w:=0.4*e1;theta:=e3*Pi/3;
> B:=boost(w);";R:=rotate(theta);";
# Example 9. A boost operator in the Pauli algebra is the square root of a proper velocity. Thus, for a particle moving at 
# 0.6 the speed of light along  e3, its proper velocity is
> u:=5/4+3/4*e3;
# and the corresponding boost is
> B:=Pfun(sqrt,u);";
# Now rotate from e3 axis to relate cartesian and spherical coordinates:
> r:='r': theta:='theta': assume(phi >= 0); assume(theta >= 0);
> R_th := rotate(theta*e2); R_phi := rotate(phi*e3);
> rvec :=R_phi &v R_th &v (r*e3) &v Pdag(R_th) &v Pdag(R_phi);
> rvec := Pfun(evalc,rvec): Pfun(combine,rvec,trig);
> Pfun(expand,");
# Example 10. Differentiation of cliffor functions:
> r:=t+array([x,y,z]): F:=r &v r;
> Pdi(F,r);"; Pdib(F,r);";
> Pdi(Pdib(F,r),r); Pdib(Pdi(F,r),r);
# Example 11. The product of 90-degree rotations about perpendicular axes:
> R32 := rotate(e3*Pi/2) &v rotate(e2*Pi/2);
> facts := Pfactor(R32);";
> theta := sqrt(-Pnorm(facts[2]));
> evalPa(facts[2]/theta);
# Example 12. The product of boosts in perpendicular directions:
> B12 := boost(e1) &v boost(e2);
> Digits := 4: Pfactor(Pfun(evalf,B12));
# End of file
