{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Text" -1 200 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle3" -1 207 "Times" 1 16 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle4" -1 208 "Courier" 1 12 255 0 0 1 2 1 2 2 1 2 0 0 0 1 }{PSTYLE "_pstyle3" -1 202 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 2 0 2 0 2 2 0 1 }{PSTYLE "_pstyle4 " -1 203 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 2 0 2 0 2 2 0 1 }{PSTYLE "_pstyle5" -1 204 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 2 0 2 0 2 2 0 1 }{PSTYLE "_pstyle6" -1 205 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 }} {SECT 0 {EXCHG {PARA 202 "" 0 "" {TEXT 207 49 "Procedures for 2-cocycl e and 3-cocycle invariants" }{TEXT 200 56 "\nContents: co2Sol ution:=proc(Quandle,m::posint)" }{TEXT 200 89 "\n \+ calc2cocInvar:=proc(Quandle,Knot,m::posint, (optional)solutions)" } }{PARA 202 "" 0 "" {TEXT 200 60 " co3Solution:= proc(Quandle,m::posint)" }{TEXT 200 89 "\n calc 3cocInvar:=proc(Quandle,Knot,m::posint,(optional) solutions)" }{TEXT 200 55 "\n connSumKnots:=proc(Knots_list)" } {TEXT 200 44 "\n mirrorKnot:=proc(L)" }{TEXT 200 41 "\n barKnot:=proc(L)" }{TEXT 200 51 "\n \+ quandlesize:=proc(Quandle)" }{TEXT 200 47 "\n \+ makeinv:=proc(Quandle)" }{TEXT 200 9 "\n \+ " }{TEXT 200 67 "\nDate: Last updated 3/09/04\n : Updated 4/01/0 4 added comments" }}}{EXCHG {PARA 203 "> " 0 "" {MPLTEXT 1 208 8 "rest art;" }}}{EXCHG {PARA 203 "> " 0 "" {MPLTEXT 1 208 26 "quandlesize:=pr oc(Quandle)" }{MPLTEXT 1 208 61 "\n#Procedure to determine how many el ements are in the quandle" }{MPLTEXT 1 208 63 "\n#Input: A zero indexe d two dimensional array representing the " }{MPLTEXT 1 208 50 "\n# \+ the multiplication table for the quandle." }{MPLTEXT 1 208 77 "\n#O utput: A positive integer. Representing the number of elements in the \+ set." }{MPLTEXT 1 208 9 "\nlocal T;" }{MPLTEXT 1 208 64 "\noption reme mber; #create table to avoid multiple function calls" }{MPLTEXT 1 208 28 "\nT:=convert(Quandle,matrix);" }{MPLTEXT 1 208 46 "\nif linalg[row dim](T)<>linalg[coldim](T) then " }{MPLTEXT 1 208 51 "\n prinf(\"%s \+ %s %s\\n\",ERROR, quandle, dimensions);" }{MPLTEXT 1 208 32 "\nelse re turn(linalg[rowdim](T));" }{MPLTEXT 1 208 4 "\nfi;" }{MPLTEXT 1 208 5 "\nend:" }}}{EXCHG {PARA 203 "> " 0 "" {MPLTEXT 1 208 22 "makeinv:=pro c(Quandle)" }{MPLTEXT 1 208 66 "\n#Procedure that will create a zero i ndexed two dimensional array " }{MPLTEXT 1 208 77 "\n#representing the multiplication table for the second property of a quandle." } {MPLTEXT 1 208 78 "\n# ie. There exists a unique c such that a=c*b. Wi ll be used to calculate the " }{MPLTEXT 1 208 38 "\n# colors for a negative crossing." }{MPLTEXT 1 208 68 "\n#Input: A zero indexed 2-di m array representing the multiplication " }{MPLTEXT 1 208 31 "\n# \+ table for the quandle." }{MPLTEXT 1 208 9 "\n#Output:" }{MPLTEXT 1 208 27 "A zero indexed 2-dim array." }{MPLTEXT 1 208 31 "\nlocal i,j,t emp,L,quandleorder;" }{MPLTEXT 1 208 17 "\noption remember;" } {MPLTEXT 1 208 36 "\nquandleorder:=quandlesize(Quandle);" }{MPLTEXT 1 208 50 "\nL:=array(0..quandleorder-1,0..quandleorder-1,[]):" } {MPLTEXT 1 208 34 "\nfor i from 0 to quandleorder-1 do" }{MPLTEXT 1 208 36 "\n for j from 0 to quandleorder-1 do" }{MPLTEXT 1 208 24 "\n \+ temp:=Quandle[i,j];" }{MPLTEXT 1 208 18 "\n L[j,temp]:=i;" } {MPLTEXT 1 208 6 "\n od;" }{MPLTEXT 1 208 4 "\nod;" }{MPLTEXT 1 208 11 "\nreturn(L);" }{MPLTEXT 1 208 5 "\nend:" }}}{EXCHG {PARA 203 "> " 0 "" {MPLTEXT 1 208 36 "co2Solution:=proc(Quandle,m::posint)" } {MPLTEXT 1 208 66 "\n#Procedure to calculate the solutions to the 2-co cycle conditions" }{MPLTEXT 1 208 23 "\n#Input: (1) a Quandle." } {MPLTEXT 1 208 25 "\n# (2) the modulus." }{MPLTEXT 1 208 19 "\n# Output: Solutions" }{MPLTEXT 1 208 56 "\nlocal x,y,z,i,EQ,f,vars,A,qua nod,E,Sol,Sol_list,j,temp," }{MPLTEXT 1 208 15 "\n testsol;" } {MPLTEXT 1 208 17 "\noption remember;" }{MPLTEXT 1 208 23 "\nprint(co2 solproccall);" }{MPLTEXT 1 208 30 "\nquanod:=quandlesize(Quandle);" } {MPLTEXT 1 208 39 "\nf:=array(0..(quanod-1),0..(quanod-1));" } {MPLTEXT 1 208 70 "\nEQ:=[]; #defining the 2-cocycle condition" }{MPLTEXT 1 208 30 "\nfor x from 0 to (quanod-1) do" }{MPLTEXT 1 208 33 "\n for y from 0 to (quanod-1) do" } {MPLTEXT 1 208 36 "\n for z from 0 to (quanod-1) do" }{MPLTEXT 1 208 82 "\n E[x,y,z]:= f[x,y]+f[Quandle[x,y], z]-f[x,z]-f[Quandl e[x,z],Quandle[y,z]]:" }{MPLTEXT 1 208 33 "\n EQ:=[op(EQ),E[x,y ,z]=0]:" }{MPLTEXT 1 208 13 "\nod: od: od: " }{MPLTEXT 1 208 30 "\nfor i from 0 to (quanod-1) do" }{MPLTEXT 1 208 24 "\n EQ:=[op(EQ),f[i,i]= 0]:" }{MPLTEXT 1 208 4 "\nod:" }{MPLTEXT 1 208 71 "\nvars:=[seq(seq(f[ i,j],j=0..(quanod-1)),i=0..(quanod-1))]; " }{MPLTEXT 1 208 33 "\nA:=linalg[genmatrix](EQ,vars,b):" }{MPLTEXT 1 208 32 "\nSol: =Linsolve(A,b,'r',t) mod m:" }{MPLTEXT 1 208 29 "\nSol_list:=convert(S ol,list):" }{MPLTEXT 1 208 9 "\ntemp:=1;" }{MPLTEXT 1 208 67 "\n \+ #create the array of solutions\nfor i from 0 to (quanod-1) do" } {MPLTEXT 1 208 32 "\n for j from 0 to (quanod-1) do" }{MPLTEXT 1 208 35 "\n f[i,j]:=Sol_list[temp]:" }{MPLTEXT 1 208 25 "\n \+ temp:=temp+1;" }{MPLTEXT 1 208 8 "\n od:od:" }{MPLTEXT 1 208 1 " \n" }{MPLTEXT 1 208 13 "\ntestsol:=[];" }{MPLTEXT 1 208 28 "\nfor i fr om 1 to nops(EQ) do" }{MPLTEXT 1 208 54 "\n testsol:=[op(testsol),map (x->x mod m,eval(EQ[i]))];" }{MPLTEXT 1 208 4 "\nod;" }{MPLTEXT 1 208 31 "\ntestsol:=convert(testsol,set);" }{MPLTEXT 1 208 1 "\n" } {MPLTEXT 1 208 84 "#test to see if the solutions satisfy the equations \nif testsol=\{0=0\} then return(f);" }{MPLTEXT 1 208 58 "\nelse print f(\"%s %s %s\\n\",co2Solution,solutions, invalid);" }{MPLTEXT 1 208 4 "\nfi;" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 5 "\nend:" }{MPLTEXT 1 208 1 "\n" }}}{EXCHG {PARA 203 "> " 0 "" {MPLTEXT 1 208 43 "calc2cocInvar:=proc(Quandle,Knot,m::posint)" } {MPLTEXT 1 208 54 "\n#Procedure to calculate the state sum term for a \+ knot" }{MPLTEXT 1 208 23 "\n#Input: (1) A quandle." }{MPLTEXT 1 208 61 "\n# (2) A knot represented as a list in braid word form." } {MPLTEXT 1 208 25 "\n# (3) The modulus." }{MPLTEXT 1 208 65 "\n# (4) Optional. The solutions to the 2-cocycle conditions." } {MPLTEXT 1 208 68 "\n# note:No error testing is done. The us er must make sure " }{MPLTEXT 1 208 71 "\n# the soluti ons were calculated from the same quandle " }{MPLTEXT 1 208 31 "\n# \+ and modulus." }{MPLTEXT 1 208 36 "\n#Output: The state s um of the knot." }{MPLTEXT 1 208 55 "\nlocal SST,SSTcontri,jj3,jj5,jj6 ,jj8,s,num,Color,brind," }{MPLTEXT 1 208 55 "\n indx,ColDiffMatch 0,ColorDiff0,Ginv,quandleorder," }{MPLTEXT 1 208 19 "\n coSolutio ns;" }{MPLTEXT 1 208 8 "\nSST:=0;" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 36 "\nquandleorder:=quandlesize(Quandle);" }{MPLTEXT 1 208 6 "\n \+ " }{MPLTEXT 1 208 96 "#For the optional fourth argument. The user s ends the cocycle solution as input.\nif nargs<4 then" }{MPLTEXT 1 208 39 "\n coSolutions:=co2Solution(Quandle,m);" }{MPLTEXT 1 208 5 "\nels e" }{MPLTEXT 1 208 24 "\n coSolutions:=args[4];" }{MPLTEXT 1 208 4 " \nfi;" }{MPLTEXT 1 208 4 "\n " }{MPLTEXT 1 208 24 "\nGinv:=makeinv(Q uandle);" }{MPLTEXT 1 208 39 "\nbrind:=max(op(map(x->abs(x),Knot)))+1; " }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 68 "\nfor jj3 from 1 to (nops (Knot)+1) do # Color vectors." }{MPLTEXT 1 208 34 "\n \+ Color[jj3]:=array(1..brind):" }{MPLTEXT 1 208 5 "\n od;" }{MPLTEXT 1 208 94 "\nnum:=quandleorder^brind; \+ #number of possible colorings" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 78 "\nfor indx from 0 to (num-1) do # O ne color at a time." }{MPLTEXT 1 208 30 "\n for jj5 from 1 to brind \+ do" }{MPLTEXT 1 208 71 "\n Color[1][jj5]:=iquo(indx,quandleorder^ (jj5-1)) mod quandleorder:" }{MPLTEXT 1 208 7 "\n od:" }{MPLTEXT 1 208 2 "\n " }{MPLTEXT 1 208 81 "\n for jj6 from 1 to nops(Knot) do \+ # Computing all color vectors." }{MPLTEXT 1 208 90 "\n \+ if Knot[jj6] > 0 then #The case when braid w ord element is >0" }{MPLTEXT 1 208 29 "\n if Knot[jj6]<100 then " }{MPLTEXT 1 208 36 "\n for jj8 from 1 to brind do" } {MPLTEXT 1 208 41 "\n if jj8 = abs(Knot[jj6]) then " } {MPLTEXT 1 208 52 "\n Color[jj6+1][jj8]:= Color[jj6][jj8+1 ]:" }{MPLTEXT 1 208 15 "\n fi:" }{MPLTEXT 1 208 42 "\n \+ if jj8 = abs(Knot[jj6])+1 then" }{MPLTEXT 1 208 77 "\n \+ Color[jj6+1][jj8]:=Quandle[Color[jj6][jj8-1],Color[jj6][jj8]] :" } {MPLTEXT 1 208 15 "\n fi:" }{MPLTEXT 1 208 40 "\n \+ if jj8 < abs(Knot[jj6]) then" }{MPLTEXT 1 208 49 "\n Color [jj6+1][jj8]:=Color[jj6][jj8]:" }{MPLTEXT 1 208 15 "\n fi:" }{MPLTEXT 1 208 42 "\n if jj8 > abs(Knot[jj6])+1 then" } {MPLTEXT 1 208 49 "\n Color[jj6+1][jj8]:=Color[jj6][jj8]: " }{MPLTEXT 1 208 15 "\n fi:" }{MPLTEXT 1 208 13 "\n \+ od:" }{MPLTEXT 1 208 13 "\n else " }{MPLTEXT 1 208 35 "\n \+ # Virtual crossing:" }{MPLTEXT 1 208 41 "\n for jj8 f rom 1 to brind[KT] do" }{MPLTEXT 1 208 46 "\n if jj8 = abs( bw[KT][jj6])-100 then" }{MPLTEXT 1 208 52 "\n Color[jj6+1 ][jj8]:=Color[jj6][jj8+1]:" }{MPLTEXT 1 208 15 "\n fi:" } {MPLTEXT 1 208 49 "\n if jj8 = abs(bw[KT][jj6])-100+1 then \+ " }{MPLTEXT 1 208 52 "\n Color[jj6+1][jj8]:=Color[jj6][jj 8-1]:" }{MPLTEXT 1 208 15 "\n fi:" }{MPLTEXT 1 208 46 "\n \+ if jj8 < abs(bw[KT][jj6])-100 then" }{MPLTEXT 1 208 50 "\n \+ Color[jj6+1][jj8]:=Color[jj6][jj8]:" }{MPLTEXT 1 208 15 "\n \+ fi:" }{MPLTEXT 1 208 48 "\n if jj8 > abs(bw[KT][jj 6])-100+1 then" }{MPLTEXT 1 208 50 "\n Color[jj6+1][jj8]: =Color[jj6][jj8]:" }{MPLTEXT 1 208 15 "\n fi:" }{MPLTEXT 1 208 14 "\n od:" }{MPLTEXT 1 208 11 "\n fi:" }{MPLTEXT 1 208 42 "\n else " }{MPLTEXT 1 208 71 "\n # The case braid word eleme nt is < 0 " }{MPLTEXT 1 208 34 "\n for jj8 from 1 to brind do" } {MPLTEXT 1 208 39 "\n if jj8 = abs(Knot[jj6]) then " } {MPLTEXT 1 208 72 "\n Color[jj6+1][jj8]:=Ginv[Color[jj6][jj8 ], Color[jj6][jj8+1]]:" }{MPLTEXT 1 208 13 "\n fi;" }{MPLTEXT 1 208 41 "\n if jj8 = abs(Knot[jj6])+1 then " }{MPLTEXT 1 208 49 "\n Color[jj6+1][jj8]:=Color[jj6][jj8-1]:" }{MPLTEXT 1 208 13 "\n fi;" }{MPLTEXT 1 208 38 "\n if jj8 < abs(Kn ot[jj6]) then" }{MPLTEXT 1 208 47 "\n Color[jj6+1][jj8]:=Col or[jj6][jj8]:" }{MPLTEXT 1 208 13 "\n fi:" }{MPLTEXT 1 208 40 "\n if jj8 > abs(Knot[jj6])+1 then" }{MPLTEXT 1 208 47 "\n \+ Color[jj6+1][jj8]:=Color[jj6][jj8]:" }{MPLTEXT 1 208 13 "\n \+ fi:" }{MPLTEXT 1 208 11 "\n od:" }{MPLTEXT 1 208 9 "\n \+ fi:" }{MPLTEXT 1 208 70 "\n od: \+ # closes jj6. " }{MPLTEXT 1 208 75 "\n SSTcontri:=0: \+ # State-sum contributions." }{MPLTEXT 1 208 82 "\n # Finding if the colors match." }{MPLTEXT 1 208 52 "\n ColorDiff0:=evalm(Colo r[1]-Color[nops(Knot)+1]);" }{MPLTEXT 1 208 56 "\n ColDiffMatch0:=su m(abs(ColorDiff0[jj]),jj=1..brind);" }{MPLTEXT 1 208 80 "\n \+ # This is zero iff the top color vec matches the bottom." }{MPLTEXT 1 208 28 "\n if ColDiffMatch0 =0 then" }{MPLTEXT 1 208 36 "\n for s from 1 to nops(Knot) do " }{MPLTEXT 1 208 28 "\n i f Knot[s] > 0 then" }{MPLTEXT 1 208 29 "\n if Knot[s]<100 the n" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 96 "\n SSTcontri:=SST contri + coSolutions[Color[s][abs(Knot[s])], Color[s][abs(Knot[s])+1] \+ ] :" }{MPLTEXT 1 208 13 "\n fi;" }{MPLTEXT 1 208 12 "\n \+ else" }{MPLTEXT 1 208 100 "\n SSTcontri:=SSTcontri - coSolution s[Color[s+1][abs(Knot[s])], Color[s+1][abs(Knot[s])+1] ] :" }{MPLTEXT 1 208 12 "\n fi: " }{MPLTEXT 1 208 86 "\n od: \+ # Closing the state-sum term, for s." } {MPLTEXT 1 208 6 "\n " }{MPLTEXT 1 208 56 "\n SST:=SST + u^(m ap( z -> z mod m, SSTcontri ) ):" }{MPLTEXT 1 208 82 "\n fi: \+ # Closing the ColDiffMatch " }{MPLTEXT 1 208 111 "\nod: \+ # Closing indx loop (one color here at a time, for indx). " } {MPLTEXT 1 208 13 "\nreturn(SST);" }{MPLTEXT 1 208 5 "\nend:" } {MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 1 "\n" }} }{EXCHG {PARA 203 "> " 0 "" {MPLTEXT 1 208 19 "mirrorKnot:=proc(L)" } {MPLTEXT 1 208 22 "\nlocal i,S,braidIndex;" }{MPLTEXT 1 208 41 "\nbrai dIndex:=max(op(map(x->abs(x),L)))+1;" }{MPLTEXT 1 208 7 "\nS:=[];" } {MPLTEXT 1 208 27 "\nfor i from 1 to nops(L) do" }{MPLTEXT 1 208 19 " \n if L[i]<0 then " }{MPLTEXT 1 208 33 "\n S:=[op(S),braidIndex+ L[i]];" }{MPLTEXT 1 208 9 "\n else " }{MPLTEXT 1 208 40 "\n S:=[ op(S),(-1)*(braidIndex-L[i])];" }{MPLTEXT 1 208 7 "\n fi;" } {MPLTEXT 1 208 4 "\nod;" }{MPLTEXT 1 208 11 "\nreturn(S);" }{MPLTEXT 1 208 5 "\nend:" }}}{EXCHG {PARA 203 "> " 0 "" {MPLTEXT 1 208 16 "barK not:=proc(L)" }{MPLTEXT 1 208 11 "\nlocal i,S;" }{MPLTEXT 1 208 7 "\nS :=[];" }{MPLTEXT 1 208 27 "\nfor i from 1 to nops(L) do" }{MPLTEXT 1 208 20 "\n S:=[L[i],op(S)];" }{MPLTEXT 1 208 4 "\nod;" }{MPLTEXT 1 208 11 "\nreturn(S);" }{MPLTEXT 1 208 5 "\nend:" }}}{EXCHG {PARA 203 " > " 0 "" {MPLTEXT 1 208 30 "connSumKnots:=proc(Knots_list)" }{MPLTEXT 1 208 63 "\n#Procedure to form the braid word of a connected sum of kn ots." }{MPLTEXT 1 208 16 "\n#Input: A list." }{MPLTEXT 1 208 65 "\n# \+ [1] A list of lists. The elements of the list are lists " } {MPLTEXT 1 208 55 "\n# representing the braid words of the k nots " }{MPLTEXT 1 208 57 "\n# in the order that they are t o be connected." }{MPLTEXT 1 208 46 "\n# ex. [[1,1,1],[1,1,1 ],[1,-2,1,-2]]" }{MPLTEXT 1 208 22 "\n#Output: A list, [L]." } {MPLTEXT 1 208 32 "\n# [L] The new braid word." }{MPLTEXT 1 208 26 "\n# ex. of a function call " }{MPLTEXT 1 208 47 "\n# ConnSumKnots( [[1,1,1],[1,1,1],[1,-2,1,-2]]);" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 50 "\nlocal newIndex, i,k, j, NewKnot,Braid_Index_list;" } {MPLTEXT 1 208 13 "\nNewKnot:=[];" }{MPLTEXT 1 208 21 "\nBraid_Index_l ist:[];" }{MPLTEXT 1 208 13 "\nnewIndex:=0;" }{MPLTEXT 1 208 36 "\nfor k from 1 to nops(Knots_list) do" }{MPLTEXT 1 208 64 "\n Braid_Index_ list[k]:=max(op(map(x->abs(x),Knots_list[k])))+1;" }{MPLTEXT 1 208 4 " \nod;" }{MPLTEXT 1 208 36 "\nfor i from 1 to nops(Knots_list) do" } {MPLTEXT 1 208 42 "\n for j from 1 to nops(Knots_list[i]) do" } {MPLTEXT 1 208 39 "\n if Knots_list[i][j]<0 then " } {MPLTEXT 1 208 59 "\n NewKnot:=[op(NewKnot),Knots_list[i][j]-n ewIndex];" }{MPLTEXT 1 208 11 "\n else" }{MPLTEXT 1 208 59 "\n \+ NewKnot:=[op(NewKnot),Knots_list[i][j]+newIndex];" }{MPLTEXT 1 208 10 "\n fi;" }{MPLTEXT 1 208 7 "\n od;" }{MPLTEXT 1 208 43 " \n newIndex:=newIndex+Braid_Index_list[i];" }{MPLTEXT 1 208 33 "\n \+ if i<> nops(Knots_list) then " }{MPLTEXT 1 208 39 "\n NewKnot:=[ op(NewKnot),newIndex];" }{MPLTEXT 1 208 7 "\n fi;" }{MPLTEXT 1 208 4 "\nod;" }{MPLTEXT 1 208 17 "\nreturn(NewKnot);" }{MPLTEXT 1 208 5 " \nend:" }{MPLTEXT 1 208 1 "\n" }}}{EXCHG {PARA 203 "> " 0 "" {MPLTEXT 1 208 36 "co3Solution:=proc(Quandle,m::posint)" }{MPLTEXT 1 208 66 "\n #Procedure to calculate the solutions to the 3-cocycle conditions" } {MPLTEXT 1 208 23 "\n#Input: (1) a Quandle." }{MPLTEXT 1 208 25 "\n# \+ (2) the modulus." }{MPLTEXT 1 208 19 "\n#Output: Solutions" } {MPLTEXT 1 208 60 "\nlocal x,y,z,i,w,k,EQ,h,vars,A,quanod,E,Sol,Sol_li st,j,temp," }{MPLTEXT 1 208 9 "\ntestsol;" }{MPLTEXT 1 208 17 "\noptio n remember;" }{MPLTEXT 1 208 23 "\nprint(co3solproccall);" }{MPLTEXT 1 208 30 "\nquanod:=quandlesize(Quandle);" }{MPLTEXT 1 208 53 "\nh:=ar ray(0..(quanod-1),0..(quanod-1),0..(quanod-1));" }{MPLTEXT 1 208 70 " \nEQ:=[]; #defining the 3-cocycle conditio n" }{MPLTEXT 1 208 30 "\nfor x from 0 to (quanod-1) do" }{MPLTEXT 1 208 33 "\n for y from 0 to (quanod-1) do" }{MPLTEXT 1 208 36 "\n \+ for z from 0 to (quanod-1) do" }{MPLTEXT 1 208 38 "\n for w f rom 0 to (quanod-1) do" }{MPLTEXT 1 208 22 "\n E[x,y,z,w]:= " } {MPLTEXT 1 208 34 " h[x,z,w] - h[x,y,w] + h[x,y,z] " }{MPLTEXT 1 208 99 "\n- h[Quandle[x,y],z,w] + h[Quandle[x,z],Quandle[y,z],w]- h[Qu andle[x,w],Quandle[y,w],Quandle[z,w]]:" }{MPLTEXT 1 208 27 "\nEQ:=[op( EQ),E[x,y,z,w]=0]:" }{MPLTEXT 1 208 16 "\nod: od: od:od: " }{MPLTEXT 1 208 30 "\nfor i from 0 to (quanod-1) do" }{MPLTEXT 1 208 32 "\n for j from 0 to (quanod-1) do" }{MPLTEXT 1 208 29 "\n EQ:=[op(EQ),h[i, j,j]=0]:" }{MPLTEXT 1 208 7 "\nod:od:" }{MPLTEXT 1 208 94 "\nvars:=[se q(seq(seq(h[i,j,k],k=0..(quanod-1)),j=0..(quanod-1)),i=0..(quanod-1))] ; " }{MPLTEXT 1 208 33 "\nA:=linalg[genmatrix](EQ,vars,b): " }{MPLTEXT 1 208 32 "\nSol:=Linsolve(A,b,'r',t) mod m:" }{MPLTEXT 1 208 29 "\nSol_list:=convert(Sol,list):" }{MPLTEXT 1 208 9 "\ntemp:=1; " }{MPLTEXT 1 208 30 "\nfor i from 0 to (quanod-1) do" }{MPLTEXT 1 208 32 "\n for j from 0 to (quanod-1) do" }{MPLTEXT 1 208 34 "\n f or k from 0 to (quanod-1) do" }{MPLTEXT 1 208 37 "\n h[i,j,k ]:=Sol_list[temp]:" }{MPLTEXT 1 208 25 "\n temp:=temp+1;" } {MPLTEXT 1 208 11 "\n od:od:od:" }{MPLTEXT 1 208 13 "\ntestsol:=[];" } {MPLTEXT 1 208 28 "\nfor i from 1 to nops(EQ) do" }{MPLTEXT 1 208 54 " \n testsol:=[op(testsol),map(x->x mod m,eval(EQ[i]))];" }{MPLTEXT 1 208 4 "\nod;" }{MPLTEXT 1 208 31 "\ntestsol:=convert(testsol,set);" } {MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 33 "\nif testsol=\{0=0\} then re turn(h);" }{MPLTEXT 1 208 58 "\nelse printf(\"%s %s %s\\n\",co3Solutio n,solutions, invalid);" }{MPLTEXT 1 208 4 "\nfi;" }{MPLTEXT 1 208 5 " \nend:" }}}{EXCHG {PARA 203 "> " 0 "" {MPLTEXT 1 208 43 "calc3cocInvar :=proc(Quandle,Knot,m::posint)" }{MPLTEXT 1 208 54 "\n#Procedure to ca lculate the state sum term for a knot" }{MPLTEXT 1 208 23 "\n#Input: ( 1) A quandle." }{MPLTEXT 1 208 61 "\n# (2) A knot represented as a list in braid word form." }{MPLTEXT 1 208 25 "\n# (3) The mod ulus." }{MPLTEXT 1 208 65 "\n# (4) Optional. The solutions to th e 3-cocycle conditions." }{MPLTEXT 1 208 68 "\n# note:No err or testing is done. The user must make sure " }{MPLTEXT 1 208 71 "\n# \+ the solutions were calculated from the same quandle " }{MPLTEXT 1 208 31 "\n# and modulus." }{MPLTEXT 1 208 36 "\n#Output: The state sum of the knot." }{MPLTEXT 1 208 55 "\nlocal SST,SSTcontri,jj3,jj5,jj6,jj8,s,num,Color,brind," }{MPLTEXT 1 208 63 "\n indx,ColDiffMatch0,ColorDiff0,Ginv,quandleorder, " } {MPLTEXT 1 208 41 "\n coSolutions,Facecolors,facecolors," } {MPLTEXT 1 208 41 "\n precolorface,nowcolor,colcoloring;" } {MPLTEXT 1 208 8 "\nSST:=0;" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 36 "\nquandleorder:=quandlesize(Quandle);" }{MPLTEXT 1 208 1 "\n" } {MPLTEXT 1 208 16 "\nif nargs<4 then" }{MPLTEXT 1 208 39 "\n coSoluti ons:=co3Solution(Quandle,m);" }{MPLTEXT 1 208 5 "\nelse" }{MPLTEXT 1 208 24 "\n coSolutions:=args[4];" }{MPLTEXT 1 208 4 "\nfi;" } {MPLTEXT 1 208 4 "\n " }{MPLTEXT 1 208 24 "\nGinv:=makeinv(Quandle); " }{MPLTEXT 1 208 39 "\nbrind:=max(op(map(x->abs(x),Knot)))+1;" } {MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 68 "\nfor jj3 from 1 to (nops(Kn ot)+1) do # Color vectors." }{MPLTEXT 1 208 34 "\n \+ Color[jj3]:=array(1..brind):" }{MPLTEXT 1 208 6 "\n " }{MPLTEXT 1 208 35 "Facecolors[jj3]:=array(0..brind-1):" }{MPLTEXT 1 208 5 "\n od; " }{MPLTEXT 1 208 94 "\nnum:=quandleorder^brind; \+ #number of possible colorings" }{MPLTEXT 1 208 1 "\n " }{MPLTEXT 1 208 78 "\nfor indx from 0 to (num-1) do \+ # One color at a time." }{MPLTEXT 1 208 30 "\n for jj5 from 1 to brind do" }{MPLTEXT 1 208 71 "\n Color[1][jj5]:=iquo(indx,q uandleorder^(jj5-1)) mod quandleorder:" }{MPLTEXT 1 208 7 "\n od:" } {MPLTEXT 1 208 2 "\n " }{MPLTEXT 1 208 81 "\n for jj6 from 1 to nops (Knot) do # Computing all color vectors." }{MPLTEXT 1 208 90 "\n if Knot[jj6] > 0 then #The case \+ when braid word element is >0" }{MPLTEXT 1 208 36 "\n for jj8 \+ from 1 to brind do" }{MPLTEXT 1 208 41 "\n if jj8 = abs(Knot [jj6]) then " }{MPLTEXT 1 208 52 "\n Color[jj6+1][jj8]:= C olor[jj6][jj8+1]:" }{MPLTEXT 1 208 15 "\n fi:" }{MPLTEXT 1 208 42 "\n if jj8 = abs(Knot[jj6])+1 then" }{MPLTEXT 1 208 77 "\n Color[jj6+1][jj8]:=Quandle[Color[jj6][jj8-1],Color[ jj6][jj8]] :" }{MPLTEXT 1 208 15 "\n fi:" }{MPLTEXT 1 208 40 "\n if jj8 < abs(Knot[jj6]) then" }{MPLTEXT 1 208 49 "\n \+ Color[jj6+1][jj8]:=Color[jj6][jj8]:" }{MPLTEXT 1 208 15 " \n fi:" }{MPLTEXT 1 208 42 "\n if jj8 > abs(Knot[j j6])+1 then" }{MPLTEXT 1 208 49 "\n Color[jj6+1][jj8]:=Col or[jj6][jj8]:" }{MPLTEXT 1 208 15 "\n fi:" }{MPLTEXT 1 208 13 "\n od:" }{MPLTEXT 1 208 42 "\n else \+ " }{MPLTEXT 1 208 71 "\n \+ # The case braid word element is < 0 " }{MPLTEXT 1 208 34 "\n fo r jj8 from 1 to brind do" }{MPLTEXT 1 208 39 "\n if jj8 = abs( Knot[jj6]) then " }{MPLTEXT 1 208 72 "\n Color[jj6+1][jj8]:= Ginv[Color[jj6][jj8], Color[jj6][jj8+1]]:" }{MPLTEXT 1 208 13 "\n \+ fi;" }{MPLTEXT 1 208 41 "\n if jj8 = abs(Knot[jj6])+1 then " }{MPLTEXT 1 208 49 "\n Color[jj6+1][jj8]:=Color[jj6][jj8- 1]:" }{MPLTEXT 1 208 13 "\n fi;" }{MPLTEXT 1 208 38 "\n \+ if jj8 < abs(Knot[jj6]) then" }{MPLTEXT 1 208 47 "\n Color [jj6+1][jj8]:=Color[jj6][jj8]:" }{MPLTEXT 1 208 13 "\n fi:" } {MPLTEXT 1 208 40 "\n if jj8 > abs(Knot[jj6])+1 then" } {MPLTEXT 1 208 47 "\n Color[jj6+1][jj8]:=Color[jj6][jj8]:" } {MPLTEXT 1 208 13 "\n fi:" }{MPLTEXT 1 208 11 "\n od:" } {MPLTEXT 1 208 9 "\n fi:" }{MPLTEXT 1 208 70 "\n od: \+ # closes jj6. " }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 82 "\n \+ # Finding if the colors match." }{MPLTEXT 1 208 52 "\n Col orDiff0:=evalm(Color[1]-Color[nops(Knot)+1]);" }{MPLTEXT 1 208 56 "\n \+ ColDiffMatch0:=sum(abs(ColorDiff0[jj]),jj=1..brind);" }{MPLTEXT 1 208 80 "\n # This is zero iff the top color vec \+ matches the bottom." }{MPLTEXT 1 208 28 "\n if ColDiffMatch0 =0 then " }{MPLTEXT 1 208 97 "\n#The braid has a valid coloring so every possi ble color will contribute to the state sum.\n " }{MPLTEXT 1 208 45 "for facecolors from 0 to (quandleorder-1) do" }{MPLTEXT 1 208 54 "\n SSTcontri:=0; # State-sum contributions." }{MPLTEXT 1 208 7 "\n " }{MPLTEXT 1 208 55 "\n for precolorface from 1 to (nops(Knot)+1) do " }{MPLTEXT 1 208 10 "\n " }{MPLTEXT 1 208 53 "\n Facecolors[precolorface][0]:=facecolors:" } {MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 12 "\n od;" }{MPLTEXT 1 208 38 "\n for nowcolor from 1 to nops(Knot) do" }{MPLTEXT 1 208 8 "\n " }{MPLTEXT 1 208 64 "\n for colcoloring from 0 to (abs (Knot[nowcolor])-1) do " }{MPLTEXT 1 208 122 "\n Facecolors[ nowcolor][colcoloring+1]:=Quandle[Facecolors[nowcolor][colcoloring],Co lor[nowcolor][colcoloring+1]]:" }{MPLTEXT 1 208 7 "\n " } {MPLTEXT 1 208 6 "\n od:" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 9 " \n od:" }{MPLTEXT 1 208 36 "\n for s from 1 to nops(Knot) do \+ " }{MPLTEXT 1 208 28 "\n if Knot[s] > 0 then" }{MPLTEXT 1 208 8 "\n " }{MPLTEXT 1 208 25 " SSTcontri:= SSTcontri + " } {MPLTEXT 1 208 95 "\ncoSolutions[Facecolors[s][abs(Knot[s])-1],Color[s ][abs(Knot[s])], Color[s][abs(Knot[s])+1] ] :" }{MPLTEXT 1 208 12 "\n \+ else" }{MPLTEXT 1 208 11 "\n " }{MPLTEXT 1 208 22 "SSTc ontri:=SSTcontri -" }{MPLTEXT 1 208 99 "\ncoSolutions[Facecolors[s][ab s(Knot[s])-1],Color[s+1][abs(Knot[s])], Color[s+1][abs(Knot[s])+1] ] : " }{MPLTEXT 1 208 12 "\n fi: " }{MPLTEXT 1 208 86 "\n od: \+ # Closing the state-sum term, fo r s." }{MPLTEXT 1 208 6 "\n " }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 1 "\n" }{MPLTEXT 1 208 55 "\n SST:=SST + u^(map( z -> z mod m, SSTcontri ) ):" } {MPLTEXT 1 208 26 "\n od: #closes facecolors " }{MPLTEXT 1 208 79 "\n fi: # Closing the ColD iffMatch" }{MPLTEXT 1 208 111 "\nod: \+ # Closing indx loop (one color here at a time, for indx ). " }{MPLTEXT 1 208 13 "\nreturn(SST);" }{MPLTEXT 1 208 5 "\nend:" } {MPLTEXT 1 208 1 "\n" }}}{EXCHG {PARA 203 "" 0 "" {TEXT -1 0 "" }}} {PARA 204 "" 0 "" {TEXT -1 0 "" }}{PARA 205 "" 0 "" {TEXT -1 0 "" }}} {MARK "0 1 8" 67 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }