(*  $Log: trip.m%v $
# Revision 1.9  1995/02/11  10:38:52  bill
# added Hodge star, first rules, assume orthonormal
#
# Revision 1.8  1995/02/11  10:21:52  bill
# changed to TForm
#
# Revision 1.7  1995/02/09  18:21:25  bill
# added tests for pullback
#
# Revision 1.6  1995/02/09  14:10:05  bill
# check minus signs, lie twisted forms, **
#
# Revision 1.5  1995/02/09  02:02:49  bill
# includes all twisted form algebra and exterior derivatives
#
# Revision 1.4  1995/02/08  01:09:10  bill
# angle on Twisted forms, forms.m 3.4 passes this
#
# Revision 1.3  1995/02/07  15:31:30  bill
# passed by forms.m 3.3
#
# Revision 1.2  1995/02/07  14:09:15  bill
# passed by 3.2, up to Lie Bracket of vectors
#
# Revision 1.1  1995/02/07  12:35:44  bill
# Initial revision
#
#  *)


Print["   --  Test Suite for Tiny Forms Calculator   -- "]
Print["                                                 "]
Print["$Header: d:/math/bb/forms/trip.m%v 1.9 1995/02/11 10:38:52 bill Exp bill $"]

<< euclid3.m

TestIt := If[Union[testlist]=={0},
            Print["  correct"],
            Print["  failure"]; Print[testlist]];

Print["Testing TestIt, should fail and list {1}"]
testlist = {1}
TestIt

(* Test if euclid3.m loaded and correct *)

Print["Euclid3.m Forms"]
testlist = { px - Vector[x], 
             py - Vector[y], 
             pz - Vector[z],
             dx - Form[x],   
             dy - Form[y],   
             dz - Form[z],
             dxdy - Form[x,y], 
             dydz - Form[y,z], 
             dzdx + Form[x,z],
             dxdydz - Form[x,y,z],
0}

(* Check for failure *)
TestIt

Print["Linearity of Forms"]
testlist = { Form[x] + Form[x] - 2 Form[x],
             Form[x,y] + Form[x,y] - 2 Form[x,y],
             0 Form[x,y,z],
             1 - Form[],
0}
TestIt

Print["FSimp on Forms"]
testlist = { Form[x,y] + Form[y,x],
             Form[x,z] + Form[z,x],
             Form[z,y] + Form[y,z],
             Form[x,y,z] - Form[y,z,x],
             Form[x,y,z] - Form[z,x,y],
             Form[x,y,z] + Form[y,x,z],
             Form[x,y,z] + Form[z,y,x],
             Form[x,y,z] + Form[x,z,y],
             Form[x,x],
             Form[x,x,y],
             Form[y,x,x],
             Form[x,y,z,z],
0} /. FSimp
TestIt

Print["Angle on Forms"]
testlist = { angle[px, dx] - 1,
             angle[-px, dx] + 1,
             angle[px, -dx] + 1,
             angle[py, dy] - 1,
             angle[px, dy],
             angle[px, dxdy] - dy,
             angle[px, Form[y,x]] + dy,
             angle[px, dxdydz] - dydz,
             angle[px, dx + dy + dz] - 1,
             angle[px, dxdy + dydz + dzdx] - dy + dz,
             angle[px, 2 dxdydz] - 2 dydz,
             angle[px + py, dx] - 1,
             angle[px + py, dx + dy] - 2,
             angle[px + py, dxdy] - dy + dx,
             angle[3 px, dx] - 3,
             angle[px, 0] - 0,
             angle[0, dx] - 0,
             angle[px, dy] - 0,
             angle[px, dydz] - 0,
0}
TestIt

Print["Wedge on Forms"]
testlist = { wedge[dx, dy + dy, dz] - 2 dxdydz,
             wedge[dx, dy + dz] - dxdy + dzdx,
             wedge[dx + dy, dxdy],
             wedge[3 dx, 2 dy] - 6 dxdy,
             wedge[-3 dx, 2 dy] + 6 dxdy,
             wedge[3 dx, -2 dy] + 6 dxdy,
             wedge[3] -3,
             wedge[dx] - dx,
             wedge[] - 1,
             wedge[dx, 3, dy] - 3 dxdy,
0}
TestIt

Print["Exterior Differentiation of Forms"]
testlist = { d[x] - dx,
             d[x^2] - 2 x dx,
             d[y] - dy,
             d[x y] - x dy - y dx,
             d[ x dy + y dx],
             d[ x dydz] - dxdydz,
             d[ -x dydz] + dxdydz,
             d[ x dxdydz],
0}
TestIt

Print["Vector Commutators"]
testlist = { Lie[px, px],
             Lie[px, py],
             Lie[z px, x py] - z py,
             Lie[-z px, x py] + z py,
             Lie[z px, -x py] + z py,
             Lie[y px, z py] + z px,
             Lie[px, x py] - py,
             Lie[y px, py] + px,
0}
TestIt

Print["Lie Derivatives of Forms"]
testlist = { Lie[px, x] - 1,
             Lie[-px, x] + 1,
             Lie[px + py, x + y + z] - 2,
             Lie[py, y^2] - 2 y,
             Lie[z px, x dy] - z dy,
             Lie[z px, y dy],
             Lie[x py, dydz] + dzdx,
             Lie[x py, -dydz] - dzdx,
             Lie[x py, dzdx],
             Lie[x py, dxdy],
             Lie[x px, dxdydz] - dxdydz,
0}
TestIt

Print["Euclid3.m Twisted Forms"]
testlist = { tx - TForm[x],   
             ty - TForm[y],   
             tz - TForm[z],
             txty - TForm[x,y], 
             tytz - TForm[y,z], 
             tztx + TForm[x,z],
             txtytz - TForm[x,y,z],
0}
TestIt

Print["Linearity of Twisted Forms"]
testlist = { TForm[x] + TForm[x] - 2 TForm[x],
             TForm[x,y] + TForm[x,y] - 2 TForm[x,y],
             0 TForm[x,y,z],
             If[NumberQ[TForm[]], 1, 0],
0}
TestIt

Print["FSimp on Twisted Forms"]
testlist = { TForm[x,y] + TForm[y,x],
             TForm[x,z] + TForm[z,x],
             TForm[z,y] + TForm[y,z],
             TForm[x,y,z] - TForm[y,z,x],
             TForm[x,y,z] - TForm[z,x,y],
             TForm[x,y,z] + TForm[y,x,z],
             TForm[x,y,z] + TForm[z,y,x],
             TForm[x,y,z] + TForm[x,z,y],
             TForm[x,x],
             TForm[x,x,y],
             TForm[y,x,x],
             TForm[x,y,z,z],
0} /. FSimp
TestIt

Print["Angle on Twisted Forms"]
testlist = { angle[px, tx],
             angle[py, ty],
             angle[px, ty] + txty,
             angle[-px, ty] - txty,
             angle[px, -ty] - txty,
             angle[px, tz] - tztx,
             angle[px, txty],
             angle[px, tytz] - txtytz,
             angle[px, TForm[y,x]],
             angle[px, txtytz],
             angle[px, TForm[]] - tx,
             angle[py, TForm[]] - ty,
             angle[px, tx + ty + tz] + txty - tztx,
             angle[px, txty + tytz + tztx] - txtytz,
             angle[px, 2 txtytz],
             angle[px + py, tx] - txty,
             angle[px + py, tx + ty],
             angle[px + py, txty],
             angle[3 px, tytz] - 3 txtytz,
             angle[px, 0] - 0,
             angle[0, tx] - 0,
             angle[px, tx] - 0,
             angle[px, txtytz] - 0,  
0}
TestIt

Print["Wedge of Form and Twisted Form "]
testlist = { wedge[dx, TForm[]],
             wedge[dxdy, TForm[]],
             wedge[Form[], TForm[]] -1,
             wedge[Form[], tx] - tx,
             wedge[Form[], txty] - txty,
             wedge[dx, TForm[x]] - TForm[],
             wedge[-dx, TForm[x]] + TForm[],
             wedge[dx, -TForm[x]] + TForm[],
             wedge[dx, TForm[y,x]] - TForm[y],
             wedge[dx, TForm[z,y,x]] - TForm[z,y],
             wedge[dx, TForm[x,y]] + TForm[y],
             wedge[dx, TForm[x,y,z]] - TForm[y,z],
             wedge[dy, TForm[x]],
             wedge[dz, TForm[y,x]],
             wedge[Form[w], TForm[z,y,x]],
             wedge[Form[x,y], TForm[x,y]] - TForm[],
             wedge[Form[x,y,z], TForm[x,y,z]] - TForm[],
             wedge[Form[x,y], TForm[x,z]],
             wedge[Form[x,y,z], TForm[x,y,w]],
0}
TestIt

Print["Wedge of Twisted Form and Twisted Form "]
testlist = { wedge[TForm[], TForm[]],
             wedge[TForm[], tx],
             wedge[TForm[], txty],
             wedge[TForm[], txtytz] - dxdydz,
             wedge[-TForm[], txtytz] + dxdydz,
             wedge[TForm[], -txtytz] + dxdydz,
             wedge[TForm[], TForm[z,x,y]] - dxdydz,
             wedge[TForm[], TForm[y,z,x]] - dxdydz,
             wedge[TForm[], TForm[x,z,y]] + dxdydz,
             wedge[TForm[], TForm[y,x,z]] + dxdydz,
             wedge[TForm[], TForm[z,y,x]] + dxdydz,
             wedge[ tx,     TForm[]],
             wedge[ txty,   TForm[]],
             wedge[ txtytz, TForm[]] - dxdydz,
             wedge[ TForm[z,x,y], TForm[]] - dxdydz,
             wedge[ TForm[y,z,x], TForm[]] - dxdydz,
             wedge[ TForm[x,z,y], TForm[]] + dxdydz,
             wedge[ TForm[y,x,z], TForm[]] + dxdydz,
             wedge[ TForm[z,y,x], TForm[]] + dxdydz,
             wedge[tx, txtytz] - dydz,
             wedge[ty, txtytz] - dzdx,
             wedge[tz, txtytz] - dxdy,
             wedge[txty, txtytz] - dz,
             wedge[tytz, txtytz] - dx,
             wedge[txtz, txtytz] + dy,
             wedge[txtytz, txtytz] - 1,
             wedge[txty, txtz] - dydz, 
0}
TestIt

Print["Wedge of Twisted Form and Form "]
testlist = { wedge[TForm[], Form[]] - TForm[],
             wedge[tx, dx] - TForm[],
             wedge[txty, dxdy] - TForm[],
             wedge[txtytz, dxdydz] - TForm[],
             wedge[tx, dxdy],
             wedge[tx, dxdydz],
             wedge[txty, dx] - ty,
             wedge[-txty, dx] + ty,
             wedge[txty, -dx] + ty,
             wedge[txtytz, dxdy] - tz,
0}
TestIt

Print["Lie Derivatives of Twisted Forms"]
testlist = { Lie[z px, x ty] - d[angle[z px, x ty]] - angle[z px, d[x ty]],
             Lie[z px, y ty] - d[angle[z px, y ty]] - angle[z px, d[y ty]],
             Lie[x py, tytz] - d[angle[x py, tytz]],
             Lie[x py, tztx] - d[angle[x py, tztx]],
             Lie[-x py, tztx] + d[angle[x py, tztx]],
             Lie[x py, -tztx] + d[angle[x py, tztx]],
             Lie[x py, txty] - d[angle[x py, txty]],
             Lie[x px, txtytz] - d[angle[x px, txtytz]],
             Lie[x px, TForm[]] - d[angle[x px, TForm[]]],
0}
TestIt

Print["Exterior Differentiation of Twisted Forms"]
testlist = { d[ x ty + y tx] - wedge[dx, ty] - wedge[dy, tx],
             d[ x tytz] - wedge[ dx, tytz],
             d[ -x tytz] + wedge[ dx, tytz],
             d[ x txtytz] - wedge[ dx, txtytz],
0}
TestIt

Print["Pullback of Forms"]
testlist = { Form[x, y+z] - Form[x,y] - Form[x,z],
             Form[ Dt[x] ] - Form[x],
             Form[ Dt[x], y ] - Form[x,y],
             Form[ Dt[x], Dt[y] ] - Form[x,y],
             Pullback[ dx, {x->u, y->0, z->0}] - Form[u],
             Pullback[ dy, {x->u, y->0, z->0}],
             Pullback[ dxdy, {x->u, y->0, z->0}],
             Pullback[ dx, {x->u^2, y->0, z->0}] - 2 u Form[u],
0}
TestIt

Print["Hodge Star"]
testlist = { star[dx] - tx,
             star[tx] - dx,
             star[dx + dy] - tx - ty,
             star[2 dx] - 2 dx,
             star[Form[t]] + TForm[t],
             star[dxdy] - txty,
             star[Form[x,t]] + TForm[x,t],
             star[TForm[x,t]] + Form[x,t],
0}
TestIt

Print["** on Forms"]
testlist = { dx ** 3 dy - 3 dxdy,
             dx ** (dy + dy) ** dz - 2 dxdydz,
             dx ** (dy + dz) - dxdy + dzdx,
             (dx + dy) ** dxdy,
0}
TestIt

