{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 12 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 3 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "Worksheet for twisted 2 co cycle invariants\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restar t;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "Procedure to calculate the \+ solutions to the twisted cocycle condition" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 147 "#read \"/home/saito/grad/chad/Quandle\":\n#read \" /home/saito/public_html/Maple/Chad/qtest.m\";\nread \"E:knot_table\": \nread \"E:Quandle\":\nread \"E:qtest.m\";" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 3271 "co2TwistedSol:=proc(Quandle,polym,m::posint)\nloc al x,y,z,i,EQ,f,F,vars,A,quanod,E,Sol,Sol_list,j,\n temp, deg,Cof ,testsol,ttemp,TempPoly,TempEq,\n TempList,k,LL,GG,b,ss;\noption \+ remember;\nCof:=[];\nif type(polym,polynom) then \n deg:=degree(pol ym,t);\nelse \n printf(\"%s\\n\",ERROR);\n return;\nfi;\nCof:=coef fs(polym);\nif gcd(Cof[1],m)<>1 and gcd(Cof[nops(Cof)],m)<>1 then\n p rintf(\"%s\",\"ERROR: Not a finite ring.\");\n return;\nelse\n conti nue;\nfi;\nquanod:=quandlesize(Quandle);\n\nf:=array(0..quanod-1,0..qu anod-1,0..(deg-1));\nEQ:=[];\nfor i from 0 to quanod-1 do\n for j fro m 0 to quanod-1 do\n F[i,j]:=sum(f[i,j,k]*t^k, k=0..deg-1);\nod:od :\n\n\nfor x from 0 to (quanod-1) do\n for y from 0 to (quanod-1) do \n for z from 0 to (quanod-1) do\n TempEq[x,y,z]:=t*F[x,y ]+F[Quandle[x,y], z]-t*F[x,z]\n -F[Quandle[x,z] ,Quandle[y,z]]+(1-t)*F[y,z]:\n # The equ ation for each (x,y,z).\n TempPoly:=Rem(TempEq[x,y,z],polym,t) mod m;\n\n # Mod ``polym'' and mod m, s o that the equation is formulated in \n \+ # Z_m[t,t^(-1)]/(polym) . \n # The numbe r m is a prime (it's not clear if this works for non-prime).\n\n \+ TempList:=PolynomialTools[CoefficientList](TempPoly,t);\n \+ # For each (x,y,z), this is the list of coefficie nts of t^k.\n\n for i from 1 to nops(TempList) do\n \+ E[x,y,z,i-1]:=TempList[i];\n EQ:=[op(EQ),E[x,y,z,i-1]=0] ;\n od;\n\n od:\n od:\nod:\n#7/1/04\n#will add Reid. ty pe I move to the list of equations\nfor i from 0 to (quanod-1) do\n f or j from 0 to (deg-1) do\n EQ:=[op(EQ), f[i,i,j]=0];\n od;\nod;\n \nvars:=[seq(seq(seq(f[i,j,k],i=0..quanod-1),j=0..quanod-1),k=0. .deg-1)];\nA:=linalg[genmatrix](EQ,vars);\nb:=vector(linalg[rowdim](A) ,0);\nSol:=Linsolve(A,b,'r',ss) mod m;\n\n # At this point the soluti on is in a vector form, in the order of\n # (f[0,0,0],f[1,0,0],...]). \n # From here the free variables are renamed so that the subscripts \+ starts with 1 \n # and put the solutions back into polynomial form.\n \nSol_list:=convert(Sol,list);\nLL:=indets(Sol_list);\nLL:=convert(LL, list);\n\nx:='x'; # Unassign x. (But ``unassign(x)'' didn't seem to wo rk.) \ntemp:=1; # The first subscript for the new set of free variable s x_1, x_2, .... \nGG:=[];\n\nfor i from 1 to nops(LL) do\n ttemp:= op(LL[i]); # ttemp is the original subscript of the free variables in \+ ss. \n GG:=[op(GG),ss[ttemp]=x[temp]*t^(iquo(ttemp,quanod^2))]; \n \+ # The first block matrix (whose size is quanod^2 where quanod is the order of X)\n # is for f[i,j,0], and so on, so iquo(ttemp,quanod^ 2) is the degree of the free variable. \n temp:=temp+1;\nod;\n\nSol_l ist:=subs(GG,Sol_list); # Puts new free variables x in polynomial form s back into Sol_list.\ntemp:=1;\nfor k from 0 to deg-1 do\n for j fro m 0 to quanod-1 do\n for i from 0 to quanod-1 do\n f[i,j,k]:=c ollect(Sol_list[temp],t): # Puts the solutions back into f in polynomi al form.\n temp:=temp+1:\nod:od:od:\n\n \ntestsol:=map(`mod`,eval m(A &* Sol - b),m);\ntestsol:=convert(testsol,set);\n\n\nif testsol=\{ 0\} then\n return(f);\nelse\n printf(\"%s\",\"ERROR: co2TwistedSol solutions are not valid\");\n return;\nfi;\nend:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 688 "makeinv:=proc(Quandle)\n#Procedure that will create \+ a zero indexed two dimensional array \n#representing the multiplicatio n table for the second property of a quandle.\n# ie. There exists a un ique c such that a=c*b. Will be used to calculate the \n# colors f or a negative crossing.\n#Input: A zero indexed 2-dim array representi ng the multiplication \n# table for the quandle.\n#Output:A zero indexed 2-dim array.\nlocal i,j,temp,L,quandleorder;\noption remember ;\nquandleorder:=quandlesize(Quandle);\nL:=array(0..quandleorder-1,0.. quandleorder-1,[]):\nfor i from 0 to quandleorder-1 do\n for j from 0 to quandleorder-1 do\n temp:=Quandle[i,j];\n L[j,temp]:=i;\n o d;\nod;\nreturn(L);\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1124 "tinverse:=proc(polym ,m)\nlocal i,temp,L,deg,tinv,Cof,lowdeg,coffinv,tmppgcd;\noption remem ber;\nif type(polym,polynom) then \n deg:=degree(polym,t);\nelse \n printf(\"%s\\n\",ERROR);\n return;\nfi;\nCof:=PolynomialTools[Coe fficientList](polym,t);\ntemp:=1; \n while Cof[temp]=0 do\n te mp:=temp+1;\n od;\nif gcd(Cof[temp],m)=1 and gcd(Cof[nops(Cof)],m)= 1 then\n continue;\nelse\n printf(\"%s\",\"ERROR, Not a finite ring. \");\n return;\nfi;\nlowdeg:=0; # lowdeg is the lowest degree of poly m. \nwhile Cof[lowdeg+1]=0 do\n lowdeg:=lowdeg+1;\nod;\ntinv:=0;\nfor \+ i from (lowdeg+2) to nops(Cof) do\n tinv:=tinv-Cof[i]*t^(i-(lowdeg+2) );\nod;\n# For example, if t^2+2*t+3=polym, then first do 3=-2*t-t^2 a nd \n# compute 3*t^(-1)=-2-t. Then the next step cancels 3. \n\ntmpp gcd:=igcdex(Cof[lowdeg+1],m,'s','r'); \n# This is 1 iff the coeff of t he lowest dgree is invertible (and it should be).\n\nif tmppgcd<>1 the n \n printf(\"%s %d %s %d\",\"ERROR: Inverse dne for \",Cof[lowdeg+1 ],\"mod\",m);\nelse\n coffinv:=s mod m; # This is he inverse of the \+ coeff of the lowest dgree. \nfi;\ntinv:=tinv*coffinv; \ntinv:=Rem(tinv ,polym,t) mod m;\nreturn(tinv);\nend:\n\n" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3630 "co2 TwistedInvar:=proc(Quandle,Knot,polym,m::posint)\nlocal i,j,k,x,y,z,qu andleorder,F,f,tinv,brind,\n SSTcontri,SST,jj3,jj5,jj6,jj8,s,num, \n Color,ColDiffMatch0,ColorDiff0,Ginv,\n indx,ttemp,deg;\n \nSST:=[];\nquandleorder:=quandlesize(Quandle);\ntinv:=tinverse(polym, m); \nGinv:=makeinv(Quandle);\nbrind:=max(op(map(x->abs(x),Knot)))+1 ;\ndeg:=degree(polym,t);\n #For the optional 5th argument. The use r sends the twisted cocycle solution as input.\nif nargs<5 then\n f:= co2TwistedSol(Quandle,polym,m);\nelse\n f:=args[5];\nfi;\n \nfor i fr om 0 to quandleorder-1 do\n for j from 0 to quandleorder-1 do\n F [i,j]:=sum(f[i,j,k], k=0..deg-1);\n#Removed the *t^k from the def of F [i,j] since the t terms are \n#introduced in the solutions by the proc edure co2TwistedSol()\n\nod:od:\n\n\nfor jj3 from 1 to (nops(Knot)+1) \+ do # Color vectors.\n Color[jj3]:=array(1..brind): \n od;\nnum:=quandleorder^brind; \+ #number of possible colorings\n\nfor indx from 0 to (num-1) do \+ # One color at a time.\n for jj5 from 1 to brind do\n Color[1][jj5]:=iquo(indx,quandleorder^(jj5-1)) mod quandleo rder:\n od:\n \n for jj6 from 1 to nops(Knot) do # \+ Computing all color vectors.\n if Knot[jj6] > 0 then \+ #The case when braid word element is >0\n for jj8 fr om 1 to brind do\n if jj8 = abs(Knot[jj6]) then \n \+ Color[jj6+1][jj8]:= Color[jj6][jj8+1]:\n fi:\n \+ if jj8 = abs(Knot[jj6])+1 then\n Color[jj6+1][jj8]:=Quandl e[Color[jj6][jj8-1],Color[jj6][jj8]] :\n fi:\n if \+ jj8 < abs(Knot[jj6]) then\n Color[jj6+1][jj8]:=Color[jj6][ jj8]:\n fi:\n if jj8 > abs(Knot[jj6])+1 then\n \+ Color[jj6+1][jj8]:=Color[jj6][jj8]:\n fi:\n \+ od:\n \n else \n \+ # The case braid word element is < 0 \n for jj8 f rom 1 to brind do\n if jj8 = abs(Knot[jj6]) then \n \+ Color[jj6+1][jj8]:=Ginv[Color[jj6][jj8], Color[jj6][jj8+1]]:\n \+ fi;\n if jj8 = abs(Knot[jj6])+1 then \n Color[jj6+1 ][jj8]:=Color[jj6][jj8-1]:\n fi;\n if jj8 < abs(Knot[j j6]) then\n Color[jj6+1][jj8]:=Color[jj6][jj8]:\n fi :\n if jj8 > abs(Knot[jj6])+1 then\n Color[jj6+1][jj 8]:=Color[jj6][jj8]:\n fi:\n od:\n fi:\n od: \+ # closes jj6. \n SSTcontr i:=0: # State-sum contributions.\n \+ # Finding if the colors \+ match.\n ColorDiff0:=evalm(Color[1]-Color[nops(Knot)+1]);\n ColDif fMatch0:=sum(abs(ColorDiff0[jj]),jj=1..brind);\n \+ # This is zero iff the top color vec matches the bottom.\n if ColDi ffMatch0 =0 then\n\n\n for s from 1 to nops(Knot) do \n if \+ Knot[s] > 0 then \n \nttemp:=tinv^abs((-abs(Knot[s])+1))*F[Colo r[s][abs(Knot[s])], Color[s][abs(Knot[s])+1] ]; \n\nSSTcontri:=SSTcont ri + Rem(ttemp,polym,t) mod m: \n\n else \n\nttemp:=tinv^(a bs(-abs(Knot[s])+1))*F[Color[s+1][abs(Knot[s])], Color[s+1][abs(Knot[s ])+1] ]; \nSSTcontri:=SSTcontri+Rem(-ttemp,polym,t) mod m:\n \+ fi: \n od: # Closing the \+ state-sum term, for s.\n \n SST:=[op(SST),Rem(SSTcontri,polym ,t) mod m];\n fi: # \+ Closing the ColDiffMatch\nod: \+ # Closing indx loop (one color here at a time, for indx). \nre turn(SST);\nend:\n\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 223 "Co llectTerms:=proc(SST::list)\nlocal T,SSTs,i,j,temp;\nT:=[];\nSSTs:=con vert(SST,set);\nfor i in SSTs do\ntemp:=0:\n for j from 1 to nops(SST) do\n if SST[j]=i then temp:=temp+1:fi:\n od:\nT:=[op(T),[temp,i]]:\n od:\nreturn(T);\nend:\n\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 218 "quandlesize:=proc(Quandle)\nlocal T;\noption remember;\nT:=conver t(Quandle,matrix);\nif linalg[rowdim](T)<>linalg[coldim](T) then \n \+ prinf(\"%s %s %s\\n\",ERROR, quandle, dimensions);\nelse return(linalg [rowdim](T));\nfi;\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 94 "#save quandlesize,CollectTerms,co2TwistedInvar,tinverse,makeinv,co2Tw istedSol, \"E:KnotpkgT.m\";" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "print(co2TwistedSol(Q4_3,t+1,2));" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#-%&ARRAYG6$7%;\"\"!\"\"$F';F(F(72/6%F(F(F(F(/6%F(\"\"\"F(,&&%\"xG6# F0F0&F36#F)F0/6%F(\"\"#F(,&F2F0&F36#F9F0/6%F(F)F(,&F5F0&F36#\"\"%F0/6% F0F(F(,*F2F0F;F0F5F0F@F0/6%F0F0F(F(/6%F0F9F(F2/6%F0F)F(F5/6%F9F(F(,&F2 F0F@F0/6%F9F0F(,(F2F0F;F0F@F0/6%F9F9F(F(/6%F9F)F(F@/6%F)F(F(,&F5F0F;F0 /6%F)F0F(,(F;F0F5F0F@F0/6%F)F9F(F;/6%F)F)F(F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "print(co2TwistedSol(Q4_3,t^2+t+1,2));" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#-%&ARRAYG6$7%;\"\"!\"\"$F';F(\"\"\"7B/6%F(F( F(F(/6%F(F(F+F(/6%F(F+F(,&*&,(&%\"xG6#F+F+&F76#\"\"#F+&F76#\"\"'F+F+% \"tGF+F+&F76#\"\"%F+/6%F(F+F+*&,*&F76#\"\"&F+F " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "16 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }