{VERSION 5 0 "Linux" "5.0" } {USTYLETAB {PSTYLE "Heading 4" -1 20 1 {CSTYLE "" -1 -1 "Times" 1 10 0 0 0 1 1 1 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Ord ered List 5" -1 200 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 144 2 0 2 2 -1 1 }{PSTYLE "Ordered List 1" -1 201 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 0 2 0 2 2 -1 1 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Bullet Item" -1 15 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 0 2 0 2 2 -1 1 }{PSTYLE "Lef t Justified Maple Output" -1 12 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Help" -1 10 1 {CSTYLE "" -1 -1 "Courier" 1 9 0 0 255 1 2 2 2 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Author" -1 19 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }3 1 0 0 8 8 2 0 2 0 2 2 -1 1 }{PSTYLE "Diagnostic" -1 9 1 {CSTYLE "" -1 -1 "Courier" 1 10 64 128 64 1 2 2 2 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Headi ng 2" -1 4 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 0 0 1 }1 1 0 0 8 2 2 0 2 0 2 2 -1 1 }{PSTYLE "Ordered List 3" -1 202 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 72 2 0 2 2 -1 1 }{PSTYLE "Maple Plot" -1 13 1 {CSTYLE "" -1 -1 "Tim es" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }3 1 0 0 0 0 2 0 2 0 2 2 -1 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Dash Item" -1 16 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 0 2 0 2 2 -1 1 }{PSTYLE "Heading 3" -1 5 1 {CSTYLE "" -1 -1 "Times " 1 12 0 0 0 1 1 1 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 } {PSTYLE "Ordered List 4" -1 203 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 108 2 0 2 2 -1 1 }{PSTYLE "Maple \+ Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }3 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Line Printed Output" -1 6 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "List Item" -1 14 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 0 2 0 2 2 -1 1 }{PSTYLE "Warning" -1 7 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Error" -1 8 1 {CSTYLE "" -1 -1 "Courier" 1 10 255 0 255 1 2 2 2 2 2 1 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Fixed Width" -1 17 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }3 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 0 0 1 }1 1 0 0 8 4 2 0 2 0 2 2 -1 1 }{PSTYLE "Title " -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 0 0 1 }3 1 0 0 12 12 2 0 2 0 2 2 -1 1 }{PSTYLE "Ordered List 2" -1 204 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 3 3 2 36 2 0 2 2 -1 1 }{CSTYLE "Help Variable" -1 25 "Courier" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Text" -1 200 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Bold" -1 39 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Page Number" -1 33 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math Italic Small" -1 201 "Times" 1 1 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Nonterminal" -1 24 "Courier" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Default" -1 38 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Maple Comment" -1 21 "Courier" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Maple Input" -1 0 "Courier" 1 12 255 0 0 1 2 1 2 2 1 2 0 0 0 1 }{CSTYLE "2D Math Small" -1 7 "Times " 1 1 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Fixed" -1 23 "Courier " 1 10 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Popup" -1 31 "Times" 1 12 0 128 128 1 1 2 1 2 2 2 0 0 0 1 }{CSTYLE "Plot Title" -1 27 "Times" 1 10 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "2D Input" -1 19 "Times" 1 12 255 0 0 1 2 2 2 2 1 2 0 0 0 1 }{CSTYLE "Copyright" -1 34 "Times" 1 10 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Maple Input Placeholder" -1 202 "Courier" 1 12 200 0 200 1 2 1 2 2 1 2 0 0 0 1 }{CSTYLE "2D Math Bold Small" -1 10 "Times" 1 1 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "2D Mat h" -1 2 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Notes" -1 37 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Help Underli ned Bold" -1 41 "Times" 1 12 0 0 0 1 1 1 2 2 2 2 0 0 0 1 }{CSTYLE "Hyp erlink" -1 17 "Times" 1 12 0 128 128 1 2 2 1 2 2 2 0 0 0 1 }{CSTYLE "2 D Math Symbol 2" -1 16 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 } {CSTYLE "Plot Text" -1 28 "Times" 1 8 0 0 0 1 2 2 2 2 2 2 0 0 0 1 } {CSTYLE "Help Italic" -1 42 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 } {CSTYLE "Output Labels" -1 29 "Times" 1 8 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Heading" -1 26 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Help Normal" -1 30 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "2D Comment" -1 18 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Maple Name" -1 35 "Times" 1 12 104 64 92 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "2D Output" -1 20 "Times" 1 12 0 0 255 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Dictionary Hyperlink" -1 45 "Times" 1 12 147 0 15 1 2 2 1 2 2 2 0 0 0 1 }{CSTYLE "Help Emphasized" -1 22 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Italic Bold" -1 40 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "LaTeX" -1 32 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "Help Menus" -1 36 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Prompt" -1 1 "Courier" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "Help Underlined" -1 44 "Times" 1 12 0 0 0 1 2 2 1 2 2 2 0 0 0 1 }{CSTYLE "Help Underlined Italic" -1 43 "Times" 1 12 0 0 0 1 1 2 1 2 2 2 0 0 0 1 }{CSTYLE "2D Math Bold" -1 5 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math Italic" -1 3 "Times " 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT 203 34 "Procedures for sample wo rksheet IV" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 204 2 "\n" }{TEXT 204 2 " \n" }{TEXT 204 149 "This worksheet contains programs for worksheet IV. Most of these procedures are the same or are similar to those found i n the previous worksheets. \n" }{TEXT 204 157 "There are a few major d ifferences. The first is that the valid color vectors are know calcula ted with a c program that has been dynamically linked to Maple. " }} {PARA 0 "" 0 "" {TEXT 204 358 "This will speed up the process signific antly. The second difference is that procedures are included that will calculate invariants in a systematic way. Procedures will automatical ly generate file names and save all data for the case that the user i s calculating. This worksheet includes procedures for the cases presen ted in the three previous worksheets.\n" }{TEXT 204 48 "The procedures included in this worksheet are:\n" }{TEXT 204 2 "\n" }{TEXT 204 37 "v alidColorVectors:=define_external(\n" }{TEXT 204 47 " \+ 'validcolorvectorsint',\n" }{TEXT 204 62 " ' quandle'::ARRAY(datatype=integer[2]),\n" }{TEXT 204 50 " \+ 'quandlesize'::integer[4],\n" }{TEXT 204 59 " \+ 'knot'::ARRAY(datatype=integer[2]),\n" }{TEXT 204 49 " \+ 'braidindex'::integer[4],\n" }{TEXT 204 47 " \+ 'nopsknot'::integer[4],\n" }{TEXT 204 65 " \+ 'validCvecs'::ARRAY(datatype=integer[2]),\n" }{TEXT 204 43 " \+ RETURN::integer[4],\n" }{TEXT 204 47 " \+ LIB=\"ValCol8_1_05.so\"):" }}{PARA 0 "" 0 "" {TEXT 204 40 "cvrtarra y:=proc(brind,nopknt,L,numVC);\n" }{TEXT 204 45 "Invar2_3UntwistedDLL: =proc(Quandle,p,Knot);\n" }{TEXT 204 98 "CalcUntwistinvars:=proc(fileP ATH,p ,qord,qnum,numberofknots,\{cpath:=false\},\{solpath=false\});\n" }{TEXT 204 36 "fpQuan:=proc(tfile,Quandle,qsize);\n" }{TEXT 204 43 "I nvar2UntwistedDLL:=proc(Quandle,p,Knot);\n" }{TEXT 204 96 "Calc2Untwis tinvars:=proc(filePATH,p,qord,qnum,numberofknots,\{cpath=false\},\{sol path:=false\});" }}{PARA 0 "" 0 "" {TEXT 204 41 "Invar3UntwistedDLL:=p roc(Quandle,p,Knot);" }}{PARA 0 "" 0 "" {TEXT 204 98 "Calc3Untwistinva rs:=proc(filePATH,p,qord,qnum,numberofknots,\{cpath=false\},\{solpath: =false\});\n" }{TEXT 204 66 "Invar2_3MochizukiDLL:=proc(Xpolym,Apolym, p,m1,m2,a3,n1,b2,Knot);\n" }{TEXT 204 105 "CalcMochinvars:=proc(filePA TH,p ,polym,m1,m2,a3,n,b,numberofknots,\{cpath:=false\},\{solpath:=fal se\});\n" }{TEXT 204 53 "Invar2MochizukiDLL:=proc(Xpolym,Apolym,p,n1,b 2,Knot);" }}{PARA 0 "" 0 "" {TEXT 204 95 "Calc2Mochinvars:=proc(filePA TH,p ,polym,n,b,numberofknots,\{cpath:=false\},\{solpath:=false\});" } }{PARA 0 "" 0 "" {TEXT 204 56 "Invar3MochizukiDLL:=proc(Xpolym,Apolym, p,m1,m2,a3,Knot);" }}{PARA 0 "" 0 "" {TEXT 204 102 "Calc3Mochinvars:=p roc(filePATH,p ,polym,m1,m2,a3,numberofknots,\{cpath:=false\},\{solpat h:=false\});\n" }{TEXT 204 25 "ismult:=proc(charstar);\n" }{TEXT 204 84 "CalcDihinvars:=proc(filePATH,p,numberofKnots,\{cpath:=false\},\{so lpath:=false\});\n" }{TEXT 204 39 "co2TwistedSol:=proc(Quandle,polym,p );\n" }{TEXT 204 41 "Invar2TwistedDLL(Quandle,knot,polym,p);\n" }{TEXT 204 97 "Calc2twistinvars(filePATH,p,polym,qord,qnum,numberofknots,\{c path:=false\},\{solpath:=false\});\n" }{TEXT 204 20 "tinverse(polym,p) ;\n" }{TEXT 204 2 "\n" }{TEXT 204 29 "quandlesize:=proc(Quandle);\n" } {TEXT 204 25 "makeinv:=proc(Quandle);\n" }{TEXT 204 39 "co2Solution:=p roc(Quandle,m::posint);\n" }{TEXT 204 22 "mirrorKnot:=proc(L);\n" } {TEXT 204 19 "barKnot:=proc(L);\n" }{TEXT 204 33 "connSumKnots:=proc(K nots_list);\n" }{TEXT 204 39 "co3Solution:=proc(Quandle,m::posint);\n" }{TEXT 204 48 "Mochizuki3coc:=proc(Xpolym,Apolym,p,m1,m2,a3);\n" } {TEXT 204 44 "cocycle3check:=proc(cocy,Xpolym,Apolym,p);\n" }{TEXT 204 14 "Xi:=proc(n);\n" }{TEXT 204 45 "Mochizuki2coc:=proc(Xpolym,Apol ym,p,m1,a2);\n" }{TEXT 204 44 "cocycle2check:=proc(cocy,Xpolym,Apolym, p);\n" }{TEXT 204 33 "MochizukiDihedral3coc:=proc(p);\n" }{TEXT 204 2 "\n" }}{PARA 0 "" 0 "" {TEXT 204 20 "Last updated 8/22/05" }}{PARA 0 " " 0 "" {TEXT 204 1 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT 204 1825 "This \+ procedure is perhaps the most powerful of the new procedures. A c prog ram libcolor8_1_05.c was created and compiled as a shared object file \+ (or a dynamic link library) in Linux. This program will generate all p ossible initial color vectors and then color a given braid. Only the v alid color vectors are saved. These color vectors are then stored in a n array validCvecs that is passed to the c program from this Maple pro cedure. The parameters used in the define_external ar enow explained. \+ The fist element ''validcolorvectorsint' is the name of the function t hat was used in the c program. 'quandle' is the Cayley table for the q uandle that is used. Arrays must be modified slightly before passing t hem to the c program. Assume you have a quandle, Quandle:=Q3 := array( 0 .. 2, 0 .. 2,[(2, 1)=0,(0, 0)=0,(2, 2)=2,(0, 1)=2,(0, 2)=1,(1, 0)=2, (1, 1)=1,(1, 2)=0,(2, 0)=1]); stored as in the previous worksheets. No w the quandle should be modified to QuandleC by the following statemen t, QuandleC:=Array(op(Quandle),datatype=integer[2],order=C_order): Thi s will change the datatype to a 2 byte integer and store it in C_order . This will allow the c program to use it. All arrays passed to this f unction must be modified in this way. The second term 'quandlesize' is an integer representing the order of the quandle. 'knot' is an array \+ that is the braid word for the knot. It must be modified as the quandl e array was before passing it. Next the braid index and the number of \+ crossings, 'braidindex' and 'nopsknot' respectively, are integers. Fin ally, an empty array validCvecs' is created and passed to the function . This is really just a pointer that will be used to store that valid \+ color vectors. This array can be initialized by the followingstatement , VALIDCOLORS:=Array(0..10000000,datatype=integer[2],order=C_order):\n " }{TEXT 204 1332 "This array is declared with a bound to it. Statical ly declaring the array makes things easier, but may create problems un der special cases. For example, it requires the braid index * nops(Kno t)+1 many cells of the array to store the valid color vectors for one \+ valid coloring of the braid. So if the # valid colorings is greater th an 10000000/(braidindex*nops(Knot)+1) then a segmentation fault will b e created with the c program and then passed to the Maple program. The re are some possible modification that can be made without rewriting t he c program to dynamically declare memory. One such solution would be to allocate more menory for the validCvecs array. The above example a lloted 10000000 cells at 2 bytes each. This requires 20 MB of space. S o if you computer has enough memory you could simply declare a larger \+ array. There are other solutions to this problem. If this turn out to \+ be a frequently encountered problem, we will rework this. I have ideas already, but I feel this is a good alpha version. The function will r eturn an integer representing the number of valid colorings for the br aid. This is a 4 byte integer and should not exceed 2^31 -1. The share d object file \"ValCol8_1_05.so\" should be stored in the same directo ry as the worksheet calling it to avoid altering the PATH given to the LIB statement below." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "res tart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "validColorVectors: =define_external(\n" }{MPLTEXT 1 0 47 " 'validcol orvectorsint',\n" }{MPLTEXT 1 0 62 " 'quandle'::A RRAY(datatype=integer[2]),\n" }{MPLTEXT 1 0 50 " \+ 'quandlesize'::integer[4],\n" }{MPLTEXT 1 0 59 " \+ 'knot'::ARRAY(datatype=integer[2]),\n" }{MPLTEXT 1 0 49 " \+ 'braidindex'::integer[4],\n" }{MPLTEXT 1 0 47 " \+ 'nopsknot'::integer[4],\n" }{MPLTEXT 1 0 65 " \+ 'validCvecs'::ARRAY(datatype=integer[2]),\n" }{MPLTEXT 1 0 43 " \+ RETURN::integer[4],\n" }{MPLTEXT 1 0 73 " \+ LIB=\"/media/sda1/WorksheetIV/ValCol8_1_05.so\"):\n" } {MPLTEXT 1 0 2 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT 204 811 "This next procedure is used to change the one dimensional array containing the \+ valid color vectors that was created with the Maple procedure validCol orVectors() to a three dimensional array. The first index will range f rom 1 to the number of valid coloring. The second and third indices ar e the crossing and strand, respectively. There may be an automatic con version (dimension) for this, but it was faster and safer for me to cr eate a procedure for it. The first and second parameters are the braid index and the number of crossings for the braid. The third parameter, L, is the name of the array that the valid color vectors were stored \+ in from validColorVectors() procedure. The final parameter, numVC, is \+ the value returned by the above procedure. It represents the number of valid colorings of the braid. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "cvrtarray:=proc(brind,nopknt,L,numVC)\n" }{MPLTEXT 1 0 31 "lo cal i,j,k,tempClr,counttmp;\n" }{MPLTEXT 1 0 20 "tempClr[0]:=numVC;\n" }{MPLTEXT 1 0 26 "for i from 1 to numVC do\n" }{MPLTEXT 1 0 32 " fo r j from 1 to nopknt+1 do\n" }{MPLTEXT 1 0 38 " tempClr[i][j]:=arr ay(1..brind);\n" }{MPLTEXT 1 0 8 "od:od:\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 49 "#tempClr:=array(0..numVC,1..nopknt+1,1..brind);\n" } {MPLTEXT 1 0 32 "#counttmp:=brind*(nopknt+1)+2;\n" }{MPLTEXT 1 0 14 "c ounttmp:=1;\n" }{MPLTEXT 1 0 27 "for i from 1 to numVC do\n" } {MPLTEXT 1 0 31 " for j from 1 to nopknt+1 do\n" }{MPLTEXT 1 0 31 " \+ for k from 1 to brind do\n" }{MPLTEXT 1 0 39 " tempClr[i][j][ k]:=L[counttmp];\n" }{MPLTEXT 1 0 30 " counttmp:=counttmp+1;\n" }{MPLTEXT 1 0 10 " od:\n" }{MPLTEXT 1 0 8 " od:\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 16 "eval(tempClr):\n" }{MPLTEXT 1 0 6 "end: \n" }{MPLTEXT 1 0 2 "\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 204 701 "This procedure is similar to those discussed in the worksheet \"cocysample .mws\" The \"untwisted case.\" This procedure will take a quandle, a p rime modulus, and a knot in braid form. The quandle is stored as it wa s in \"cocysample.mws\" (ie. A two dimensional zero indexed array). Th is program will evaluate the 2-cocycle and 3-cocycle values for the un twisted case by solving an overdetermined system of equations generate d from the cocycle conditions. It will use the c program to generate a ll valid colorings of the braid and then will calculate the colorings \+ of the regions while evaluating the state sum for the two and three co cycle cases. This procedure will return in the following order: \n" } {TEXT 204 52 "1) the value of the untwisted 2-cocycle invariant,\n" } {TEXT 204 50 "2) the value of the untwisted 3-cocycle invariant," }} {PARA 0 "" 0 "" {TEXT 204 37 "3) the valid coloring of the braid,\n" } {TEXT 204 46 "4) the solutions to the 2-cocycle condition,\n" }{TEXT 204 50 "5) the solutions to the 3-cocycle condition, and\n" }{TEXT 204 47 "6) the number of valid coloring of the braid.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "Invar2_3UntwistedDLL:=proc(Quandle, p,Knot)\n" }{MPLTEXT 1 0 80 "local SST2coc,SST3coc,SST2contri,SST3cont ri,jj3,jj5,jj6,jj8,s,num,Color,brind,\n" }{MPLTEXT 1 0 64 " indx, ColDiffMatch0,ColorDiff0,Ginv,quandleorder, \n" }{MPLTEXT 1 0 56 " co2Solutions,co3Solutions,Facecolors,facecolors,\n" } {MPLTEXT 1 0 54 " precolorface,nowcolor,colcoloring,VALIDCOLORS, \n" }{MPLTEXT 1 0 60 " QuandleC,KnotC,x,y,i,valid2coc,valid3coc,n umVcolors;\n" }{MPLTEXT 1 0 13 "SST2coc:=0;\n" }{MPLTEXT 1 0 13 "SST3c oc:=0;\n" }{MPLTEXT 1 0 18 "VALIDCOLORS:=[];\n" }{MPLTEXT 1 0 20 "#val id2coc:=false;\n" }{MPLTEXT 1 0 20 "#valid3coc:=false;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 28 "#print(\"Program start\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "co3Solutions:=[];\n" }{MPLTEXT 1 0 19 "co2S olutions:=[];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 37 "quandleorder:= quandlesize(Quandle);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 39 "co3Solutions:=co3Solution(Quandl e,p);\n" }{MPLTEXT 1 0 39 "co2Solutions:=co2Solution(Quandle,p);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 "brind:=max(op(map(x->abs(x),Knot )))+1;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 " #################\n" }{MPLTEXT 1 0 16 "numVcolors:=0;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 20 "##################\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 29 "#print(\"brind is\",brind);\n" }{MPLTEXT 1 0 65 "Qua ndleC:=Array(op(Quandle),datatype=integer[2],order=C_order):\n" } {MPLTEXT 1 0 30 "#print(\"finish QuandleC\");\n" }{MPLTEXT 1 0 73 "Kno tC:=Array(0..(nops(Knot)-1),Knot,datatype=integer[2],order=C_order):\n " }{MPLTEXT 1 0 27 "#print(\"finish Knotc\");\n" }{MPLTEXT 1 0 68 "VAL IDCOLORS:=Array(0..10000000,datatype=integer[2],order=C_order):\n" } {MPLTEXT 1 0 33 "#print(\"finish VALIDCOLORS\");\n" }{MPLTEXT 1 0 90 " numVcolors:=validColorVectors(QuandleC,quandleorder,KnotC,brind,nops(K not),VALIDCOLORS):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 "#print(\" numVcolors is \",numVcolors);\n" }{MPLTEXT 1 0 79 "#validColorVectors( QuandleC,quandleorder,KnotC,brind,nops(Knot),VALIDCOLORS):\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 23 "Color[0]:=numVcolors;\n" } {MPLTEXT 1 0 28 "#Color[0]:=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 28 "#prin t(\"finish colors\"):\n" }{MPLTEXT 1 0 36 "#for x from 1 to VALIDCOLOR S[0] do\n" }{MPLTEXT 1 0 31 "for x from 1 to numVcolors do\n" } {MPLTEXT 1 0 35 " for y from 1 to nops(Knot)+1 do\n" }{MPLTEXT 1 0 38 " Color[x][y]:=array(1..brind,[]):\n" }{MPLTEXT 1 0 7 " od:\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 69 "for jj3 from 1 to (nops(Knot)+1) do # \+ Color vectors.\n" }{MPLTEXT 1 0 7 " \n" }{MPLTEXT 1 0 42 " Fac ecolors[jj3]:=array(0..brind-1):\n" }{MPLTEXT 1 0 6 " od;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 60 "Color:=cvrtarray(brind,nops(Knot),VALIDC OLORS,numVcolors);\n" }{MPLTEXT 1 0 28 "#Color[0]:=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 54 "#print(\"The number of valid co lorings \",Color[0]);\n" }{MPLTEXT 1 0 38 "#print(\"about to enter sst loop\");\n" }{MPLTEXT 1 0 38 "# for i from 1 to VALIDCOLORS[0] do\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 36 "for i from 1 to numVcolors do \+ \n" }{MPLTEXT 1 0 48 " for facecolors from 0 to (quandleorder-1) \+ do\n" }{MPLTEXT 1 0 82 " SST2contri:=0; \+ # State-sum contributions.\n" }{MPLTEXT 1 0 29 " SST3co ntri:=0; \n" }{MPLTEXT 1 0 57 " for precolorface from 1 to (nops(Knot)+1) do \n" }{MPLTEXT 1 0 11 " \n" }{MPLTEXT 1 0 54 " Facecolors[precolorface][0]:=facecolors:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 13 " od;\n" }{MPLTEXT 1 0 46 " \+ for nowcolor from 1 to nops(Knot) do\n" }{MPLTEXT 1 0 9 " \n" } {MPLTEXT 1 0 68 " for colcoloring from 0 to (abs(Knot[nowco lor])-1) do \n" }{MPLTEXT 1 0 97 " Facecolors[nowcolor ][colcoloring+1]:=Quandle[Facecolors[nowcolor][colcoloring],\n" } {MPLTEXT 1 0 90 " \+ Color[i][nowcolor][colcoloring+1]]:\n" }{MPLTEXT 1 0 8 " \n" } {MPLTEXT 1 0 17 " od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 13 " od:\n" }{MPLTEXT 1 0 40 " for s from 1 to nops(Kn ot) do \n" }{MPLTEXT 1 0 34 " if Knot[s] > 0 then\n" } {MPLTEXT 1 0 87 " SST3contri:= SST3contri + co3Solution s[Facecolors[s][abs(Knot[s])-1],\n" }{MPLTEXT 1 0 88 " \+ Color[i][s][abs(Knot[s])], Color[i][s][abs(Knot[s])+1] ] : \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " else\n" } {MPLTEXT 1 0 85 " SST3contri:=SST3contri -co3Solutions[ Facecolors[s][abs(Knot[s])-1],\n" }{MPLTEXT 1 0 92 " \+ Color[i][s+1][abs(Knot[s])], Color[i][s+1][abs(Knot[s])+1] ] :\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " \+ fi: \n" }{MPLTEXT 1 0 75 " od: \+ # Closing the state-sum term, for s.\n" }{MPLTEXT 1 0 38 " \+ \n" }{MPLTEXT 1 0 57 " SST3coc:=SST3coc + u^(map(z->z mod p,SST3contri));\n" }{MPLTEXT 1 0 15 " od: \n" }{MPLTEXT 1 0 49 " #closes facecolors \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 37 " for s from 1 to nops(Knot) do \n" }{MPLTEXT 1 0 34 " if Knot[s] > 0 then\n" } {MPLTEXT 1 0 115 " SST2contri:= SST2contri + co2Solutio ns[Color[i][s][abs(Knot[s])], Color[i][s][abs(Knot[s])+1] ] :\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " else\n" }{MPLTEXT 1 0 116 " SST2contri:=SST2contri -co2Solutions[Color[i][s +1][abs(Knot[s])],Color[i][s+1][abs(Knot[s])+1] ] :\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " fi: \n" } {MPLTEXT 1 0 14 " od: \n" }{MPLTEXT 1 0 103 " SST2coc:=SST2 coc + u^(map(z->z mod p,SST2contri)); \+ \n" }{MPLTEXT 1 0 100 "od: \+ # Closing indx loop (one color here at a time, for indx). \n" } {MPLTEXT 1 0 69 "return(SST2coc,SST3coc,Color,co2Solutions,co3Solution s,numVcolors);\n" }{MPLTEXT 1 0 6 "end:\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 204 427 "The procedure CalcUntwistinvars() will run the procedur e, Invar2_3UntwistedDLL:=proc(Quandle,p,Knot), over the 2977 knots sto red in the file knotsLivingston.txt. It will automatically generate fi lenames and write the data to the appropriate file. All of the values \+ that the 2-cocycle and 3-cocycle invariants take are written to the fi les, Z_puntwistedQqord_qnum_2cocinv.inv or Z_puntwistedQqord_qnum_3co cinv.inv. For example," }}{PARA 0 "" 0 "" {TEXT 204 728 " the values f or the untwisted 2 cocycle invariants with coefficient group Z_3 and c olored with the quandle Q6_25 would be stored in the file Z_3untwisted Q6_25_2cocinv.inv. This file is saved in the directory specified by th e string filePATH that is specified by the user. The solutions to the \+ cocycle conditions for a quandle Qqord_qnum over Z_p are stored in the file cociSolnsZ_puntwistedQqord_qnum where i=2 or 3 representing 2-co cycle or 3-cocycle. The valid colorings of a given braid with knot num ber Kx_y with the quandle Qqord_qnum are stored in the file, ColorsQqo rd_qnumKx_y.clr. numberofknots is how far through the table table you wish to calculate. For example, numberofknots=83 will calculate throu gh 9 crossings." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "CalcUntw istinvars:=proc(filePATH,p ,qord,qnum,numberofknots)\n" }{MPLTEXT 1 0 40 "#,\{cpath:=false\},\{solpath:=false\})\n" }{MPLTEXT 1 0 77 "local \+ i,HH,tmpfilename1,tmpfilename2,tmpfilename3,tmpf1,tmpf2,tmpf3,INVARS, \n" }{MPLTEXT 1 0 73 " Quandle,quandleorder,tmpfilename4,tmpfilen ame5,tmpf4,tmpf5,brind,\n" }{MPLTEXT 1 0 100 " tmpColorstr,x,y,z, tmpco2str,tmpco3str,bstrand,crossvec,colnum,JJ,writesolpath,cpath,solp ath;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 20 " \+ cpath:=args[6];\n" }{MPLTEXT 1 0 22 " solpath:=args[7];\n" } {MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 31 " Quandle:=cat(Q,qord,_,qnum);\n " }{MPLTEXT 1 0 38 " quandleorder:=quandlesize(Quandle);\n" }{MPLTEXT 1 0 28 " HH:=ssystem(date):HH[2];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 88 " tmpfilename1:=cat(filePATH,\"Z_\",p,\"untwistedQ\",qord,\"_\" ,qnum,\"_2cocinv.inv\");\n" }{MPLTEXT 1 0 88 " tmpfilename2:=cat(fileP ATH,\"Z_\",p,\"untwistedQ\",qord,\"_\",qnum,\"_3cocinv.inv\");\n" } {MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 23 "#if cpath<>false then\n" } {MPLTEXT 1 0 49 "#tmpfilename3:=cat(cpath,Colors,Q,qord,_,qnum);\n" } {MPLTEXT 1 0 6 "#fi;\n" }{MPLTEXT 1 0 25 "if solpath<> false then\n" } {MPLTEXT 1 0 88 " tmpfilename4:=cat(solpath,\"coc2SolnsZ_\",p,\"untwis tedQ\",qord,\"_\",qnum,\".sol\");\n" }{MPLTEXT 1 0 88 " tmpfilename5:= cat(solpath,\"coc3SolnsZ_\",p,\"untwistedQ\",qord,\"_\",qnum,\".sol\") ;\n" }{MPLTEXT 1 0 36 " tmpf4:=fopen(tmpfilename4,WRITE);\n" }{MPLTEXT 1 0 36 " tmpf5:=fopen(tmpfilename5,WRITE);\n" }{MPLTEXT 1 0 33 "print f(\"%s\\n\",tmpfilename4);\n" }{MPLTEXT 1 0 33 "printf(\"%s\\n\",tmpfi lename5);\n" }{MPLTEXT 1 0 133 " fprintf(tmpf4,\"#Untwisted Quandle 2- cocycle solutions for the Quandle Q%d_%d and \\n#coefficient group Z_% d\\n\\n\",qord,qnum,p);\n" }{MPLTEXT 1 0 132 " fprintf(tmpf5,\"#Untwis ted Quandle 3-cocyclesolutions for the Quandle Q%d_%d and \\n#coeffici ent group Z_%d\\n\\n\",qord,qnum,p);\n" }{MPLTEXT 1 0 77 " fprintf(tm pf4,\"#The cayley table for the quandle Q%d_%d\\n\",qord,qnum);\n" } {MPLTEXT 1 0 76 " fprintf(tmpf5,\"#The cayley table for the quandle Q% d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 38 " fpQuan(tmpf4,Quandle,quand leorder);\n" }{MPLTEXT 1 0 37 "fpQuan(tmpf5,Quandle,quandleorder);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 45 " fprintf(tmpf4,\"#Generated %s \\n\",HH[2]);\n" }{MPLTEXT 1 0 45 " fprintf(tmpf5,\"#Generated %s\\n\" ,HH[2]);\n" }{MPLTEXT 1 0 21 "writesolpath:=true;\n" }{MPLTEXT 1 0 5 " fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 36 " tmpf1:=fopen(tmpfilename1,WRITE);\n" }{MPLTEXT 1 0 36 " tmpf2:=fopen(tmpfilename2,WRITE);\n" }{MPLTEXT 1 0 37 "# tmpf3: =fopen(tmpfilename3,WRITE);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 33 " printf(\"%s\\n\",tmpfilename1);\n" }{MPLTEXT 1 0 33 "printf(\"%s\\n\", tmpfilename2);\n" }{MPLTEXT 1 0 34 "#printf(\"%s\\n\",tmpfilename3);\n " }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 134 " fprintf(tmpf1,\"#Untwisted Quandle 2-cocycle invari ants for the Quandle Q%d_%d and \\n#coefficient group Z_%d\\n\\n\",qor d,qnum,p);\n" }{MPLTEXT 1 0 134 " fprintf(tmpf2,\"#Untwisted Quandle 3 -cocycle invariants for the Quandle Q%d_%d and \\n#coefficient group Z _%d\\n\\n\",qord,qnum,p);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 76 " \+ fprintf(tmpf1,\"#The cayley table for the quandle Q%d_%d\\n\",qord,qnu m);\n" }{MPLTEXT 1 0 75 "fprintf(tmpf2,\"#The cayley table for the qua ndle Q%d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 38 " fpQuan(tmpf1,Quandl e,quandleorder);\n" }{MPLTEXT 1 0 38 " fpQuan(tmpf2,Quandle,quandleord er);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 110 "# fprintf(tmpf3,\"The valid color vectors for the braids colored with the quandle Q%d_%d\\n \\n\",qord,qnum);\n" }{MPLTEXT 1 0 75 "#fprintf(tmpf3,\"The cayley tab le for the quandle Q%d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 38 "#fpQua n(tmpf3,Quandle,quandleorder);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 45 " fprintf(tmpf1,\"#Generated % s\\n\",HH[2]);\n" }{MPLTEXT 1 0 46 " fprintf(tmpf2,\"#Generated %s\\n \",HH[2]); \n" }{MPLTEXT 1 0 46 " #fprintf(tmpf3,\"#Generated %s\\n\", HH[2]);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 35 " for i from 0 to numberofknots do\n" }{MPLTEXT 1 0 27 " #print(\"B efore loop\");\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 20 "JJ:=ssystem( date):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 53 " INVARS:=Invar2_3UntwistedDLL(Quandle,p,Knot[i,2]):\n" }{MPLTEXT 1 0 123 " fprintf(tmpf1,\"%s\\t%s\\t \\n%s\\n\\n\",convert(Knot[i,1],strin g),convert(Knot[i,2],string),convert(INVARS[1],string));\n" }{MPLTEXT 1 0 123 " fprintf(tmpf2,\"%s\\t%s\\t \\n%s\\n\\n\",convert(Knot[i,1],s tring),convert(Knot[i,2],string),convert(INVARS[2],string));\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 23 "if cpath<> false then\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 55 "tmpfilename3:=cat(cpath,\"Colors Q\",qord,\"_\",qnum);\n" }{MPLTEXT 1 0 60 " tmpfilename3:=cat(tmpfilen ame3,\"K\",Knot[i,1],\".clr\");\n" }{MPLTEXT 1 0 35 "tmpf3:=fopen(tmpf ilename3,WRITE);\n" }{MPLTEXT 1 0 34 "#printf(\"%s\\n\",tmpfilename3); \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 196 " fprintf(tmpf3,\"#The vali d color vectors for the braids colored with the quandle Q%d_%d \\n#for the knot %s with braid %s\\n\\n\",qord,qnum,convert(Knot[i,1],string) ,convert(Knot[i,2],string));\n" }{MPLTEXT 1 0 75 "fprintf(tmpf3,\"#The cayley table for the quandle Q%d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 37 "fpQuan(tmpf3,Quandle,quandleorder);\n" }{MPLTEXT 1 0 44 "fprintf (tmpf3,\"#Generated %s\\n\",JJ[2]);\n" }{MPLTEXT 1 0 67 " tmpColorstr: =cat(Col,convert(Knot[i,1],string),_,Q,qord,_,qnum);\n" }{MPLTEXT 1 0 57 "fprintf(tmpf3,\"%s[0]:=%d;\\n\",tmpColorstr,INVARS[6]);\n" } {MPLTEXT 1 0 45 "brind:=max(op(map(x->abs(x),Knot[i,2])))+1;\n" } {MPLTEXT 1 0 36 " for colnum from 1 to INVARS[6] do\n" }{MPLTEXT 1 0 48 " for crossvec from 1 to nops(Knot[i,2])+1 do\n" }{MPLTEXT 1 0 37 " for bstrand from 1 to brind do\n" }{MPLTEXT 1 0 78 " fp rintf(tmpf3,\"%s[%d][%d][%d]:=%d;\\n\",tmpColorstr,colnum,crossvec,\n" }{MPLTEXT 1 0 92 " bstrand ,INVARS[3][colnum][crossvec][bstrand]);\n" }{MPLTEXT 1 0 12 " od:od:od :\n" }{MPLTEXT 1 0 20 "JJ:=ssystem(date):\n" }{MPLTEXT 1 0 44 "fprintf (tmpf3,\"#Generated %s\\n\",JJ[2]);\n" }{MPLTEXT 1 0 33 " fprintf(tmp f3,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 16 "fclose(tmpf3);\n" }{MPLTEXT 1 0 49 "#tmpfilename3:=cat(cpath,Colors,Q,qord,_,qnum);\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 29 "if writesolpath<>fa lse then\n" }{MPLTEXT 1 0 51 "tmpco2str:=cat(co2SolUntwist,Q,qord,_,qn um,Z_,p);\n" }{MPLTEXT 1 0 51 "tmpco3str:=cat(co3SolUntwist,Q,qord,_,q num,Z_,p);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 36 " for x from 0 to \+ quandleorder-1 do\n" }{MPLTEXT 1 0 39 " for y from 0 to quandleorde r-1 do\n" }{MPLTEXT 1 0 41 " for z from 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 100 " fprintf(tmpf5,\"%s[%d,%d,%d]:=%s;\\n\",tm pco3str,x,y,z,convert(INVARS[5][x,y,z],string));\n" }{MPLTEXT 1 0 11 " od;\n" }{MPLTEXT 1 0 88 " fprintf(tmpf4,\"%s[%d,%d]:=%s;\\n\" ,tmpco2str,x,y,convert(INVARS[4][x,y],string));\n" }{MPLTEXT 1 0 9 " o d:od:\n" }{MPLTEXT 1 0 31 "fprintf(tmpf4,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 31 "fprintf(tmpf5,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 16 "fclose(tmpf4);\n" }{MPLTEXT 1 0 17 " fclose(tmpf5);\n " }{MPLTEXT 1 0 22 "writesolpath:=false;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 32 "print(\"finished all knots\") ;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 28 " HH:=ssystem(date):HH[2]; \n" }{MPLTEXT 1 0 44 "fprin tf(tmpf1,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 46 " fprintf(tm pf2,\"#Generated %s\\n\",HH[2]); \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 17 " fclose(tmpf1);\n" }{MPLTEXT 1 0 17 " fclose(tmpf2);\n" } {MPLTEXT 1 0 18 "# fclose(tmpf3);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 204 199 "The procedure fpQuan() is used in the procedure, CalcUntwistinva rs(), to print the quandle to the file. tfile is the name of the file . Quandle is the quandle, and qsize is the order of the quandle." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "fpQuan:=proc(tfile,Quandle,q size)\n" }{MPLTEXT 1 0 12 "local i,j;\n" }{MPLTEXT 1 0 28 "fprintf(tfi le,\"\\n# \");\n" }{MPLTEXT 1 0 29 " for i from 0 to qsize-1 do\n" } {MPLTEXT 1 0 31 " for j from 0 to qsize-1 do\n" }{MPLTEXT 1 0 45 " \+ fprintf(tfile,\"%5d \",Quandle[i,j]);\n" }{MPLTEXT 1 0 8 " od:\n " }{MPLTEXT 1 0 31 " fprintf(tfile,\"\\n# \");\n" }{MPLTEXT 1 0 5 " od:\n" }{MPLTEXT 1 0 28 "fprintf(tfile,\"\\n\\n\");\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 204 163 "This procedure is si milar to Invar2_3UntwistedDLL(), but it just does the 2-cocycle case. \+ The valid color vectors of the braid are calculated with the c program .\n" }{TEXT 204 37 "The parameters input are the same. \n" }{TEXT 204 35 "The output is ordered as follows:\n" }{TEXT 204 52 "1) the value o f the untwisted 2-cocycle invariant,\n" }{TEXT 204 37 "2) the valid co loring of the braid,\n" }{TEXT 204 50 "3) the solutions to the 2-cocyc le condition, and\n" }{TEXT 204 47 "4) the number of valid coloring of the braid.\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "Invar2Untw istedDLL:=proc(Quandle,p,Knot)\n" }{MPLTEXT 1 0 61 "local SST2coc,SST2 contri,jj3,jj5,jj6,jj8,s,num,Color,brind,\n" }{MPLTEXT 1 0 64 " i ndx,ColDiffMatch0,ColorDiff0,Ginv,quandleorder, \n" }{MPLTEXT 1 0 33 " co2Solutions,VALIDCOLORS,\n" }{MPLTEXT 1 0 50 " Qua ndleC,KnotC,x,y,i,valid2coc,numVcolors;\n" }{MPLTEXT 1 0 13 "SST2coc:= 0;\n" }{MPLTEXT 1 0 18 "VALIDCOLORS:=[];\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 28 "#print(\"Program start\");\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "co2Solution s:=[];\n" }{MPLTEXT 1 0 37 "quandleorder:=quandlesize(Quandle);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 17 "if nargs<4 \+ then\n" }{MPLTEXT 1 0 41 " co2Solutions:=co2Solution(Quandle,p);\n" } {MPLTEXT 1 0 6 "else\n" }{MPLTEXT 1 0 26 " co2Solutions:=args[4];\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 "brind:=max( op(map(x->abs(x),Knot)))+1;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 19 "#################\n" }{MPLTEXT 1 0 16 "numVcolor s:=0;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 20 "##################\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 29 "#print(\"brind is\",brind);\n" }{MPLTEXT 1 0 65 "QuandleC:=Array(op(Quandle),datatype=integer[2],orde r=C_order):\n" }{MPLTEXT 1 0 30 "#print(\"finish QuandleC\");\n" } {MPLTEXT 1 0 73 "KnotC:=Array(0..(nops(Knot)-1),Knot,datatype=integer[ 2],order=C_order):\n" }{MPLTEXT 1 0 27 "#print(\"finish Knotc\");\n" } {MPLTEXT 1 0 68 "VALIDCOLORS:=Array(0..10000000,datatype=integer[2],or der=C_order):\n" }{MPLTEXT 1 0 33 "#print(\"finish VALIDCOLORS\");\n" }{MPLTEXT 1 0 90 "numVcolors:=validColorVectors(QuandleC,quandleorder, KnotC,brind,nops(Knot),VALIDCOLORS):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 "#print(\"numVcolors is \",numVcolors);\n" }{MPLTEXT 1 0 79 "# validColorVectors(QuandleC,quandleorder,KnotC,brind,nops(Knot),VALIDCO LORS):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 23 "Color[0]:=numVcolors; \n" }{MPLTEXT 1 0 28 "#Color[0]:=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 28 " #print(\"finish colors\"):\n" }{MPLTEXT 1 0 36 "#for x from 1 to VALID COLORS[0] do\n" }{MPLTEXT 1 0 31 "for x from 1 to numVcolors do\n" } {MPLTEXT 1 0 35 " for y from 1 to nops(Knot)+1 do\n" }{MPLTEXT 1 0 38 " Color[x][y]:=array(1..brind,[]):\n" }{MPLTEXT 1 0 7 " od:\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 60 "Color:=cvrtarray(brind,nops(Knot ),VALIDCOLORS,numVcolors);\n" }{MPLTEXT 1 0 28 "#Color[0]:=VALIDCOLORS [0];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 54 "#print(\"The number of \+ valid colorings \",Color[0]);\n" }{MPLTEXT 1 0 38 "#print(\"about to e nter sst loop\");\n" }{MPLTEXT 1 0 38 "# for i from 1 to VALIDCOLORS[ 0] do\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 37 "for i from 1 to numVco lors do \n" }{MPLTEXT 1 0 82 " SST2contri:=0; \+ # State-sum contributions.\n" }{MPLTEXT 1 0 14 " \+ \n" }{MPLTEXT 1 0 37 " for s from 1 to nops(Knot) do \n" }{MPLTEXT 1 0 34 " if Knot[s] > 0 then\n" }{MPLTEXT 1 0 115 " SST2contri:= SST2contri + co2Solutions[Color[i][s ][abs(Knot[s])], Color[i][s][abs(Knot[s])+1] ] :\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 18 " else\n" }{MPLTEXT 1 0 116 " \+ SST2contri:=SST2contri -co2Solutions[Color[i][s+1][abs(Knot[s]) ],Color[i][s+1][abs(Knot[s])+1] ] :\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " fi: \n" }{MPLTEXT 1 0 14 " \+ od: \n" }{MPLTEXT 1 0 103 " SST2coc:=SST2coc + u^(map(z->z mo d p,SST2contri)); \n" } {MPLTEXT 1 0 100 "od: # Closing in dx loop (one color here at a time, for indx). \n" }{MPLTEXT 1 0 48 "re turn(SST2coc,Color,co2Solutions,numVcolors);\n" }{MPLTEXT 1 0 6 "end: \n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "Calc2Untwistinvars:=p roc(filePATH,p ,qord,qnum,numberofknots)\n" }{MPLTEXT 1 0 40 "#,\{cpat h:=false\},\{solpath:=false\})\n" }{MPLTEXT 1 0 77 "local i,HH,tmpfile name1,tmpfilename2,tmpfilename3,tmpf1,tmpf2,tmpf3,INVARS,\n" }{MPLTEXT 1 0 73 " Quandle,quandleorder,tmpfilename4,tmpfilename5,tmpf4,tm pf5,brind,\n" }{MPLTEXT 1 0 100 " tmpColorstr,x,y,z,tmpco2str,tmp co3str,bstrand,crossvec,colnum,JJ,writesolpath,cpath,solpath;\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 " cpath:=ar gs[6];\n" }{MPLTEXT 1 0 21 " solpath:=args[7];\n" }{MPLTEXT 1 0 2 "\n " }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 31 " Quandle:=cat(Q,qord,_,qnum) ;\n" }{MPLTEXT 1 0 38 " quandleorder:=quandlesize(Quandle);\n" } {MPLTEXT 1 0 28 " HH:=ssystem(date):HH[2];\n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 88 " tmpfilename1:=cat(filePATH,\"Z_\",p,\"untwistedQ\",q ord,\"_\",qnum,\"_2cocinv.inv\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 23 "#if cpath<>false then\n" }{MPLTEXT 1 0 49 "#tmpfilename3:=cat(cpath,Colors,Q,qord,_,qnum);\n" }{MPLTEXT 1 0 6 "# fi;\n" }{MPLTEXT 1 0 25 "if solpath<> false then\n" }{MPLTEXT 1 0 88 " tmpfilename4:=cat(solpath,\"coc2SolnsZ_\",p,\"untwistedQ\",qord,\"_\" ,qnum,\".sol\");\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 36 " tmpf4:=fo pen(tmpfilename4,WRITE);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 33 "pr intf(\"%s\\n\",tmpfilename4);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 133 " fprintf(tmpf4,\"#Untwisted Quandle 2-cocycle solutions for the Q uandle Q%d_%d and \\n#coefficient group Z_%d\\n\\n\",qord,qnum,p);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 77 " fprintf(tmpf4,\"#The cayley \+ table for the quandle Q%d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 38 " fpQuan(tmpf4,Quandle,quandleorder);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 45 " fprintf(tmpf4,\"#Ge nerated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 21 "writ esolpath:=true;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 36 " tmpf1:=fo pen(tmpfilename1,WRITE);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 37 "# t mpf3:=fopen(tmpfilename3,WRITE);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 33 "printf(\"%s\\n\",tmpfilename1);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 34 "#printf(\"%s\\n\",tmpfilename3);\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 134 " fpr intf(tmpf1,\"#Untwisted Quandle 2-cocycle invariants for the Quandle Q %d_%d and \\n#coefficient group Z_%d\\n\\n\",qord,qnum,p);\n" } {MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 76 " fprintf(tmpf1,\"#The cayley ta ble for the quandle Q%d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 38 " fpQuan(tmpf1,Quandle,quandleorder);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 110 "# fprintf(tmpf3,\"Th e valid color vectors for the braids colored with the quandle Q%d_%d \\n\\n\",qord,qnum);\n" }{MPLTEXT 1 0 75 "#fprintf(tmpf3,\"The cayley \+ table for the quandle Q%d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 38 "#fp Quan(tmpf3,Quandle,quandleorder);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 45 " fprintf(tmpf1,\"#Generate d %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 46 " #fprintf (tmpf3,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 35 " for i from 0 to numberofknots do\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 20 "JJ:=ssystem(date):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 51 " INVARS:=Invar2Untwi stedDLL(Quandle,p,Knot[i,2]):\n" }{MPLTEXT 1 0 123 " fprintf(tmpf1,\"% s\\t%s\\t \\n%s\\n\\n\",convert(Knot[i,1],string),convert(Knot[i,2],st ring),convert(INVARS[1],string));\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 23 "if cpath<> false then\n" }{MPLTEXT 1 0 55 "tmpfilename3:=cat(cpa th,\"ColorsQ\",qord,\"_\",qnum);\n" }{MPLTEXT 1 0 60 " tmpfilename3:=c at(tmpfilename3,\"K\",Knot[i,1],\".clr\");\n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 35 "tmpf3:=fopen(tmpfilename3,WRITE);\n" }{MPLTEXT 1 0 34 "#printf(\"%s\\n\",tmpfilename3);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 196 " fprintf(tmpf3,\"#The valid color vectors for the braids col ored with the quandle Q%d_%d \\n#for the knot %s with braid %s\\n\\n\" ,qord,qnum,convert(Knot[i,1],string),convert(Knot[i,2],string));\n" } {MPLTEXT 1 0 75 "fprintf(tmpf3,\"#The cayley table for the quandle Q%d _%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 37 "fpQuan(tmpf3,Quandle,quandle order);\n" }{MPLTEXT 1 0 44 "fprintf(tmpf3,\"#Generated %s\\n\",JJ[2]) ;\n" }{MPLTEXT 1 0 67 " tmpColorstr:=cat(Col,convert(Knot[i,1],string) ,_,Q,qord,_,qnum);\n" }{MPLTEXT 1 0 57 "fprintf(tmpf3,\"%s[0]:=%d;\\n \",tmpColorstr,INVARS[4]);\n" }{MPLTEXT 1 0 45 "brind:=max(op(map(x->a bs(x),Knot[i,2])))+1;\n" }{MPLTEXT 1 0 36 " for colnum from 1 to INVAR S[4] do\n" }{MPLTEXT 1 0 48 " for crossvec from 1 to nops(Knot[i,2]) +1 do\n" }{MPLTEXT 1 0 37 " for bstrand from 1 to brind do\n" } {MPLTEXT 1 0 78 " fprintf(tmpf3,\"%s[%d][%d][%d]:=%d;\\n\",tmpCo lorstr,colnum,crossvec,\n" }{MPLTEXT 1 0 92 " \+ bstrand,INVARS[2][colnum][crossvec][bstrand]);\n" } {MPLTEXT 1 0 12 " od:od:od:\n" }{MPLTEXT 1 0 20 "JJ:=ssystem(date):\n" }{MPLTEXT 1 0 44 "fprintf(tmpf3,\"#Generated %s\\n\",JJ[2]);\n" } {MPLTEXT 1 0 33 " fprintf(tmpf3,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 16 " fclose(tmpf3);\n" }{MPLTEXT 1 0 49 "#tmpfilename3:=cat(cpath,Colors,Q, qord,_,qnum);\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 29 "if writesolpath<>false then\n" }{MPLTEXT 1 0 51 "tmpc o2str:=cat(co2SolUntwist,Q,qord,_,qnum,Z_,p);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 36 " for x from 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 39 " for y from 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 92 " \+ fprintf(tmpf4,\"%s[%d,%d]:=%s;\\n\",tmpco2str,x,y,convert(INVARS[3][x ,y],string));\n" }{MPLTEXT 1 0 9 " od:od:\n" }{MPLTEXT 1 0 31 "fprintf (tmpf4,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 16 "fclose(tmpf4);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 22 "writesolpath:=false;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 5 "fi; \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 32 "print(\"finished all knots\");\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 28 " HH:=s system(date):HH[2]; \n" }{MPLTEXT 1 0 44 "fprintf(tmpf1,\"#Generated % s\\n\",HH[2]);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 17 " fclose(tmpf1 );\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 "# fclose(tmpf3);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 4 "end:" }}} {EXCHG {PARA 0 "" 0 "" {TEXT 204 150 "This procedure is similar to Inv ar2_3UntwistedDLL(), but it just does the 3-cocycle case. The valid co lor vectors are calculated with the c program.\n" }{TEXT 204 37 "The p arameters input are the same. \n" }{TEXT 204 35 "The output is ordered as follows:\n" }{TEXT 204 52 "1) the value of the untwisted 3-cocycle invariant,\n" }{TEXT 204 61 "2) the valid coloring of the braid (excl uding the regions),\n" }{TEXT 204 50 "3) the solutions to the 3-cocycl e condition, and\n" }{TEXT 204 67 "4) the number of valid coloring of \+ the braid (excluding regions).\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "Invar3UntwistedDLL:=proc(Quandle,p,Knot)\n" }{MPLTEXT 1 0 61 "local SST3coc,SST3contri,jj3,jj5,jj6,jj8,s,num,Color,brind,\n" } {MPLTEXT 1 0 64 " indx,ColDiffMatch0,ColorDiff0,Ginv,quandleorder , \n" }{MPLTEXT 1 0 43 " co3Solutions,Facecolors,facecolor s,\n" }{MPLTEXT 1 0 54 " precolorface,nowcolor,colcoloring,VALIDC OLORS,\n" }{MPLTEXT 1 0 60 " QuandleC,KnotC,x,y,i,valid2coc,valid 3coc,numVcolors;\n" }{MPLTEXT 1 0 13 "SST3coc:=0;\n" }{MPLTEXT 1 0 18 "VALIDCOLORS:=[];\n" }{MPLTEXT 1 0 20 "#valid2coc:=false;\n" }{MPLTEXT 1 0 20 "#valid3coc:=false;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 28 " #print(\"Program start\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n " }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "co3Solutions:=[];\n" } {MPLTEXT 1 0 37 "quandleorder:=quandlesize(Quandle);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 17 "if nargs<4 then\n" } {MPLTEXT 1 0 41 " co3Solutions:=co3Solution(Quandle,p);\n" }{MPLTEXT 1 0 6 "else\n" }{MPLTEXT 1 0 26 " co3Solutions:=args[4];\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 "brind:=max(op(map(x->abs(x),Knot)))+1;\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "########### ######\n" }{MPLTEXT 1 0 16 "numVcolors:=0;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 20 "##################\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 29 "#print(\"brind is\",brind);\n" }{MPLTEXT 1 0 65 "QuandleC:=Arr ay(op(Quandle),datatype=integer[2],order=C_order):\n" }{MPLTEXT 1 0 30 "#print(\"finish QuandleC\");\n" }{MPLTEXT 1 0 73 "KnotC:=Array(0.. (nops(Knot)-1),Knot,datatype=integer[2],order=C_order):\n" }{MPLTEXT 1 0 27 "#print(\"finish Knotc\");\n" }{MPLTEXT 1 0 68 "VALIDCOLORS:=Ar ray(0..10000000,datatype=integer[2],order=C_order):\n" }{MPLTEXT 1 0 33 "#print(\"finish VALIDCOLORS\");\n" }{MPLTEXT 1 0 90 "numVcolors:=v alidColorVectors(QuandleC,quandleorder,KnotC,brind,nops(Knot),VALIDCOL ORS):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 "#print(\"numVcolors is \",numVcolors);\n" }{MPLTEXT 1 0 79 "#validColorVectors(QuandleC,quan dleorder,KnotC,brind,nops(Knot),VALIDCOLORS):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 23 "Color[0]:=numVcolors;\n" }{MPLTEXT 1 0 28 "#Color[0] :=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 28 "#print(\"finish colors\"):\n" } {MPLTEXT 1 0 36 "#for x from 1 to VALIDCOLORS[0] do\n" }{MPLTEXT 1 0 31 "for x from 1 to numVcolors do\n" }{MPLTEXT 1 0 35 " for y from 1 \+ to nops(Knot)+1 do\n" }{MPLTEXT 1 0 38 " Color[x][y]:=array(1..brin d,[]):\n" }{MPLTEXT 1 0 7 " od:\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 69 "for jj3 from 1 to (n ops(Knot)+1) do # Color vectors.\n" }{MPLTEXT 1 0 7 " \+ \n" }{MPLTEXT 1 0 42 " Facecolors[jj3]:=array(0..brind-1):\n" } {MPLTEXT 1 0 6 " od;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 60 "Color:= cvrtarray(brind,nops(Knot),VALIDCOLORS,numVcolors);\n" }{MPLTEXT 1 0 28 "#Color[0]:=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 54 "#print(\"The number of valid colorings \",Color[0]);\n" }{MPLTEXT 1 0 38 "#print(\"about to enter sst loop\");\n" }{MPLTEXT 1 0 38 "# f or i from 1 to VALIDCOLORS[0] do\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 35 "for i from 1 to numVcolors do \n" }{MPLTEXT 1 0 49 " for fac ecolors from 0 to (quandleorder-1) do\n" }{MPLTEXT 1 0 68 " \+ # State-sum contributions.\n" }{MPLTEXT 1 0 29 " SST3contri:=0; \n" }{MPLTEXT 1 0 57 " for \+ precolorface from 1 to (nops(Knot)+1) do \n" }{MPLTEXT 1 0 11 " \+ \n" }{MPLTEXT 1 0 54 " Facecolors[precolorface][0]:=face colors:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 13 " od;\n" } {MPLTEXT 1 0 46 " for nowcolor from 1 to nops(Knot) do\n" } {MPLTEXT 1 0 9 " \n" }{MPLTEXT 1 0 68 " for colcolori ng from 0 to (abs(Knot[nowcolor])-1) do \n" }{MPLTEXT 1 0 97 " \+ Facecolors[nowcolor][colcoloring+1]:=Quandle[Facecolors[nowco lor][colcoloring],\n" }{MPLTEXT 1 0 90 " \+ Color[i][nowcolor][colcoloring+1]]:\n" } {MPLTEXT 1 0 8 " \n" }{MPLTEXT 1 0 17 " od:\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 13 " od:\n" }{MPLTEXT 1 0 40 " for s from 1 to nops(Knot) do \n" }{MPLTEXT 1 0 34 " \+ if Knot[s] > 0 then\n" }{MPLTEXT 1 0 87 " SST3contr i:= SST3contri + co3Solutions[Facecolors[s][abs(Knot[s])-1],\n" } {MPLTEXT 1 0 88 " Color[i][s][abs(Knot[s])] , Color[i][s][abs(Knot[s])+1] ] :\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " else\n" }{MPLTEXT 1 0 85 " SST3contri :=SST3contri -co3Solutions[Facecolors[s][abs(Knot[s])-1],\n" }{MPLTEXT 1 0 92 " Color[i][s+1][abs(Knot[s])], Colo r[i][s+1][abs(Knot[s])+1] ] :\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " fi: \n" }{MPLTEXT 1 0 75 " o d: # Closing the state-sum term, for s.\n" } {MPLTEXT 1 0 38 " \n" }{MPLTEXT 1 0 57 " SST3coc:=SST3coc + u^(map(z->z mod p,SST3contri));\n" } {MPLTEXT 1 0 15 " od: \n" }{MPLTEXT 1 0 49 " \+ #closes facecolors \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 52 " \n" }{MPLTEXT 1 0 100 "od: # Closing indx loop (on e color here at a time, for indx). \n" }{MPLTEXT 1 0 48 "return(SST3co c,Color,co3Solutions,numVcolors);\n" }{MPLTEXT 1 0 6 "end:\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "Calc3Untwistinvars:=proc(fil ePATH,p ,qord,qnum,numberofknots)\n" }{MPLTEXT 1 0 40 "#,\{cpath:=fals e\},\{solpath:=false\})\n" }{MPLTEXT 1 0 77 "local i,HH,tmpfilename1,t mpfilename2,tmpfilename3,tmpf1,tmpf2,tmpf3,INVARS,\n" }{MPLTEXT 1 0 73 " Quandle,quandleorder,tmpfilename4,tmpfilename5,tmpf4,tmpf5,b rind,\n" }{MPLTEXT 1 0 100 " tmpColorstr,x,y,z,tmpco2str,tmpco3st r,bstrand,crossvec,colnum,JJ,writesolpath,cpath,solpath;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 20 " cpath:=args[6];\n " }{MPLTEXT 1 0 22 " solpath:=args[7];\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 31 " Quandle:=cat(Q,qord,_,qnum);\n " }{MPLTEXT 1 0 38 " quandleorder:=quandlesize(Quandle);\n" }{MPLTEXT 1 0 28 " HH:=ssystem(date):HH[2];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 88 " tmpfilename2:=cat(filePATH,\"Z_\",p,\"un twistedQ\",qord,\"_\",qnum,\"_3cocinv.inv\");\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 23 "#if cpath<>false then\n" }{MPLTEXT 1 0 49 "#tmpfile name3:=cat(cpath,Colors,Q,qord,_,qnum);\n" }{MPLTEXT 1 0 6 "#fi;\n" } {MPLTEXT 1 0 25 "if solpath<> false then\n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 88 " tmpfilename5:=cat(solpath,\"coc3SolnsZ_\",p,\"untwis tedQ\",qord,\"_\",qnum,\".sol\");\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 36 " tmpf5:=fopen(tmpfilename5,WRITE);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 33 "printf(\"%s\\n\",tmpfilename5);\n" }{MPLTEXT 1 0 3 " \+ \n" }{MPLTEXT 1 0 132 " fprintf(tmpf5,\"#Untwisted Quandle 3-cocycleso lutions for the Quandle Q%d_%d and \\n#coefficient group Z_%d\\n\\n\", qord,qnum,p);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 76 " fprintf(tmpf 5,\"#The cayley table for the quandle Q%d_%d\\n\",qord,qnum);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 37 "fpQuan(tmpf5,Quandle,quandleorde r);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 45 " fp rintf(tmpf5,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 21 "writesol path:=true;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 36 " tmpf2:=fopen(tmpfilename2,WRITE);\n" }{MPLTEXT 1 0 37 "# tmpf3:=f open(tmpfilename3,WRITE);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 33 "printf(\"%s\\n\",tmpfilename2);\n" }{MPLTEXT 1 0 34 "#printf(\"%s\\n\",tmpfilename3);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 134 " fprintf(tmpf2,\"#Untwisted Quandle 3-cocycle invariants for the \+ Quandle Q%d_%d and \\n#coefficient group Z_%d\\n\\n\",qord,qnum,p);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 75 "fprintf( tmpf2,\"#The cayley table for the quandle Q%d_%d\\n\",qord,qnum);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 38 " fpQuan(tmpf2,Quandle,quandleord er);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 110 "# fprintf(tmpf3,\"The valid color vectors for the braids colored with the quandle Q%d_%d\\n \\n\",qord,qnum);\n" }{MPLTEXT 1 0 75 "#fprintf(tmpf3,\"The cayley tab le for the quandle Q%d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 38 "#fpQua n(tmpf3,Quandle,quandleorder);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 46 " fprint f(tmpf2,\"#Generated %s\\n\",HH[2]); \n" }{MPLTEXT 1 0 46 " #fprintf(t mpf3,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 35 " for i from 0 to numberofknots do\n" } {MPLTEXT 1 0 27 " #print(\"Before loop\");\n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 20 "JJ:=ssystem(date):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 51 " INVARS:=Invar3UntwistedDLL(Quandle,p,Kno t[i,2]):\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 123 " fprintf(tmpf2,\" %s\\t%s\\t \\n%s\\n\\n\",convert(Knot[i,1],string),convert(Knot[i,2],s tring),convert(INVARS[1],string));\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 23 "if cpath<> false then\n" }{MPLTEXT 1 0 55 "tmpfilename3:=cat(c path,\"ColorsQ\",qord,\"_\",qnum);\n" }{MPLTEXT 1 0 60 " tmpfilename3: =cat(tmpfilename3,\"K\",Knot[i,1],\".clr\");\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 35 "tmpf3:=fopen(tmpfilename3,WRITE);\n" }{MPLTEXT 1 0 34 "#printf(\"%s\\n\",tmpfilename3);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 196 " fprintf(tmpf3,\"#The valid color vectors for the braids col ored with the quandle Q%d_%d \\n#for the knot %s with braid %s\\n\\n\" ,qord,qnum,convert(Knot[i,1],string),convert(Knot[i,2],string));\n" } {MPLTEXT 1 0 75 "fprintf(tmpf3,\"#The cayley table for the quandle Q%d _%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 37 "fpQuan(tmpf3,Quandle,quandle order);\n" }{MPLTEXT 1 0 44 "fprintf(tmpf3,\"#Generated %s\\n\",JJ[2]) ;\n" }{MPLTEXT 1 0 67 " tmpColorstr:=cat(Col,convert(Knot[i,1],string) ,_,Q,qord,_,qnum);\n" }{MPLTEXT 1 0 57 "fprintf(tmpf3,\"%s[0]:=%d;\\n \",tmpColorstr,INVARS[4]);\n" }{MPLTEXT 1 0 45 "brind:=max(op(map(x->a bs(x),Knot[i,2])))+1;\n" }{MPLTEXT 1 0 36 " for colnum from 1 to INVAR S[4] do\n" }{MPLTEXT 1 0 48 " for crossvec from 1 to nops(Knot[i,2]) +1 do\n" }{MPLTEXT 1 0 37 " for bstrand from 1 to brind do\n" } {MPLTEXT 1 0 78 " fprintf(tmpf3,\"%s[%d][%d][%d]:=%d;\\n\",tmpCo lorstr,colnum,crossvec,\n" }{MPLTEXT 1 0 92 " \+ bstrand,INVARS[2][colnum][crossvec][bstrand]);\n" } {MPLTEXT 1 0 12 " od:od:od:\n" }{MPLTEXT 1 0 20 "JJ:=ssystem(date):\n" }{MPLTEXT 1 0 44 "fprintf(tmpf3,\"#Generated %s\\n\",JJ[2]);\n" } {MPLTEXT 1 0 33 " fprintf(tmpf3,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 16 " fclose(tmpf3);\n" }{MPLTEXT 1 0 49 "#tmpfilename3:=cat(cpath,Colors,Q, qord,_,qnum);\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 29 "if writesolpath<>false then\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 51 "tmpco3str:=cat(co3SolUntwist,Q,qord,_,qnum,Z_,p);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 36 " for x from 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 39 " for y from 0 to quandleorder-1 do\n" } {MPLTEXT 1 0 41 " for z from 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 100 " fprintf(tmpf5,\"%s[%d,%d,%d]:=%s;\\n\",tmpco3str,x,y ,z,convert(INVARS[3][x,y,z],string));\n" }{MPLTEXT 1 0 11 " od;\n " }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 9 " od:od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 31 "fprintf(tmpf5,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 17 " fclose(tmpf5);\n" } {MPLTEXT 1 0 22 "writesolpath:=false;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 32 "print(\"finished all knots\") ;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 28 " HH:=ssystem(date):HH[2]; \n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 46 " fprintf(tmpf2,\"#Generated %s\\n\",HH[2]); \n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 17 " fclose(tm pf2);\n" }{MPLTEXT 1 0 18 "# fclose(tmpf3);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 204 968 "This procedure is similar to the one discussed in the w orksheet \"cocysampleIII.mws,\" the \"Mochizuki Polynomial Cases.\" Th is procedure will take two polynomials, in t, Xpolym and Apolym, and a prime modulus. The Alexander quandle Z_p[t,t^-1]/(Xpolym) is used to \+ color the braids. The Alexander quandle Z_p[t,t^-1]/(Apolym) is used f or the coefficient group. This program will evaluate the 2-cocycle and 3-cocycle values from the Mochizuki polynomial formula. The 2-cocycle formula is f(x,y)=x-y)^p^(n1) * y^(b2) where n1 and b2 correspond to \+ the arguments passed to the procedure. The 3-cocycle formula is, f(x,y ,z)=(x-y)^p^(m1) * (y-z)^p^(m2) * z^(a3) where m1, m2, and a3 correspo nd to arguments passed to the procedure. It will use the c program to \+ generate all valid colorings of the braid and then will calculate the \+ colorings of the regions while evaluating the state sum for the two an d three cocycle cases. The final parameter is the braid word of a knot .\n" }{TEXT 204 53 "This procedure will return in the following order: \n" }{TEXT 204 63 "1) the value of the Mochizuki polynomial 2-cocycle invariant,\n" }{TEXT 204 61 "2) the value of the Mochizuki polynomial 3-cocycle invariant," }}{PARA 0 "" 0 "" {TEXT 204 37 "3) the valid co loring of the braid,\n" }{TEXT 204 62 "4) the values of the Mochizuki \+ polynomial 2-cocycle formula,\n" }{TEXT 204 66 "5) the values of the M ochizuki polynomial 3-cocycle formula, and\n" }{TEXT 204 47 "6) the nu mber of valid coloring of the braid.\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 204 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "Invar2_3Mo chizukiDLL:=proc(Xpolym,Apolym,p,m1,m2,a3,n1,b2,Knot)\n" }{MPLTEXT 1 0 55 "#Procedure to calculate the state sum term for a knot\n" } {MPLTEXT 1 0 76 "#Input: (1) Xpolym is the polynomial from the Alexand er quandle that will \n" }{MPLTEXT 1 0 40 "# be used to colo r the knot.\n" }{MPLTEXT 1 0 71 "# (2) Apolym is the polynomial \+ from the alexander quandle that \n" }{MPLTEXT 1 0 43 "# is u sed for the coefficients.\n" }{MPLTEXT 1 0 41 "# (3) prime, p, f or the quandles.\n" }{MPLTEXT 1 0 44 "# (4) From Mochizuki theor em a1=p^m1\n" }{MPLTEXT 1 0 45 "# (5) From Mochizuki theorem a2= p^m2 \n" }{MPLTEXT 1 0 81 "# (6) From Mochizuki theorem a3=p^m3 \+ or a3=0. So a3 must be a power of p \n" }{MPLTEXT 1 0 23 "# \+ or zero.\n" }{MPLTEXT 1 0 54 "# (7) A knot given in braid form \+ (ex [1,1,1]).\n" }{MPLTEXT 1 0 37 "#Output: The state sum of the knot. \n" }{MPLTEXT 1 0 67 "#Example Input: Invar3Mochizuki(t^2-t+1,t^2-t+1, 5,0,1,0,[1,1,1]);\n" }{MPLTEXT 1 0 81 "#Example Output: 625+3750*u^(t +3)+3750*u^(4*t+2)+3750*u^(3*t+4)+3750*u^(1+2*t)\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 80 "local SST2coc,SST3coc,SST2contri,SST3contri,jj3, jj5,jj6,jj8,s,num,Color,brind,\n" }{MPLTEXT 1 0 64 " indx,ColDiff Match0,ColorDiff0,Ginv,quandleorder, \n" }{MPLTEXT 1 0 56 " \+ co2Solutions,co3Solutions,Facecolors,facecolors,\n" }{MPLTEXT 1 0 62 " precolorface,nowcolor,colcoloring,Quandle,VALIDCOLORS,\n" } {MPLTEXT 1 0 60 " QuandleC,KnotC,x,y,i,valid2coc,valid3coc,numVco lors;\n" }{MPLTEXT 1 0 13 "SST2coc:=0;\n" }{MPLTEXT 1 0 13 "SST3coc:=0 ;\n" }{MPLTEXT 1 0 18 "VALIDCOLORS:=[];\n" }{MPLTEXT 1 0 19 "valid2coc :=false;\n" }{MPLTEXT 1 0 19 "valid3coc:=false;\n" }{MPLTEXT 1 0 2 "\n " }{MPLTEXT 1 0 28 "#print(\"Program start\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 96 "#The following will create the Cayley table for the Alexander Quandle where the elements come \n" } {MPLTEXT 1 0 26 "#from the set \{0..n-1\}\n" }{MPLTEXT 1 0 33 "Quandle :=AlexQuandle(Xpolym,p);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "co3 Solutions:=[];\n" }{MPLTEXT 1 0 19 "co2Solutions:=[];\n" }{MPLTEXT 1 0 37 "quandleorder:=quandlesize(Quandle);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 36 "#print(\"Generated the quandle\");\n" }{MPLTEXT 1 0 93 "# The following statement will use Mochizuki formula to get the va lues for each term of the\n" }{MPLTEXT 1 0 99 " #cocycle. The indices \+ of the array come from \{0..n-1\} and represent elements of the Alexan der \n" }{MPLTEXT 1 0 101 "#quandle X. The values of these elements li e in A=Z_p[t^(+-1)/(Apolym) and are in polynomial #form.\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 56 "co3Solutions:=Mochiz uki3coc(Xpolym,Apolym,p,m1,m2,a3);\n" }{MPLTEXT 1 0 53 "co2Solutions:= Mochizuki2coc(Xpolym,Apolym,p,n1,b2);\n" }{MPLTEXT 1 0 32 "#print(\"fi nished cocycles\");\n" }{MPLTEXT 1 0 63 "if type(co2Solutions,table) a nd type(co3Solutions,table) then\n" }{MPLTEXT 1 0 59 " valid2coc:=coc ycle2check(co2Solutions,Xpolym,Apolym,p);\n" }{MPLTEXT 1 0 59 " valid 3coc:=cocycle3check(co3Solutions,Xpolym,Apolym,p);\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 83 "#print(\"The value of c o3check is \",cocycle3check(coSolutions,Xpolym,Apolym,p));\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 33 "if valid2coc and valid3coc then \n" }{MPLTEXT 1 0 40 "brind:=max(op(map(x->abs(x),Knot)))+1;\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "########### ######\n" }{MPLTEXT 1 0 16 "numVcolors:=0;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 20 "##################\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 29 "#print(\"brind is\",brind);\n" }{MPLTEXT 1 0 65 "QuandleC:=Arr ay(op(Quandle),datatype=integer[2],order=C_order):\n" }{MPLTEXT 1 0 30 "#print(\"finish QuandleC\");\n" }{MPLTEXT 1 0 73 "KnotC:=Array(0.. (nops(Knot)-1),Knot,datatype=integer[2],order=C_order):\n" }{MPLTEXT 1 0 27 "#print(\"finish Knotc\");\n" }{MPLTEXT 1 0 68 "VALIDCOLORS:=Ar ray(0..10000000,datatype=integer[2],order=C_order):\n" }{MPLTEXT 1 0 33 "#print(\"finish VALIDCOLORS\");\n" }{MPLTEXT 1 0 90 "numVcolors:=v alidColorVectors(QuandleC,quandleorder,KnotC,brind,nops(Knot),VALIDCOL ORS):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 "#print(\"numVcolors is \",numVcolors);\n" }{MPLTEXT 1 0 79 "#validColorVectors(QuandleC,quan dleorder,KnotC,brind,nops(Knot),VALIDCOLORS):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 23 "Color[0]:=numVcolors;\n" }{MPLTEXT 1 0 28 "#Color[0] :=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 28 "#print(\"finish colors\"):\n" } {MPLTEXT 1 0 36 "#for x from 1 to VALIDCOLORS[0] do\n" }{MPLTEXT 1 0 31 "for x from 1 to numVcolors do\n" }{MPLTEXT 1 0 35 " for y from 1 \+ to nops(Knot)+1 do\n" }{MPLTEXT 1 0 38 " Color[x][y]:=array(1..brin d,[]):\n" }{MPLTEXT 1 0 7 " od:\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 69 "for jj3 from 1 to (n ops(Knot)+1) do # Color vectors.\n" }{MPLTEXT 1 0 7 " \+ \n" }{MPLTEXT 1 0 42 " Facecolors[jj3]:=array(0..brind-1):\n" } {MPLTEXT 1 0 6 " od;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 60 "Color:= cvrtarray(brind,nops(Knot),VALIDCOLORS,numVcolors);\n" }{MPLTEXT 1 0 28 "#Color[0]:=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 54 "#print(\"The number of valid colorings \",Color[0]);\n" }{MPLTEXT 1 0 38 "#print(\"about to enter sst loop\");\n" }{MPLTEXT 1 0 38 "# f or i from 1 to VALIDCOLORS[0] do\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 82 "for i from 1 to numVcolors do for facecolors from 0 to (qu andleorder-1) do\n" }{MPLTEXT 1 0 82 " SST2contri:=0; \+ # State-sum contributions.\n" }{MPLTEXT 1 0 29 " SST3contri:=0; \n" }{MPLTEXT 1 0 57 " for precolor face from 1 to (nops(Knot)+1) do \n" }{MPLTEXT 1 0 11 " \n" } {MPLTEXT 1 0 54 " Facecolors[precolorface][0]:=facecolors: \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 13 " od;\n" }{MPLTEXT 1 0 46 " for nowcolor from 1 to nops(Knot) do\n" }{MPLTEXT 1 0 9 " \n" }{MPLTEXT 1 0 68 " for colcoloring from 0 to (a bs(Knot[nowcolor])-1) do \n" }{MPLTEXT 1 0 97 " Faceco lors[nowcolor][colcoloring+1]:=Quandle[Facecolors[nowcolor][colcolorin g],\n" }{MPLTEXT 1 0 90 " \+ Color[i][nowcolor][colcoloring+1]]:\n" }{MPLTEXT 1 0 8 " \+ \n" }{MPLTEXT 1 0 17 " od:\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 13 " od:\n" }{MPLTEXT 1 0 40 " for s from 1 to nops(Knot) do \n" }{MPLTEXT 1 0 34 " if Knot[s] > 0 th en\n" }{MPLTEXT 1 0 87 " SST3contri:= SST3contri + co3S olutions[Facecolors[s][abs(Knot[s])-1],\n" }{MPLTEXT 1 0 88 " \+ Color[i][s][abs(Knot[s])], Color[i][s][abs(Knot[s]) +1] ] :\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " else\n" }{MPLTEXT 1 0 85 " SST3contri:=SST3contri -co3Solutions [Facecolors[s][abs(Knot[s])-1],\n" }{MPLTEXT 1 0 92 " \+ Color[i][s+1][abs(Knot[s])], Color[i][s+1][abs(Knot[s])+1] \+ ] :\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " \+ fi: \n" }{MPLTEXT 1 0 75 " od: \+ # Closing the state-sum term, for s.\n" }{MPLTEXT 1 0 7 " \n" } {MPLTEXT 1 0 39 " \n" }{MPLTEXT 1 0 61 " SST3coc:=SST3coc + u^(Rem(SST3contri,Apolym,t) mod p);\n" } {MPLTEXT 1 0 15 " od: \n" }{MPLTEXT 1 0 49 " \+ #closes facecolors \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 37 " for s from 1 to nops(Knot) do \n" }{MPLTEXT 1 0 34 " \+ if Knot[s] > 0 then\n" }{MPLTEXT 1 0 144 " SST2cont ri:= SST2contri + co2Solutions[Color[i][s][abs(Knot[s])], \+ Color[i][s][abs(Knot[s])+1] ] :\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 18 " else\n" }{MPLTEXT 1 0 173 " \+ SST2contri:=SST2contri -co2Solutions[Color[i][s+1][abs(Knot[s]) ], Color[i][s+ 1][abs(Knot[s])+1] ] :\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 18 " fi: \n" }{MPLTEXT 1 0 14 " od: \n" }{MPLTEXT 1 0 107 " SST2coc:=SST2coc + u^(Rem(SST2contri,Apolym,t ) mod p); \n" }{MPLTEXT 1 0 100 "od: # Closing indx loop ( one color here at a time, for indx). \n" }{MPLTEXT 1 0 69 "return(SST2 coc,SST3coc,Color,co2Solutions,co3Solutions,numVcolors);\n" }{MPLTEXT 1 0 6 "else\n" }{MPLTEXT 1 0 30 "print(\"Invalid cocycles\");\n" } {MPLTEXT 1 0 9 "return;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 6 "en d:\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 204 414 "The procedure CalcMochi nvars() will run the procedure, Invar2_3MochizukiDLL:=proc(Quandle,p,K not), over the 2977 knots stored in the file knotsLivingston.txt. It w ill automatically generate filenames and write the data to the appropr iate file. All of the values that the 2-cocycle and 3-cocycle invarian ts take are written to the files, Z_pmod(polym)2cocinvn_b.inv or Z_2mo d(polym)3cocinvm1_m2_a3.inv. For example," }}{PARA 0 "" 0 "" {TEXT 204 133 " the values for the Mochizuki 2 cocycle invariants with Mochi zuki 2-cocycle formula f(x,y)=(x-y)^2^(1) * y^0 and Alexander quandle \+ \n" }{TEXT 204 564 "Z_2 [t,t^-1]/(t^6+t^3+1) would be stored in the f ile Z_2mod(t^6+t^3+1)2cocinv1_0.inv. This file is saved in the directo ry specified by the string PATH that is specified by the user. The val ues the Mochizuki formula give are stored in the file coc2SolnsZ_pmod( polym)_n_b.sol or coc3SolnsZ_pmod(polym)_m1_m2_a3.sol. The valid color ings of a given braid with knot number Kx_y are stored in the file, Co lorsZ_pmod(polym)Kx_y.clr. numberofknots is how far through the table \+ table you wish to calculate. For example, numberofknots=83 will calcul ate through 9 crossings." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "CalcMochinvars:=proc(filePATH,p ,polym,m1,m2,a3,n,b,numberofknots)\n" }{MPLTEXT 1 0 40 "#,\{cpath:=false\},\{solpath:=false\})\n" }{MPLTEXT 1 0 64 "local i,HH,tmpfilename1,tmpfilename2,tmpfilename3,tmpf1,tmpf2 ,\n" }{MPLTEXT 1 0 78 " tmpf3,INVARS,quandleorder,tmpfilename4,tm pfilename5,tmpf4,tmpf5,brind,\n" }{MPLTEXT 1 0 100 " tmpColorstr, x,y,z,tmpco2str,tmpco3str,bstrand,crossvec,colnum,JJ,writesolpath,cpat h,solpath;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 21 " cpath:=args[10];\n" }{MPLTEXT 1 0 23 " solpath:=args[11];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 27 " HH:=ssystem(date):HH[2];\n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 102 "tmpfilename1:=cat(filePATH,\"Z_ \",p,\"mod(\",convert(polym,string),\")2cocinv\",n,\"_\",b,\".inv\"); \n" }{MPLTEXT 1 0 113 "tmpfilename2:=cat(filePATH,\"Z_\",p,\"mod(\",co nvert(polym,string),\")3cocinv\",m1,\"_\",m2,\"_\",a3,\".inv\");\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 57 "tmpfilename1:=StringTools[Remove ](ismult,tmpfilename1);\n" }{MPLTEXT 1 0 57 "tmpfilename2:=StringTools [Remove](ismult,tmpfilename2);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 24 "#if cpath<> false then\n " }{MPLTEXT 1 0 84 "# tmpfilename3:=cat(cpath,Colors,Z_,p,m,o,d,\"( \",convert(polym,string),\")\");\n" }{MPLTEXT 1 0 62 "# tmpfilename 3:=StringTools[Remove](ismult,tmpfilename3);\n" }{MPLTEXT 1 0 6 "#fi; \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 25 "if solpath<> false then\n" }{MPLTEXT 1 0 108 " tmpfilename4:=cat(solpath,\"coc2SolnsZ_\",p,\"m od(\",convert(polym,string),\")_\",n,\"_\",b,\".sol\");\n" }{MPLTEXT 1 0 120 " tmpfilename5:=cat(solpath,\"coc3SolnsZ_\",p,\"mod(\",conv ert(polym,string),\")_\",m1,\"_\",m2,\"_\",a3,\".sol\"); \n" }{MPLTEXT 1 0 61 " tmpfilename4:=StringTools[Remove](ismult,tmpfilename4);\n " }{MPLTEXT 1 0 61 " tmpfilename5:=StringTools[Remove](ismult,tmpfi lename5);\n" }{MPLTEXT 1 0 39 " tmpf4:=fopen(tmpfilename4,WRITE);\n " }{MPLTEXT 1 0 39 " tmpf5:=fopen(tmpfilename5,WRITE);\n" }{MPLTEXT 1 0 37 " printf(\"%s\\n\",tmpfilename4);\n" }{MPLTEXT 1 0 37 " \+ printf(\"%s\\n\",tmpfilename5);\n" }{MPLTEXT 1 0 87 " fprintf(tmpf4 ,\"#Mochizuki 2-cocycle solutions for the Alexander Quandle %s\\n\",\n " }{MPLTEXT 1 0 82 " cat(Z_,p,\"[t^1,t^-1]\",\"/\",\"(\", convert(polym,string),\")\"));\n" }{MPLTEXT 1 0 87 " fprintf(tmpf5, \"#Mochizuki 3-cocycle solutions for the Alexander Quandle %s\\n\",\n" }{MPLTEXT 1 0 82 " cat(Z_,p,\"[t^1,t^-1]\",\"/\",\"(\",c onvert(polym,string),\")\"));\n" }{MPLTEXT 1 0 79 " fprintf(tmpf4, \"#2-cocycle formula f(x,y)=(x-y)^%d^%d *y^%d \\n\",p,n,b);\n" } {MPLTEXT 1 0 100 " fprintf(tmpf5,\"#3-cocycle formula f(x,y,z)=(x-y )^%d^%d *(y-z)^%d^%d *z^%d\\n\",p,m1,p,m2,a3);\n" }{MPLTEXT 1 0 48 " \+ fprintf(tmpf4,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 48 " \+ fprintf(tmpf5,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 25 " wr itesolpath:=true;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 35 "tmpf1:= fopen(tmpfilename1,WRITE);\n" }{MPLTEXT 1 0 35 "tmpf2:=fopen(tmpfilena me2,WRITE);\n" }{MPLTEXT 1 0 37 "# tmpf3:=fopen(tmpfilename3,WRITE);\n " }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 33 "printf(\"%s\\n\",tmpfilename1); \n" }{MPLTEXT 1 0 33 "printf(\"%s\\n\",tmpfilename2);\n" }{MPLTEXT 1 0 34 "#printf(\"%s\\n\",tmpfilename3);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 80 " fprintf(tmpf1,\"#Mochizuki 2-cocycle invariants for \+ Alexander Quandles\\n\");\n" }{MPLTEXT 1 0 80 " fprintf(tmpf2,\"#Mochi zuki 3-cocycle invariants for Alexander Quandles\\n\");\n" }{MPLTEXT 1 0 76 " fprintf(tmpf1,\"#2-cocycle formula f(x,y)=(x-y)^%d^%d *y^%d \+ \\n\",p,n,b);\n" }{MPLTEXT 1 0 97 " fprintf(tmpf2,\"#3-cocycle formula f(x,y,z)=(x-y)^%d^%d *(y-z)^%d^%d *z^%d\\n\",p,m1,p,m2,a3);\n" } {MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 46 " fprintf(tmpf1,\"#Alexander Qua ndle %s\\n\",\n" }{MPLTEXT 1 0 83 " cat(Z_,p,\"[t^1,t^-1 ]\",\"/\",\"(\",convert(polym,string),\")\"));\n" }{MPLTEXT 1 0 46 " f printf(tmpf2,\"#Alexander Quandle %s\\n\",\n" }{MPLTEXT 1 0 83 " \+ cat(Z_,p,\"[t^1,t^-1]\",\"/\",\"(\",convert(polym,string),\") \"));\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 100 " #fprintf(tmpf3,\"Th e valid color vectors for the braids colored with the following quandl e\\n\");\n" }{MPLTEXT 1 0 112 " #fprintf(tmpf3,\"Alexander Quandle %s \\n\",cat(Z_,p,\"[t^1,t^-1]\",\"/\",\"(\",convert(polym,string),\")\") );\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 45 " fprintf(tmpf1,\"#Generated %s\\n\",HH[2]);\n" } {MPLTEXT 1 0 45 " fprintf(tmpf2,\"#Generated %s\\n\",HH[2]);\n" } {MPLTEXT 1 0 45 "#fprintf(tmpf3,\"#Generated %s\\n\",HH[2]);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 35 " for i from 0 to numberofknots do\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 "if Gcd(Knot[i,3],polym) mod p <>1 then\n" } {MPLTEXT 1 0 20 "JJ:=ssystem(date):\n" }{MPLTEXT 1 0 7 " \n" } {MPLTEXT 1 0 70 " INVARS:=Invar2_3MochizukiDLL(polym,polym,p,m1,m2,a3, n,b,Knot[i,2]):\n" }{MPLTEXT 1 0 44 " fprintf(tmpf1,\"%s\\t%s\\t \\n%s \\n\\n\",\n" }{MPLTEXT 1 0 89 " convert(Knot[i,1],string),conve rt(Knot[i,2],string),convert(INVARS[1],string));\n" }{MPLTEXT 1 0 44 " fprintf(tmpf2,\"%s\\t%s\\t \\n%s\\n\\n\",\n" }{MPLTEXT 1 0 89 " \+ convert(Knot[i,1],string),convert(Knot[i,2],string),convert(INVARS[2 ],string));\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 24 " if cpath<> fal se then\n" }{MPLTEXT 1 0 84 " tmpfilename3:=cat(cpath,\"ColorsZ_\" ,p,\"mod(\",convert(polym,string),\")\");\n" }{MPLTEXT 1 0 62 " tm pfilename3:=StringTools[Remove](ismult,tmpfilename3);\n" }{MPLTEXT 1 0 64 " tmpfilename3:=cat(tmpfilename3,\"K\",Knot[i,1],\".clr\");\n " }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 " tmpf3:=fopen(tmpfilename 3,WRITE);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 106 " fprintf(tmp f3,\"#The valid color vectors for the braids colored with the Alexande r quandle %s\\n\",\n" }{MPLTEXT 1 0 84 " cat(Z_,p,\"[t^ 1,t^-1]\",\"/\",\"(\",convert(polym,string),\")\"));\n" }{MPLTEXT 1 0 44 "fprintf(tmpf3,\"#Generated %s\\n\",JJ[2]);\n" }{MPLTEXT 1 0 107 " \+ tmpColorstr:=cat(Col,convert(Knot[i,1],string),cat(Z_,p,\"mod\",\" (\",convert(polym,string),\")\"));\n" }{MPLTEXT 1 0 62 " fprintf(t mpf3,\"%s[0]:=%d;\\n\",tmpColorstr,INVARS[6]);\n" }{MPLTEXT 1 0 50 " \+ brind:=max(op(map(x->abs(x),Knot[i,2])))+1;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 " for colnum from 1 to INVARS[6] do\n" }{MPLTEXT 1 0 54 " for crossvec from 1 to nops(Knot[i,2])+1 do\n" } {MPLTEXT 1 0 45 " for bstrand from 1 to brind do\n" } {MPLTEXT 1 0 88 " fprintf(tmpf3,\"%s[%d][%d][%d]:=%d; \\n\",tmpColorstr,colnum,crossvec,\n" }{MPLTEXT 1 0 92 " \+ bstrand,INVARS[3][colnum][crossvec][bstr and]);\n" }{MPLTEXT 1 0 16 " od:od:od:\n" }{MPLTEXT 1 0 7 " \n " }{MPLTEXT 1 0 25 " JJ:=ssystem(date):\n" }{MPLTEXT 1 0 49 " \+ fprintf(tmpf3,\"#Generated %s\\n\",JJ[2]);\n" }{MPLTEXT 1 0 36 " f printf(tmpf3,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 5 " \n" }{MPLTEXT 1 0 21 " fclose(tmpf3);\n" }{MPLTEXT 1 0 82 " # tmpfilename3:=cat(cpat h,Colors,Z_,p,m,o,d,\"(\",convert(polym,string),\")\");\n" }{MPLTEXT 1 0 62 " # tmpfilename3:=StringTools[Remove](ismult,tmpfilename3);\n " }{MPLTEXT 1 0 43 "fi; # closes if cpath write color file\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 31 " if writesolpath<> false then\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 85 " tmpco2str:=cat(co2Z_,p,m,o ,d,\"(\",convert(polym,string),\")\",2,cocSol,n,_,b);\n" }{MPLTEXT 1 0 92 " tmpco3str:=cat(co3Z_,p,m,o,d,\"(\",convert(polym,string),\") \",3,cocSol,m1,_,m2,_,a3);\n" }{MPLTEXT 1 0 54 " quandleorder:=quan dlesize(AlexQuandle(polym,p));\n" }{MPLTEXT 1 0 39 " for x from 0 t o quandleorder-1 do\n" }{MPLTEXT 1 0 42 " for y from 0 to quandl eorder-1 do\n" }{MPLTEXT 1 0 45 " for z from 0 to quandleorde r-1 do\n" }{MPLTEXT 1 0 105 " fprintf(tmpf5,\"%s[%d,%d,%d ]:=%s;\\n\",tmpco3str,x,y,z,convert(INVARS[5][x,y,z],string));\n" } {MPLTEXT 1 0 15 " od;\n" }{MPLTEXT 1 0 94 " fprintf( tmpf4,\"%s[%d,%d]:=%s;\\n\",tmpco2str,x,y,convert(INVARS[4][x,y],strin g));\n" }{MPLTEXT 1 0 12 " od:od:\n" }{MPLTEXT 1 0 30 " JJ:=ssys tem(date):JJ[2];\n" }{MPLTEXT 1 0 48 " fprintf(tmpf4,\"#Generated % s\\n\",JJ[2]);\n" }{MPLTEXT 1 0 48 " fprintf(tmpf5,\"#Generated %s \\n\",JJ[2]);\n" }{MPLTEXT 1 0 35 " fprintf(tmpf4,\"\\n\\n\\n\");\n " }{MPLTEXT 1 0 35 " fprintf(tmpf5,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 20 " fclose(tmpf4);\n" }{MPLTEXT 1 0 20 " fclose(tmpf5);\n" } {MPLTEXT 1 0 26 " writesolpath:=false;\n" }{MPLTEXT 1 0 27 " fi;#cl oses solpath write\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 47 "fi; #closes if gcd Alexander po lynomial test\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 32 "print(\"finished all knots\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 27 " HH:= ssystem(date):HH[2];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 45 " fprin tf(tmpf1,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 45 " fprintf(tm pf2,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 17 " fclose(tmpf1);\n" }{MPLTEXT 1 0 17 " fclo se(tmpf2);\n" }{MPLTEXT 1 0 18 " #fclose(tmpf3);\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "Invar2MochizukiDLL:=proc(Xpolym,Apolym,p,n1,b2, Knot)\n" }{MPLTEXT 1 0 55 "#Procedure to calculate the state sum term \+ for a knot\n" }{MPLTEXT 1 0 76 "#Input: (1) Xpolym is the polynomial f rom the Alexander quandle that will \n" }{MPLTEXT 1 0 40 "# \+ be used to color the knot.\n" }{MPLTEXT 1 0 71 "# (2) Apolym is \+ the polynomial from the alexander quandle that \n" }{MPLTEXT 1 0 43 "# is used for the coefficients.\n" }{MPLTEXT 1 0 41 "# \+ (3) prime, p, for the quandles.\n" }{MPLTEXT 1 0 104 "# (4) n1 i s the first exponent from the Mochizuki 3 cocycle formula f(x,y)=(x-y) ^(p^(n1)) * y^b2\n" }{MPLTEXT 1 0 105 "# (5) b2 is the second ex ponent from the Mochizuki 3 cocycle formula f(x,y)=(x-y)^(p^(n1)) * y^ b2\n" }{MPLTEXT 1 0 54 "# (6) A knot given in braid form (ex [1, 1,1]).\n" }{MPLTEXT 1 0 37 "#Output: The state sum of the knot.\n" } {MPLTEXT 1 0 18 "#Example Input: \n" }{MPLTEXT 1 0 20 "#Example Output : \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 80 "local SST2coc,SST3coc,SS T2contri,SST3contri,jj3,jj5,jj6,jj8,s,num,Color,brind,\n" }{MPLTEXT 1 0 64 " indx,ColDiffMatch0,ColorDiff0,Ginv,quandleorder, \n " }{MPLTEXT 1 0 56 " co2Solutions,co3Solutions,Facecolors,facecol ors,\n" }{MPLTEXT 1 0 62 " precolorface,nowcolor,colcoloring,Quan dle,VALIDCOLORS,\n" }{MPLTEXT 1 0 60 " QuandleC,KnotC,x,y,i,valid 2coc,valid3coc,numVcolors;\n" }{MPLTEXT 1 0 13 "SST2coc:=0;\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 "VALIDCOLORS:=[];\n" }{MPLTEXT 1 0 19 "valid2coc:=false;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "co2S olutions:=[];\n" }{MPLTEXT 1 0 28 "#print(\"Program start\");\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 96 "#The follow ing will create the Cayley table for the Alexander Quandle where the e lements come \n" }{MPLTEXT 1 0 26 "#from the set \{0..n-1\}\n" } {MPLTEXT 1 0 33 "Quandle:=AlexQuandle(Xpolym,p);\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 37 "quandleorder:=quandlesize(Quandle);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 36 "#print(\"Generated the quandle\");\n" } {MPLTEXT 1 0 93 "# The following statement will use Mochizuki formula \+ to get the values for each term of the\n" }{MPLTEXT 1 0 99 " #cocycle. The indices of the array come from \{0..n-1\} and represent elements \+ of the Alexander \n" }{MPLTEXT 1 0 101 "#quandle X. The values of thes e elements lie in A=Z_p[t^(+-1)/(Apolym) and are in polynomial #form. \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 53 "co2Solutions:=Mochizuki2coc(Xpolym,Apolym,p,n1,b2);\n " }{MPLTEXT 1 0 32 "#print(\"finished cocycles\");\n" }{MPLTEXT 1 0 35 "if type(co2Solutions,table) then\n" }{MPLTEXT 1 0 59 " valid2coc :=cocycle2check(co2Solutions,Xpolym,Apolym,p);\n" }{MPLTEXT 1 0 5 "fi; \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 83 "#print(\"The value of co3ch eck is \",cocycle3check(coSolutions,Xpolym,Apolym,p));\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "if valid2coc then\n" }{MPLTEXT 1 0 40 "brin d:=max(op(map(x->abs(x),Knot)))+1;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "#################\n" }{MPLTEXT 1 0 16 "nu mVcolors:=0;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 20 "############### ###\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 29 "#print(\"brind is\",brin d);\n" }{MPLTEXT 1 0 65 "QuandleC:=Array(op(Quandle),datatype=integer[ 2],order=C_order):\n" }{MPLTEXT 1 0 30 "#print(\"finish QuandleC\");\n " }{MPLTEXT 1 0 73 "KnotC:=Array(0..(nops(Knot)-1),Knot,datatype=integ er[2],order=C_order):\n" }{MPLTEXT 1 0 27 "#print(\"finish Knotc\");\n " }{MPLTEXT 1 0 68 "VALIDCOLORS:=Array(0..10000000,datatype=integer[2] ,order=C_order):\n" }{MPLTEXT 1 0 33 "#print(\"finish VALIDCOLORS\"); \n" }{MPLTEXT 1 0 90 "numVcolors:=validColorVectors(QuandleC,quandleor der,KnotC,brind,nops(Knot),VALIDCOLORS):\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 40 "#print(\"numVcolors is \",numVcolors);\n" }{MPLTEXT 1 0 79 "#validColorVectors(QuandleC,quandleorder,KnotC,brind,nops(Knot ),VALIDCOLORS):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 23 "Color[0]:=nu mVcolors;\n" }{MPLTEXT 1 0 28 "#Color[0]:=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 28 "#print(\"finish colors\"):\n" }{MPLTEXT 1 0 36 "#for x from 1 to VALIDCOLORS[0] do\n" }{MPLTEXT 1 0 31 "for x from 1 to numVcolors \+ do\n" }{MPLTEXT 1 0 35 " for y from 1 to nops(Knot)+1 do\n" }{MPLTEXT 1 0 38 " Color[x][y]:=array(1..brind,[]):\n" }{MPLTEXT 1 0 7 " od :\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 60 "Color:=cv rtarray(brind,nops(Knot),VALIDCOLORS,numVcolors);\n" }{MPLTEXT 1 0 28 "#Color[0]:=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 54 " #print(\"The number of valid colorings \",Color[0]);\n" }{MPLTEXT 1 0 38 "#print(\"about to enter sst loop\");\n" }{MPLTEXT 1 0 38 "# for i from 1 to VALIDCOLORS[0] do\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 37 "for i from 1 to numVcolors do \n" }{MPLTEXT 1 0 6 " \n" } {MPLTEXT 1 0 81 " SST2contri:=0; \+ # State-sum contributions\n" }{MPLTEXT 1 0 37 " for s from 1 to n ops(Knot) do \n" }{MPLTEXT 1 0 34 " if Knot[s] > 0 then\n" }{MPLTEXT 1 0 114 " SST2contri:= SST2contri + co2Solut ions[Color[i][s][abs(Knot[s])],Color[i][s][abs(Knot[s])+1] ] :\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " else\n" }{MPLTEXT 1 0 116 " SST2contri:=SST2contri -co2Solutions[Color[i][s +1][abs(Knot[s])],Color[i][s+1][abs(Knot[s])+1] ] :\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " fi: \n" } {MPLTEXT 1 0 14 " od: \n" }{MPLTEXT 1 0 107 " SST2coc:=SST2 coc + u^(Rem(SST2contri,Apolym,t) mod p); \+ \n" }{MPLTEXT 1 0 100 "od: \+ # Closing indx loop (one color here at a time, for indx). \n " }{MPLTEXT 1 0 48 "return(SST2coc,Color,co2Solutions,numVcolors);\n" }{MPLTEXT 1 0 6 "else\n" }{MPLTEXT 1 0 30 "print(\"Invalid cocycles\") ;\n" }{MPLTEXT 1 0 15 "return false;\n" }{MPLTEXT 1 0 5 "fi;\n" } {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "Cal c2Mochinvars:=proc(filePATH,p ,polym,n,b,numberofknots)\n" }{MPLTEXT 1 0 40 "#,\{cpath:=false\},\{solpath:=false\})\n" }{MPLTEXT 1 0 64 "lo cal i,HH,tmpfilename1,tmpfilename2,tmpfilename3,tmpf1,tmpf2,\n" } {MPLTEXT 1 0 78 " tmpf3,INVARS,quandleorder,tmpfilename4,tmpfilen ame5,tmpf4,tmpf5,brind,\n" }{MPLTEXT 1 0 100 " tmpColorstr,x,y,z, tmpco2str,tmpco3str,bstrand,crossvec,colnum,JJ,writesolpath,cpath,solp ath;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 20 " \+ cpath:=args[7];\n" }{MPLTEXT 1 0 22 " solpath:=args[8];\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 27 " HH:=ssyst em(date):HH[2];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 102 "tmpfilename1:=cat(filePATH,\"Z_\",p,\"mod(\",convert (polym,string),\")2cocinv\",n,\"_\",b,\".inv\");\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 57 "tmpfilename1:=StringTools[Remove](ismult,tmpfile name1);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 24 "#if cpath<> false then\n" }{MPLTEXT 1 0 84 "# \+ tmpfilename3:=cat(cpath,Colors,Z_,p,m,o,d,\"(\",convert(polym,string) ,\")\");\n" }{MPLTEXT 1 0 62 "# tmpfilename3:=StringTools[Remove](i smult,tmpfilename3);\n" }{MPLTEXT 1 0 6 "#fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 25 "if solpath<> false then\n" }{MPLTEXT 1 0 108 " tm pfilename4:=cat(solpath,\"coc2SolnsZ_\",p,\"mod(\",convert(polym,strin g),\")_\",n,\"_\",b,\".sol\");\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 61 " tmpfilename4:=StringTools[Remove](ismult,tmpfilename4);\n" }{MPLTEXT 1 0 5 " \n" }{MPLTEXT 1 0 39 " tmpf4:=fopen(tmpfilenam e4,WRITE);\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 37 " printf(\" %s\\n\",tmpfilename4);\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 87 " \+ fprintf(tmpf4,\"#Mochizuki 2-cocycle solutions for the Alexander Qu andle %s\\n\",\n" }{MPLTEXT 1 0 82 " cat(Z_,p,\"[t^1,t^-1 ]\",\"/\",\"(\",convert(polym,string),\")\"));\n" }{MPLTEXT 1 0 6 " \+ \n" }{MPLTEXT 1 0 79 " fprintf(tmpf4,\"#2-cocycle formula f(x,y)=( x-y)^%d^%d *y^%d \\n\",p,n,b);\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 48 " fprintf(tmpf4,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 5 " \n" }{MPLTEXT 1 0 25 " writesolpath:=true;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 35 "tmpf1:=fopen(tmpfilename1,WRITE);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 33 "printf(\"%s \\n\",tmpfilename1);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 80 " fprintf(tmpf1,\"#Mochizuki 2-cocycle invariants for \+ Alexander Quandles\\n\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 76 " f printf(tmpf1,\"#2-cocycle formula f(x,y)=(x-y)^%d^%d *y^%d \\n\",p,n,b );\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 46 " f printf(tmpf1,\"#Alexander Quandle %s\\n\",\n" }{MPLTEXT 1 0 83 " \+ cat(Z_,p,\"[t^1,t^-1]\",\"/\",\"(\",convert(polym,string),\") \"));\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 100 " #fprintf(tmpf3,\"The valid color vectors for the braids colored with the following quandle\\n\");\n" }{MPLTEXT 1 0 112 " #fprintf(tmpf3,\" Alexander Quandle %s\\n\",cat(Z_,p,\"[t^1,t^-1]\",\"/\",\"(\",convert( polym,string),\")\"));\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 45 " fprintf(tmpf1,\"#Generated %s \\n\",HH[2]);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 35 " for i from 0 to numberofknots do\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 "if Gcd(Knot[i,3],polym) mod p <> 1 then\n" }{MPLTEXT 1 0 20 "JJ:=ssystem(date):\n" }{MPLTEXT 1 0 7 " \+ \n" }{MPLTEXT 1 0 59 " INVARS:=Invar2MochizukiDLL(polym,polym,p,n,b, Knot[i,2]):\n" }{MPLTEXT 1 0 44 " fprintf(tmpf1,\"%s\\t%s\\t \\n%s\\n \\n\",\n" }{MPLTEXT 1 0 89 " convert(Knot[i,1],string),convert( Knot[i,2],string),convert(INVARS[1],string));\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 24 " if cpath<> false then\n" }{MPLTEXT 1 0 84 " tmp filename3:=cat(cpath,\"ColorsZ_\",p,\"mod(\",convert(polym,string),\") \");\n" }{MPLTEXT 1 0 62 " tmpfilename3:=StringTools[Remove](ismul t,tmpfilename3);\n" }{MPLTEXT 1 0 64 " tmpfilename3:=cat(tmpfilena me3,\"K\",Knot[i,1],\".clr\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 " tmpf3:=fopen(tmpfilename3,WRITE);\n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 106 " fprintf(tmpf3,\"#The valid color vectors for th e braids colored with the Alexander quandle %s\\n\",\n" }{MPLTEXT 1 0 84 " cat(Z_,p,\"[t^1,t^-1]\",\"/\",\"(\",convert(polym, string),\")\"));\n" }{MPLTEXT 1 0 44 "fprintf(tmpf3,\"#Generated %s\\n \",JJ[2]);\n" }{MPLTEXT 1 0 107 " tmpColorstr:=cat(Col,convert(Kno t[i,1],string),cat(Z_,p,\"mod\",\"(\",convert(polym,string),\")\"));\n " }{MPLTEXT 1 0 62 " fprintf(tmpf3,\"%s[0]:=%d;\\n\",tmpColorstr,I NVARS[4]);\n" }{MPLTEXT 1 0 50 " brind:=max(op(map(x->abs(x),Knot[ i,2])))+1;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 " for colnum f rom 1 to INVARS[4] do\n" }{MPLTEXT 1 0 54 " for crossvec from \+ 1 to nops(Knot[i,2])+1 do\n" }{MPLTEXT 1 0 45 " for bstran d from 1 to brind do\n" }{MPLTEXT 1 0 88 " fprintf(tmp f3,\"%s[%d][%d][%d]:=%d;\\n\",tmpColorstr,colnum,crossvec,\n" } {MPLTEXT 1 0 92 " bstrand,I NVARS[2][colnum][crossvec][bstrand]);\n" }{MPLTEXT 1 0 16 " od:od: od:\n" }{MPLTEXT 1 0 7 " \n" }{MPLTEXT 1 0 25 " JJ:=ssystem(da te):\n" }{MPLTEXT 1 0 49 " fprintf(tmpf3,\"#Generated %s\\n\",JJ[2 ]);\n" }{MPLTEXT 1 0 36 " fprintf(tmpf3,\"\\n\\n\\n\");\n" } {MPLTEXT 1 0 5 " \n" }{MPLTEXT 1 0 21 " fclose(tmpf3);\n" } {MPLTEXT 1 0 80 "#tmpfilename3:=cat(cpath,Colors,Z_,p,m,o,d,\"(\",conv ert(polym,string),\")\");\n" }{MPLTEXT 1 0 62 "# tmpfilename3:=Stri ngTools[Remove](ismult,tmpfilename3);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 44 " fi; # closes if cpath write color file\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 31 " if writesolpath<> false then\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 85 " tmpco2str:=cat(co2Z_,p,m,o ,d,\"(\",convert(polym,string),\")\",2,cocSol,n,_,b);\n" }{MPLTEXT 1 0 5 " \n" }{MPLTEXT 1 0 54 " quandleorder:=quandlesize(AlexQuandl e(polym,p));\n" }{MPLTEXT 1 0 39 " for x from 0 to quandleorder-1 d o\n" }{MPLTEXT 1 0 42 " for y from 0 to quandleorder-1 do\n" } {MPLTEXT 1 0 12 " \n" }{MPLTEXT 1 0 94 " fprintf(tmp f4,\"%s[%d,%d]:=%s;\\n\",tmpco2str,x,y,convert(INVARS[3][x,y],string)) ;\n" }{MPLTEXT 1 0 12 " od:od:\n" }{MPLTEXT 1 0 30 " JJ:=ssystem (date):JJ[2];\n" }{MPLTEXT 1 0 48 " fprintf(tmpf4,\"#Generated %s \\n\",JJ[2]);\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 35 " fprint f(tmpf4,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 20 " fclose(tmpf4);\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 26 " w ritesolpath:=false;\n" }{MPLTEXT 1 0 27 " fi;#closes solpath write\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 47 "fi; #closes if gcd Alexander polynomial test\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 32 "print(\" finished all knots\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 27 " HH:=ssyst em(date):HH[2];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 45 " fprintf(tm pf1,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 17 " fclose(tmpf1);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "Inv ar3MochizukiDLL:=proc(Xpolym,Apolym,p,m1,m2,a3,Knot)\n" }{MPLTEXT 1 0 55 "#Procedure to calculate the state sum term for a knot\n" }{MPLTEXT 1 0 76 "#Input: (1) Xpolym is the polynomial from the Alexander quand le that will \n" }{MPLTEXT 1 0 40 "# be used to color the kn ot.\n" }{MPLTEXT 1 0 71 "# (2) Apolym is the polynomial from the alexander quandle that \n" }{MPLTEXT 1 0 43 "# is used for \+ the coefficients.\n" }{MPLTEXT 1 0 41 "# (3) prime, p, for the q uandles.\n" }{MPLTEXT 1 0 95 "# (4) From Mochizuki theorem a1=p^ m1,f(x,y,z)=(x-y)^(p^(m1)) * (y-z)^(p^(m2)) * z^(a3) \n" }{MPLTEXT 1 0 45 "# (5) From Mochizuki theorem a2=p^m2 \n" }{MPLTEXT 1 0 81 "# (6) From Mochizuki theorem a3=p^m3 or a3=0. So a3 must be a p ower of p \n" }{MPLTEXT 1 0 23 "# or zero.\n" }{MPLTEXT 1 0 54 "# (7) A knot given in braid form (ex [1,1,1]).\n" } {MPLTEXT 1 0 37 "#Output: The state sum of the knot.\n" }{MPLTEXT 1 0 67 "#Example Input: Invar3Mochizuki(t^2-t+1,t^2-t+1,5,0,1,0,[1,1,1]); \n" }{MPLTEXT 1 0 81 "#Example Output: 625+3750*u^(t+3)+3750*u^(4*t+2 )+3750*u^(3*t+4)+3750*u^(1+2*t)\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 80 "local SST2coc,SST3coc,SST2contri,SST3contri,jj3,jj5,jj6,jj8,s,num, Color,brind,\n" }{MPLTEXT 1 0 64 " indx,ColDiffMatch0,ColorDiff0, Ginv,quandleorder, \n" }{MPLTEXT 1 0 56 " co2Solutions,co3 Solutions,Facecolors,facecolors,\n" }{MPLTEXT 1 0 62 " precolorfa ce,nowcolor,colcoloring,Quandle,VALIDCOLORS,\n" }{MPLTEXT 1 0 60 " \+ QuandleC,KnotC,x,y,i,valid2coc,valid3coc,numVcolors;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 13 "SST3coc:=0;\n" }{MPLTEXT 1 0 18 "VALIDCOLOR S:=[];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "valid3coc:=false;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "co3Solutions:=[];\n" }{MPLTEXT 1 0 28 "#print(\"Program start\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 96 "#The following will create the Cayley tab le for the Alexander Quandle where the elements come \n" }{MPLTEXT 1 0 26 "#from the set \{0..n-1\}\n" }{MPLTEXT 1 0 33 "Quandle:=AlexQuand le(Xpolym,p);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 37 "quandleorder:= quandlesize(Quandle);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 36 "#print (\"Generated the quandle\");\n" }{MPLTEXT 1 0 93 "# The following stat ement will use Mochizuki formula to get the values for each term of th e\n" }{MPLTEXT 1 0 99 " #cocycle. The indices of the array come from \+ \{0..n-1\} and represent elements of the Alexander \n" }{MPLTEXT 1 0 101 "#quandle X. The values of these elements lie in A=Z_p[t^(+-1)/(Ap olym) and are in polynomial #form.\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 56 "co3Solutions:=Mochizuki3coc(Xpolym,Apolym ,p,m1,m2,a3);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 32 "#print(\"finis hed cocycles\");\n" }{MPLTEXT 1 0 34 "if type(co3Solutions,table) then \n" }{MPLTEXT 1 0 4 " \n" }{MPLTEXT 1 0 59 " valid3coc:=cocycle3chec k(co3Solutions,Xpolym,Apolym,p);\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 83 "#print(\"The value of co3check is \",cocy cle3check(coSolutions,Xpolym,Apolym,p));\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 19 "if valid3coc then\n" }{MPLTEXT 1 0 40 "brind:=max(op( map(x->abs(x),Knot)))+1;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 "#################\n" }{MPLTEXT 1 0 16 "numVcolors:=0 ;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 20 "##################\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 29 "#print(\"brind is\",brind);\n" } {MPLTEXT 1 0 65 "QuandleC:=Array(op(Quandle),datatype=integer[2],order =C_order):\n" }{MPLTEXT 1 0 30 "#print(\"finish QuandleC\");\n" } {MPLTEXT 1 0 73 "KnotC:=Array(0..(nops(Knot)-1),Knot,datatype=integer[ 2],order=C_order):\n" }{MPLTEXT 1 0 27 "#print(\"finish Knotc\");\n" } {MPLTEXT 1 0 68 "VALIDCOLORS:=Array(0..10000000,datatype=integer[2],or der=C_order):\n" }{MPLTEXT 1 0 33 "#print(\"finish VALIDCOLORS\");\n" }{MPLTEXT 1 0 90 "numVcolors:=validColorVectors(QuandleC,quandleorder, KnotC,brind,nops(Knot),VALIDCOLORS):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 "#print(\"numVcolors is \",numVcolors);\n" }{MPLTEXT 1 0 79 "# validColorVectors(QuandleC,quandleorder,KnotC,brind,nops(Knot),VALIDCO LORS):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 23 "Color[0]:=numVcolors; \n" }{MPLTEXT 1 0 28 "#Color[0]:=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 28 " #print(\"finish colors\"):\n" }{MPLTEXT 1 0 36 "#for x from 1 to VALID COLORS[0] do\n" }{MPLTEXT 1 0 31 "for x from 1 to numVcolors do\n" } {MPLTEXT 1 0 35 " for y from 1 to nops(Knot)+1 do\n" }{MPLTEXT 1 0 38 " Color[x][y]:=array(1..brind,[]):\n" }{MPLTEXT 1 0 7 " od:\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 69 "for jj3 from 1 to (nops(Knot)+1) do # \+ Color vectors.\n" }{MPLTEXT 1 0 7 " \n" }{MPLTEXT 1 0 42 " Fac ecolors[jj3]:=array(0..brind-1):\n" }{MPLTEXT 1 0 6 " od;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 60 "Color:=cvrtarray(brind,nops(Knot),VALIDC OLORS,numVcolors);\n" }{MPLTEXT 1 0 28 "#Color[0]:=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 54 "#print(\"The number of valid co lorings \",Color[0]);\n" }{MPLTEXT 1 0 38 "#print(\"about to enter sst loop\");\n" }{MPLTEXT 1 0 38 "# for i from 1 to VALIDCOLORS[0] do\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 36 "for i from 1 to numVcolors do \+ \n" }{MPLTEXT 1 0 48 " for facecolors from 0 to (quandleorder-1) \+ do\n" }{MPLTEXT 1 0 67 " # State -sum contributions.\n" }{MPLTEXT 1 0 29 " SST3contri:=0; \n " }{MPLTEXT 1 0 57 " for precolorface from 1 to (nops(Knot)+1) do \n" }{MPLTEXT 1 0 11 " \n" }{MPLTEXT 1 0 54 " \+ Facecolors[precolorface][0]:=facecolors:\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 13 " od;\n" }{MPLTEXT 1 0 46 " for nowcolor from 1 to nops(Knot) do\n" }{MPLTEXT 1 0 9 " \n" }{MPLTEXT 1 0 68 " for colcoloring from 0 to (abs(Knot[nowcolor])-1) do \+ \n" }{MPLTEXT 1 0 97 " Facecolors[nowcolor][colcoloring +1]:=Quandle[Facecolors[nowcolor][colcoloring],\n" }{MPLTEXT 1 0 90 " \+ Color[i][nowcolor] [colcoloring+1]]:\n" }{MPLTEXT 1 0 8 " \n" }{MPLTEXT 1 0 17 " \+ od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 13 " od:\n" } {MPLTEXT 1 0 40 " for s from 1 to nops(Knot) do \n" }{MPLTEXT 1 0 34 " if Knot[s] > 0 then\n" }{MPLTEXT 1 0 87 " \+ SST3contri:= SST3contri + co3Solutions[Facecolors[s][abs(Knot[ s])-1],\n" }{MPLTEXT 1 0 88 " Color[i][s][a bs(Knot[s])], Color[i][s][abs(Knot[s])+1] ] :\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " else\n" }{MPLTEXT 1 0 85 " \+ SST3contri:=SST3contri -co3Solutions[Facecolors[s][abs(Knot[s])-1], \n" }{MPLTEXT 1 0 92 " Color[i][s+1][abs(Kn ot[s])], Color[i][s+1][abs(Knot[s])+1] ] :\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 " fi: \n" }{MPLTEXT 1 0 75 " od: # Closing the state-sum ter m, for s.\n" }{MPLTEXT 1 0 7 " \n" }{MPLTEXT 1 0 39 " \+ \n" }{MPLTEXT 1 0 61 " SST3coc:=SST3coc + \+ u^(Rem(SST3contri,Apolym,t) mod p);\n" }{MPLTEXT 1 0 15 " od: \+ \n" }{MPLTEXT 1 0 49 " #closes facecolors \+ \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 49 " \+ \n" }{MPLTEXT 1 0 100 "od: \+ # Closing indx loop (one color here at a time, for indx). \n" }{MPLTEXT 1 0 48 "return(SST3coc,Color,co3Solutions,numVcolors); \n" }{MPLTEXT 1 0 6 "else\n" }{MPLTEXT 1 0 30 "print(\"Invalid cocycle s\");\n" }{MPLTEXT 1 0 15 "return false;\n" }{MPLTEXT 1 0 5 "fi;\n" } {MPLTEXT 1 0 6 "end:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "C alc3Mochinvars:=proc(filePATH,p ,polym,m1,m2,a3,numberofknots)\n" } {MPLTEXT 1 0 40 "#,\{cpath:=false\},\{solpath:=false\})\n" }{MPLTEXT 1 0 64 "local i,HH,tmpfilename1,tmpfilename2,tmpfilename3,tmpf1,tmpf2, \n" }{MPLTEXT 1 0 78 " tmpf3,INVARS,quandleorder,tmpfilename4,tmp filename5,tmpf4,tmpf5,brind,\n" }{MPLTEXT 1 0 100 " tmpColorstr,x ,y,z,tmpco2str,tmpco3str,bstrand,crossvec,colnum,JJ,writesolpath,cpath ,solpath;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 20 " cpath:=args[8];\n" }{MPLTEXT 1 0 22 " solpath:=args[9];\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 27 " HH:=ssyst em(date):HH[2];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 113 "tmpfilename2:=cat(filePATH,\"Z_ \",p,\"mod(\",convert(polym,string),\")3cocinv\",m1,\"_\",m2,\"_\",a3, \".inv\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 57 "tmpfilename2:=StringTools[Remove](ismult,tmpfilename2);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 24 "#if cpath<> false then\n" }{MPLTEXT 1 0 84 "# tmpf ilename3:=cat(cpath,Colors,Z_,p,m,o,d,\"(\",convert(polym,string),\") \");\n" }{MPLTEXT 1 0 62 "# tmpfilename3:=StringTools[Remove](ismul t,tmpfilename3);\n" }{MPLTEXT 1 0 6 "#fi;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 25 "if solpath<> false then\n" }{MPLTEXT 1 0 6 " \n" } {MPLTEXT 1 0 120 " tmpfilename5:=cat(solpath,\"coc3SolnsZ_\",p,\"mo d(\",convert(polym,string),\")_\",m1,\"_\",m2,\"_\",a3,\".sol\"); \n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 61 " tmpfilename5:=StringToo ls[Remove](ismult,tmpfilename5);\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 39 " tmpf5:=fopen(tmpfilename5,WRITE);\n" }{MPLTEXT 1 0 5 " \+ \n" }{MPLTEXT 1 0 37 " printf(\"%s\\n\",tmpfilename5);\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 87 " fprintf(tmpf5,\"#Mochizuki 3-coc ycle solutions for the Alexander Quandle %s\\n\",\n" }{MPLTEXT 1 0 82 " cat(Z_,p,\"[t^1,t^-1]\",\"/\",\"(\",convert(polym,strin g),\")\"));\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 100 " fprintf (tmpf5,\"#3-cocycle formula f(x,y,z)=(x-y)^%d^%d *(y-z)^%d^%d *z^%d\\n \",p,m1,p,m2,a3);\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 48 " fp rintf(tmpf5,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 25 " writ esolpath:=true;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 35 "tmpf2:=fopen(tmpfilename2,WRITE);\n" }{MPLTEXT 1 0 37 "# tmpf3:=fopen(tmpfilename3,WRITE);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 33 "printf(\"%s\\n\",tmpfilename2); \n" }{MPLTEXT 1 0 34 "#printf(\"%s\\n\",tmpfilename3);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \+ \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 80 " fprintf(tmpf2,\"#Mochizuki 3-cocycle invariants for Alexander Quandles\\n\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 97 " fprintf(tmpf2,\"#3-cocycle formula f(x,y,z)= (x-y)^%d^%d *(y-z)^%d^%d *z^%d\\n\",p,m1,p,m2,a3);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 46 " fprintf(tmpf2,\"#Alexand er Quandle %s\\n\",\n" }{MPLTEXT 1 0 83 " cat(Z_,p,\"[t^ 1,t^-1]\",\"/\",\"(\",convert(polym,string),\")\"));\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 100 " #fprintf(tmpf3,\"The valid color vectors f or the braids colored with the following quandle\\n\");\n" }{MPLTEXT 1 0 112 " #fprintf(tmpf3,\"Alexander Quandle %s\\n\",cat(Z_,p,\"[t^1,t ^-1]\",\"/\",\"(\",convert(polym,string),\")\"));\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 45 " fprintf(tmpf2,\"#Generated %s\\n\",HH[2]);\n" } {MPLTEXT 1 0 45 "#fprintf(tmpf3,\"#Generated %s\\n\",HH[2]);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 35 " for i from 0 to numberofknots do\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 "if Gcd(Knot[i,3],polym) mod p <>1 then\n" } {MPLTEXT 1 0 20 "JJ:=ssystem(date);\n" }{MPLTEXT 1 0 64 " INVARS:=Inva r3MochizukiDLL(polym,polym,p,m1,m2,a3,Knot[i,2]):\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 44 " fprintf(tmpf2,\"%s\\t%s\\t \\n%s\\n\\n\",\n" } {MPLTEXT 1 0 89 " convert(Knot[i,1],string),convert(Knot[i,2],s tring),convert(INVARS[1],string));\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 24 " if cpath<> false then\n" }{MPLTEXT 1 0 84 " tmpfilename3: =cat(cpath,\"ColorsZ_\",p,\"mod(\",convert(polym,string),\")\");\n" } {MPLTEXT 1 0 62 " tmpfilename3:=StringTools[Remove](ismult,tmpfile name3);\n" }{MPLTEXT 1 0 64 " tmpfilename3:=cat(tmpfilename3,\"K\" ,Knot[i,1],\".clr\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 " t mpf3:=fopen(tmpfilename3,WRITE);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 106 " fprintf(tmpf3,\"#The valid color vectors for the braids co lored with the Alexander quandle %s\\n\",\n" }{MPLTEXT 1 0 84 " \+ cat(Z_,p,\"[t^1,t^-1]\",\"/\",\"(\",convert(polym,string),\") \"));\n" }{MPLTEXT 1 0 44 "fprintf(tmpf3,\"#Generated %s\\n\",JJ[2]); \n" }{MPLTEXT 1 0 107 " tmpColorstr:=cat(Col,convert(Knot[i,1],str ing),cat(Z_,p,\"mod\",\"(\",convert(polym,string),\")\"));\n" } {MPLTEXT 1 0 62 " fprintf(tmpf3,\"%s[0]:=%d;\\n\",tmpColorstr,INVA RS[4]);\n" }{MPLTEXT 1 0 50 " brind:=max(op(map(x->abs(x),Knot[i,2 ])))+1;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 40 " for colnum from 1 to INVARS[4] do\n" }{MPLTEXT 1 0 54 " for crossvec from 1 t o nops(Knot[i,2])+1 do\n" }{MPLTEXT 1 0 45 " for bstrand f rom 1 to brind do\n" }{MPLTEXT 1 0 88 " fprintf(tmpf3, \"%s[%d][%d][%d]:=%d;\\n\",tmpColorstr,colnum,crossvec,\n" }{MPLTEXT 1 0 92 " bstrand,INVARS[2][ colnum][crossvec][bstrand]);\n" }{MPLTEXT 1 0 16 " od:od:od:\n" } {MPLTEXT 1 0 7 " \n" }{MPLTEXT 1 0 25 " JJ:=ssystem(date):\n" }{MPLTEXT 1 0 49 " fprintf(tmpf3,\"#Generated %s\\n\",JJ[2]);\n" } {MPLTEXT 1 0 36 " fprintf(tmpf3,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 5 " \n" }{MPLTEXT 1 0 21 " fclose(tmpf3);\n" }{MPLTEXT 1 0 2 "\n " }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 44 " fi; # closes if cpath wri te color file\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 31 " if writesolpa th<> false then\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 6 " \n" } {MPLTEXT 1 0 92 " tmpco3str:=cat(co3Z_,p,m,o,d,\"(\",convert(polym, string),\")\",3,cocSol,m1,_,m2,_,a3);\n" }{MPLTEXT 1 0 54 " quandle order:=quandlesize(AlexQuandle(polym,p));\n" }{MPLTEXT 1 0 39 " for x from 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 42 " for y from \+ 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 45 " for z from 0 to \+ quandleorder-1 do\n" }{MPLTEXT 1 0 105 " fprintf(tmpf5,\" %s[%d,%d,%d]:=%s;\\n\",tmpco3str,x,y,z,convert(INVARS[3][x,y,z],string ));\n" }{MPLTEXT 1 0 15 " od;\n" }{MPLTEXT 1 0 12 " \+ \n" }{MPLTEXT 1 0 12 " od:od:\n" }{MPLTEXT 1 0 30 " JJ:=ssystem( date):JJ[2];\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 48 " fprintf (tmpf5,\"#Generated %s\\n\",JJ[2]);\n" }{MPLTEXT 1 0 5 " \n" } {MPLTEXT 1 0 35 " fprintf(tmpf5,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 6 " \n" }{MPLTEXT 1 0 20 " fclose(tmpf5);\n" }{MPLTEXT 1 0 26 " \+ writesolpath:=false;\n" }{MPLTEXT 1 0 27 " fi;#closes solpath write\n " }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 47 "fi; #closes if gcd Alexander polynomial test\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 32 "print(\" finished all knots\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 27 " HH:=ssyst em(date):HH[2];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 45 " fprintf(tmpf2,\"#Generated %s\\n\",HH[2]);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 17 " fclose(tm pf2);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n " }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 200 115 "ismu lt() is used in the procedure CalcMochinvars() to remove the character '*' from the filename that is generated." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "ismult:=proc(charstar)\n" }{MPLTEXT 1 0 24 "if chars tar=\"*\" then\n" }{MPLTEXT 1 0 16 " return true;\n" }{MPLTEXT 1 0 6 "else\n" }{MPLTEXT 1 0 15 "return false;\n" }{MPLTEXT 1 0 5 "fi;\n" } {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 200 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "CalcDihinvars:=proc(filePATH,p,numberofKnots)\n" } {MPLTEXT 1 0 40 "#,\{cpath:=false\},\{solpath:=false\})\n" }{MPLTEXT 1 0 110 "local i,HH,tmpfilename1,tmpf1,Mcocycles,INVAR,polym,tmpfilena me2,tmpfilename3,tmpf3,tmpf2,x,y,z,tmpColorstr,\n" }{MPLTEXT 1 0 91 " \+ brind,colnum,crossvec,bstrand,quandleorder,tmpco3str,JJ,writesolp ath,cpath,solpath;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 20 " cpath:=args[4];\n" }{MPLTEXT 1 0 22 " solpath:=a rgs[5];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 16 "Mcocycles:=[];\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 14 " polym:=t+1;\n" }{MPLTEXT 1 0 39 " Mcocycles:=MochizukiDihedral3coc(p);\n" }{MPLTEXT 1 0 26 "HH:=ssy stem(date):HH[2];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 72 "tmpfilena me1:=cat(filePATH,\"MochDih_R_\",p,\"3coc_inZ_\",p,\".inv\");\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 24 "#if cpath<> false then\n" } {MPLTEXT 1 0 3 "#\n" }{MPLTEXT 1 0 49 "# tmpfilename3:=cat(cpath,Col orsDih,_,R,_,p);\n" }{MPLTEXT 1 0 6 "#fi;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 25 "if solpath<> false then\n" }{MPLTEXT 1 0 67 " tmpfi lename2:=cat(solpath,\"MochDih3cocSOL_inZ_\",p,\".sol\");\n" }{MPLTEXT 1 0 38 " tmpf2:=fopen(tmpfilename2,WRITE);\n" }{MPLTEXT 1 0 91 " \+ fprintf(tmpf2,\"#Mochizuki 3-cocycle solutions for the Dihedral Quandl e R_%d \\n\",p);\n" }{MPLTEXT 1 0 119 " fprintf(tmpf2,\"#3-cocycle f ormula in Z_%d is f(x,y,z)=(x-y)[(2z^%d -j^%d)-(2z-y)^%d]/%d mod %d\\n \",p,p,p,p,p,p);\n" }{MPLTEXT 1 0 36 " printf(\"%s\\n\",tmpfilename2 );\n" }{MPLTEXT 1 0 24 " writesolpath:=true;\n" }{MPLTEXT 1 0 5 "fi; \n" }{MPLTEXT 1 0 33 "printf(\"%s\\n\",tmpfilename1);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 35 "tmpf1:=fopen(tmpfilename1,WRITE);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 89 "fprintf(tmpf1,\"#Mochizuki 3-cocycle invariants for t he Dihedral Quandle R_%d \\n\",p);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 116 "fprintf(tmpf1,\"#3-cocycle formula in Z_%d is f(x,y,z)=(x-y)[ (2z^%d -j^%d)-(2z-y)^%d]/%d mod %d\\n\",p,p,p,p,p,p);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n " }{MPLTEXT 1 0 44 "fprintf(tmpf1,\"#Generated %s\\n\",HH[2]);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 31 "#print(\"be fore knot loop\");\n" }{MPLTEXT 1 0 35 "for i from 0 to numberofKnots do\n" }{MPLTEXT 1 0 26 "JJ:=ssystem(date):JJ[2];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 77 " INVAR:=Invar3Untwiste dDLL(AlexQuandle(polym,p),p,Knot[i,2],Mcocycles);\n" }{MPLTEXT 1 0 125 " fprintf(tmpf1,\"%s\\t%s\\t\\n%s\\n\\n\",convert(Knot[i,1],st ring),convert(Knot[i,2],string),convert(INVAR[1],string));\n" } {MPLTEXT 1 0 7 " \n" }{MPLTEXT 1 0 27 " if cpath<>false then\n " }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 54 " tmpfilename3:=cat(cp ath,\"ColorDih_R_\",p);\n" }{MPLTEXT 1 0 68 " tmpfilename3:=ca t(tmpfilename3,\"K\",Knot[i,1],\".clr\");\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 35 "tmpf3:=fopen(tmpfilename3,WRITE);\n" }{MPLTEXT 1 0 7 " \n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 105 " fprintf(tm pf3,\"#The valid color vectors for the braids colored with the quandle R_%d\\n\",p);\n" }{MPLTEXT 1 0 39 " #print(\"opened clr file \");\n" }{MPLTEXT 1 0 44 "fprintf(tmpf3,\"#Generated %s\\n\",JJ[2]);\n " }{MPLTEXT 1 0 65 " tmpColorstr:=cat(Col,convert(Knot[i,1],st ring),R,_,p);\n" }{MPLTEXT 1 0 65 " fprintf(tmpf3,\"%s[0]:=%d; \\n\",tmpColorstr,INVAR[4]);\n" }{MPLTEXT 1 0 54 " brind:=max( op(map(x->abs(x),Knot[i,2])))+1;\n" }{MPLTEXT 1 0 64 " #print( \"just wrote the number of colors\",INVAR[4]);\n" }{MPLTEXT 1 0 43 " \+ for colnum from 1 to INVAR[4] do\n" }{MPLTEXT 1 0 58 " \+ for crossvec from 1 to nops(Knot[i,2])+1 do\n" }{MPLTEXT 1 0 49 " \+ for bstrand from 1 to brind do\n" }{MPLTEXT 1 0 92 " \+ fprintf(tmpf3,\"%s[%d][%d][%d]:=%d;\\n\",tmpColorst r,colnum,crossvec,\n" }{MPLTEXT 1 0 91 " \+ bstrand,INVAR[2][colnum][crossvec][bstrand]);\n" } {MPLTEXT 1 0 20 " od:od:od:\n" }{MPLTEXT 1 0 10 " \n" } {MPLTEXT 1 0 28 " JJ:=ssystem(date);\n" }{MPLTEXT 1 0 52 " \+ fprintf(tmpf3,\"#Generated %s\\n\",JJ[2]);\n" }{MPLTEXT 1 0 39 " \+ fprintf(tmpf3,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 23 " fclose( tmpf3);\n" }{MPLTEXT 1 0 47 " #tmpfilename3:=cat(cpath,ColorsDih,_,R,_ ,p);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 30 " fi; #end if cpath \+ write\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 34 " \+ if writesolpath<> false then\n" }{MPLTEXT 1 0 44 " tmpco3str: =cat(co3MochDihZ_,p,Sol);\n" }{MPLTEXT 1 0 25 " quandleorder:=p; \n" }{MPLTEXT 1 0 42 " for x from 0 to quandleorder-1 do\n" } {MPLTEXT 1 0 46 " for y from 0 to quandleorder-1 do\n" } {MPLTEXT 1 0 49 " for z from 0 to quandleorder-1 do\n" } {MPLTEXT 1 0 107 " fprintf(tmpf2,\"%s[%d,%d,%d]:=%s; \\n\",tmpco3str,x,y,z,convert(INVAR[3][x,y,z],string));\n" }{MPLTEXT 1 0 19 " od;\n" }{MPLTEXT 1 0 16 " od;\n" } {MPLTEXT 1 0 13 " od;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 38 " fprintf(tmpf2,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 27 " JJ:= ssystem(date);\n" }{MPLTEXT 1 0 51 " fprintf(tmpf2,\"#Generated \+ %s\\n\",JJ[2]);\n" }{MPLTEXT 1 0 23 " fclose(tmpf2);\n" } {MPLTEXT 1 0 29 " writesolpath:=false;\n" }{MPLTEXT 1 0 10 " \+ fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 6 " od :\n" }{MPLTEXT 1 0 32 "print(\"finished all knots\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n " }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 26 "HH:=ssystem(date):HH[2];\n" } {MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 44 "fprintf(tmpf1,\"#Generated %s \\n\",HH[2]);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 17 " fclose(tmpf1) ;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 6 "end:\n " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 200 30 "The twisted solution procedure" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 200 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "co2T wistedSol:=proc(Quandle,polym,m::posint)\n" }{MPLTEXT 1 0 54 "local x, y,z,i,EQ,f,F,vars,A,quanod,E,Sol,Sol_list,j,\n" }{MPLTEXT 1 0 52 " \+ temp, deg,Cof,testsol,ttemp,TempPoly,TempEq,\n" }{MPLTEXT 1 0 30 " \+ TempList,k,LL,GG,b,ss;\n" }{MPLTEXT 1 0 18 "option remember;\n" } {MPLTEXT 1 0 10 "Cof:=[];\n" }{MPLTEXT 1 0 31 "if type(polym,polynom) \+ then \n" }{MPLTEXT 1 0 26 " deg:=degree(polym,t);\n" }{MPLTEXT 1 0 7 "else \n" }{MPLTEXT 1 0 29 " printf(\"%s\\n\",ERROR);\n" }{MPLTEXT 1 0 12 " return;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 21 "Cof:= coeffs(polym);\n" }{MPLTEXT 1 0 55 "if gcd(Cof[1],m)<>1 and gcd(Cof[no ps(Cof)],m)<>1 then\n" }{MPLTEXT 1 0 49 " printf(\"%s\",\"ERROR: Not \+ a finite ring.\");\n" }{MPLTEXT 1 0 11 " return;\n" }{MPLTEXT 1 0 6 " else\n" }{MPLTEXT 1 0 13 " continue;\n" }{MPLTEXT 1 0 5 "fi;\n" } {MPLTEXT 1 0 31 "quanod:=quandlesize(Quandle);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 47 "f:=array(0..quanod-1,0..quanod-1,0..(deg-1));\n" } {MPLTEXT 1 0 9 "EQ:=[];\n" }{MPLTEXT 1 0 29 "for i from 0 to quanod-1 \+ do\n" }{MPLTEXT 1 0 31 " for j from 0 to quanod-1 do\n" }{MPLTEXT 1 0 45 " F[i,j]:=sum(f[i,j,k]*t^k, k=0..deg-1);\n" }{MPLTEXT 1 0 8 " od:od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 31 " for x from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 34 " for y from 0 to \+ (quanod-1) do\n" }{MPLTEXT 1 0 37 " for z from 0 to (quanod-1) do \n" }{MPLTEXT 1 0 62 " TempEq[x,y,z]:=t*F[x,y]+F[Quandle[x,y], z]-t*F[x,z]\n" }{MPLTEXT 1 0 69 " -F[Quandle[x ,z],Quandle[y,z]]+(t-1)*F[y,z]:\n" }{MPLTEXT 1 0 65 " \+ # The equation for each (x,y,z).\n" }{MPLTEXT 1 0 54 " \+ TempPoly:=Rem(TempEq[x,y,z],polym,t) mod m;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 98 " # Mod ``polym'' \+ and mod m, so that the equation is formulated in \n" }{MPLTEXT 1 0 59 " # Z_m[t,t^(-1)]/(polym) . \n" } {MPLTEXT 1 0 104 " # The number m is a p rime (it's not clear if this works for non-prime).\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 66 " TempList:=PolynomialTools[CoefficientL ist](TempPoly,t);\n" }{MPLTEXT 1 0 93 " \+ # For each (x,y,z), this is the list of coefficients of t^k.\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 44 " for i from 1 to nops(Te mpList) do\n" }{MPLTEXT 1 0 41 " E[x,y,z,i-1]:=TempList[i] ;\n" }{MPLTEXT 1 0 43 " EQ:=[op(EQ),E[x,y,z,i-1]=0];\n" } {MPLTEXT 1 0 14 " od;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 11 " od:\n" }{MPLTEXT 1 0 8 " od:\n" }{MPLTEXT 1 0 5 "od:\n" } {MPLTEXT 1 0 9 "#7/1/04\n" }{MPLTEXT 1 0 54 "#will add Reid. type I mo ve to the list of equations\n" }{MPLTEXT 1 0 31 "for i from 0 to (quan od-1) do\n" }{MPLTEXT 1 0 30 " for j from 0 to (deg-1) do\n" } {MPLTEXT 1 0 31 " EQ:=[op(EQ), f[i,i,j]=0];\n" }{MPLTEXT 1 0 7 " o d;\n" }{MPLTEXT 1 0 5 "od;\n" }{MPLTEXT 1 0 8 " \n" }{MPLTEXT 1 0 73 "vars:=[seq(seq(seq(f[i,j,k],i=0..quanod-1),j=0..quanod-1),k=0..d eg-1)];\n" }{MPLTEXT 1 0 32 "A:=linalg[genmatrix](EQ,vars);\n" } {MPLTEXT 1 0 33 "b:=vector(linalg[rowdim](A),0);\n" }{MPLTEXT 1 0 34 " Sol:=Linsolve(A,b,'r',ss) mod m;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 69 " # At this point the solution is in a vector form, in the order of\n" }{MPLTEXT 1 0 31 " # (f[0,0,0],f[1,0,0],...]).\n" }{MPLTEXT 1 0 84 " # From here the free variables are renamed so that the subscri pts starts with 1 \n" }{MPLTEXT 1 0 54 " # and put the solutions back into polynomial form.\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 30 "Sol_l ist:=convert(Sol,list);\n" }{MPLTEXT 1 0 23 "LL:=indets(Sol_list);\n" }{MPLTEXT 1 0 23 "LL:=convert(LL,list);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 67 "x:='x'; # Unassign x. (But ``unassign(x)'' didn't see m to work.) \n" }{MPLTEXT 1 0 84 "temp:=1; # The first subscript for t he new set of free variables x_1, x_2, .... \n" }{MPLTEXT 1 0 9 "GG: =[];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 29 "for i from 1 to nops(LL ) do\n" }{MPLTEXT 1 0 85 " ttemp:=op(LL[i]); # ttemp is the original \+ subscript of the free variables in ss. \n" }{MPLTEXT 1 0 61 " GG:=[op (GG),ss[ttemp]=x[temp]*t^(iquo(ttemp,quanod^2))]; \n" }{MPLTEXT 1 0 87 " # The first block matrix (whose size is quanod^2 where quanod is the order of X)\n" }{MPLTEXT 1 0 97 " # is for f[i,j,0], and s o on, so iquo(ttemp,quanod^2) is the degree of the free variable. \n" }{MPLTEXT 1 0 17 " temp:=temp+1;\n" }{MPLTEXT 1 0 5 "od;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 98 "Sol_list:=subs(GG,Sol_list); # Puts new \+ free variables x in polynomial forms back into Sol_list.\n" }{MPLTEXT 1 0 10 "temp:=1;\n" }{MPLTEXT 1 0 26 "for k from 0 to deg-1 do\n" } {MPLTEXT 1 0 31 " for j from 0 to quanod-1 do\n" }{MPLTEXT 1 0 33 " \+ for i from 0 to quanod-1 do\n" }{MPLTEXT 1 0 97 " f[i,j,k]:=col lect(Sol_list[temp],t): # Puts the solutions back into f in polynomial form.\n" }{MPLTEXT 1 0 21 " temp:=temp+1:\n" }{MPLTEXT 1 0 11 "o d:od:od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 44 "testsol:=map(`mod`,evalm(A &* Sol - b),m);\n" }{MPLTEXT 1 0 32 "te stsol:=convert(testsol,set);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 23 "if testsol=\{0\} then\n" }{MPLTEXT 1 0 15 " re turn(f);\n" }{MPLTEXT 1 0 6 "else\n" }{MPLTEXT 1 0 69 " printf(\"%s \",\"ERROR: co2TwistedSol solutions are not valid\");\n" }{MPLTEXT 1 0 12 " return;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 4 "end:" }}} {EXCHG {PARA 0 "" 0 "" {TEXT 200 72 "The procedure to calculate the va lue of the 2-cocycle twisted invariant." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "Invar2TwistedDLL:=proc(Quandle,Knot,polym,m::posint) \n" }{MPLTEXT 1 0 48 "local i,j,k,x,y,z,quandleorder,F,f,tinv,brind,\n " }{MPLTEXT 1 0 44 " SSTcontri,SST,jj3,jj5,jj6,jj8,s,num,\n" } {MPLTEXT 1 0 44 " Color,ColDiffMatch0,ColorDiff0,Ginv,\n" } {MPLTEXT 1 0 66 " indx,ttemp,deg,SST2,numVcolors,QuandleC,KnotC,V ALIDCOLORS;\n" }{MPLTEXT 1 0 10 "SST2:=0;\n" }{MPLTEXT 1 0 11 "#SST:=[ ];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 8 "f:=[];\n" }{MPLTEXT 1 0 37 "quandleorder:=quandlesize(Quandle);\n" }{MPLTEXT 1 0 29 "tinv:=tin verse(polym,m); \n" }{MPLTEXT 1 0 25 "Ginv:=makeinv(Quandle);\n" } {MPLTEXT 1 0 40 "brind:=max(op(map(x->abs(x),Knot)))+1;\n" }{MPLTEXT 1 0 23 "deg:=degree(polym,t);\n" }{MPLTEXT 1 0 92 " #For the optio nal 5th argument. The user sends the twisted cocycle solution as input .\n" }{MPLTEXT 1 0 17 "if nargs<5 then\n" }{MPLTEXT 1 0 38 " f:=co2Tw istedSol(Quandle,polym,m);\n" }{MPLTEXT 1 0 6 "else\n" }{MPLTEXT 1 0 15 " f:=args[5];\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 35 "for i from 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 37 " for j from 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 41 " F[i, j]:=sum(f[i,j,k], k=0..deg-1);\n" }{MPLTEXT 1 0 65 "#Removed the *t^k \+ from the def of F[i,j] since the t terms are \n" }{MPLTEXT 1 0 63 "#in troduced in the solutions by the procedure co2TwistedSol()\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 8 "od:od:\n" }{MPLTEXT 1 0 43 "##### ####################################\n" }{MPLTEXT 1 0 24 "############ ###9_30_05\n" }{MPLTEXT 1 0 16 "numVcolors:=0;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 65 "QuandleC:=Array(op(Quandle),da tatype=integer[2],order=C_order):\n" }{MPLTEXT 1 0 30 "#print(\"finish QuandleC\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 73 "KnotC:=Array(0 ..(nops(Knot)-1),Knot,datatype=integer[2],order=C_order):\n" }{MPLTEXT 1 0 27 "#print(\"finish Knotc\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 68 "VALIDCOLORS:=Array(0..10000000,datatype=integer[2],order=C_ord er):\n" }{MPLTEXT 1 0 33 "#print(\"finish VALIDCOLORS\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 90 "numVcolors:=validColorVectors(QuandleC,q uandleorder,KnotC,brind,nops(Knot),VALIDCOLORS):\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 40 "#print(\"numVcolors is \",numVcolors);\n" } {MPLTEXT 1 0 79 "#validColorVectors(QuandleC,quandleorder,KnotC,brind, nops(Knot),VALIDCOLORS):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 23 "Col or[0]:=numVcolors;\n" }{MPLTEXT 1 0 28 "#Color[0]:=VALIDCOLORS[0];\n" }{MPLTEXT 1 0 19 "############debug\n" }{MPLTEXT 1 0 28 "#print(\"fini sh colors\"):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 31 "for x from 1 t o numVcolors do\n" }{MPLTEXT 1 0 35 " for y from 1 to nops(Knot)+1 do \n" }{MPLTEXT 1 0 38 " Color[x][y]:=array(1..brind,[]):\n" } {MPLTEXT 1 0 7 " od:\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 58 "#print(\"There were \",numVcolo rs,\" valid colorings\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 60 "Co lor:=cvrtarray(brind,nops(Knot),VALIDCOLORS,numVcolors);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 41 "#######################################\n " }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 6 "#ADD\n" }{MPLTEXT 1 0 31 "for \+ i from 1 to numVcolors do\n" }{MPLTEXT 1 0 15 "SSTcontri:=0;\n" } {MPLTEXT 1 0 37 " for s from 1 to nops(Knot) do \n" }{MPLTEXT 1 0 30 " if Knot[s] > 0 then \n" }{MPLTEXT 1 0 10 " \n" } {MPLTEXT 1 0 108 " ttemp:=tinv^abs((-abs(Knot[s])+1))*F[Colo r[i][s][abs(Knot[s])], Color[i][s][abs(Knot[s])+1] ]; \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 62 " SSTcontri:=SSTcontri + Rem(ttemp ,polym,t) mod m: \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 19 " else \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 116 " ttemp:=t inv^(abs(-abs(Knot[s])+1))*F[Color[i][s+1][abs(Knot[s])], Color[i][s+1 ][abs(Knot[s])+1] ]; \n" }{MPLTEXT 1 0 60 " SSTcontri:=S STcontri+Rem(-ttemp,polym,t) mod m:\n" }{MPLTEXT 1 0 13 " fi: \n " }{MPLTEXT 1 0 87 " od: # Closing the state-sum term, for s.\n" }{MPLTEXT 1 0 7 " \n" } {MPLTEXT 1 0 52 " #SST:=[op(SST),Rem(SSTcontri,polym,t) mod m];\n" }{MPLTEXT 1 0 51 " SST2:=SST2+u^(Rem(SSTcontri,polym,t) mod m);\n " }{MPLTEXT 1 0 43 " od; #end i loop through valid colorings\n" } {MPLTEXT 1 0 69 " # print(\"SST2 is\",SST2); \+ \n" }{MPLTEXT 1 0 34 "return(SST2,Color,F,numVcolors);\n " }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " Calc2twistinvars:=proc(filePATH,p,polym,qord,qnum,numberofknots)\n" } {MPLTEXT 1 0 40 "#,\{cpath:=false\},\{solpath:=false\})\n" }{MPLTEXT 1 0 77 "local i,HH,tmpfilename1,tmpfilename2,tmpfilename3,tmpf1,tmpf2, tmpf3,INVARS,\n" }{MPLTEXT 1 0 73 " Quandle,quandleorder,tmpfilen ame4,tmpfilename5,tmpf4,tmpf5,brind,\n" }{MPLTEXT 1 0 100 " tmpCo lorstr,x,y,z,tmpco2str,tmpco3str,bstrand,crossvec,colnum,JJ,writesolpa th,cpath,solpath;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 20 " cpath:= args[7];\n" }{MPLTEXT 1 0 22 " solpath:=args[8];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 31 " Quandle:=cat(Q,qord,_,qnum);\n" }{MPLTEXT 1 0 38 " quandleorder:=quandlesize(Quandle);\n" }{MPLTEXT 1 0 28 " HH:= ssystem(date):HH[2];\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 116 " tmpf ilename1:=cat(filePATH,\"Z_\",p,\"mod\",convert(polym,string),\"twiste dQ\",qord,\"_\",qnum,\"_2cocinv.inv\");\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 23 "#if cpath<>false then\n" } {MPLTEXT 1 0 49 "#tmpfilename3:=cat(cpath,Colors,Q,qord,_,qnum);\n" } {MPLTEXT 1 0 6 "#fi;\n" }{MPLTEXT 1 0 25 "if solpath<> false then\n" } {MPLTEXT 1 0 86 " tmpfilename4:=cat(solpath,\"coc2SolnsZ_\",p,\"twiste dQ\",qord,\"_\",qnum,\".sol\");\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 36 " tmpf4:=fopen(tmpfilename4,WRITE);\n" }{MPLTEXT 1 0 3 " \n" } {MPLTEXT 1 0 33 "printf(\"%s\\n\",tmpfilename4);\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 168 " fprintf(tmpf4,\"#Twisted Quandle 2-cocycle sol utions for the Quandle Q%d_%d and \\n#coefficient group Z_%d[t,t^(-1)] /(%s)\\n\\n\",qord,qnum,p,convert(polym,string));\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 77 " fprintf(tmpf4,\"#The cayley table for the qua ndle Q%d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 38 " fpQuan(tmpf4,Quandle,quandleorder);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 45 " fprintf(tmpf4,\"#Generated %s \\n\",HH[2]);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 21 "writesolpath:= true;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 36 " tmpf1:=fopen(tmpfilename 1,WRITE);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 37 "# tmpf3:=fopen(tmp filename3,WRITE);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 33 "printf(\"% s\\n\",tmpfilename1);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 34 "#print f(\"%s\\n\",tmpfilename3);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n " }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 169 " fprintf(tmpf1,\"#Twisted Q uandle 2-cocycle invariants for the Quandle Q%d_%d and \\n#coefficient group Z_%d[t,t^(-1)]/(%s)\\n\\n\",qord,qnum,p,convert(polym,string)); \n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 76 " fprintf(tmpf1,\"#The cayl ey table for the quandle Q%d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 38 " fpQuan(tmpf1,Quandle,quandleorder);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 110 "# fprintf (tmpf3,\"The valid color vectors for the braids colored with the quand le Q%d_%d\\n\\n\",qord,qnum);\n" }{MPLTEXT 1 0 75 "#fprintf(tmpf3,\"Th e cayley table for the quandle Q%d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 38 "#fpQuan(tmpf3,Quandle,quandleorder);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 45 " fprintf(t mpf1,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 46 " #fprintf(tmpf3,\"#Generated %s\\n\",HH[2]);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 3 " \n" }{MPLTEXT 1 0 35 " for i from 0 to number ofknots do\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 20 "JJ:=ssystem(date) :\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 55 " INVA RS:=Invar2TwistedDLL(Quandle,Knot[i,2],polym,p):\n" }{MPLTEXT 1 0 123 " fprintf(tmpf1,\"%s\\t%s\\t \\n%s\\n\\n\",convert(Knot[i,1],string),c onvert(Knot[i,2],string),convert(INVARS[1],string));\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 23 "if cpath<> false then\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 55 "tmpfilename3:=cat(cpath,\"ColorsQ\",qord,\"_\",qnum );\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 60 " tmpfilename3:=cat(tmpfil ename3,\"K\",Knot[i,1],\".clr\");\n" }{MPLTEXT 1 0 35 "tmpf3:=fopen(tm pfilename3,WRITE);\n" }{MPLTEXT 1 0 34 "#printf(\"%s\\n\",tmpfilename3 );\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 196 " fprintf(tmpf3,\"#The va lid color vectors for the braids colored with the quandle Q%d_%d \\n#f or the knot %s with braid %s\\n\\n\",qord,qnum,convert(Knot[i,1],strin g),convert(Knot[i,2],string));\n" }{MPLTEXT 1 0 75 "fprintf(tmpf3,\"#T he cayley table for the quandle Q%d_%d\\n\",qord,qnum);\n" }{MPLTEXT 1 0 37 "fpQuan(tmpf3,Quandle,quandleorder);\n" }{MPLTEXT 1 0 44 "fprin tf(tmpf3,\"#Generated %s\\n\",JJ[2]);\n" }{MPLTEXT 1 0 67 " tmpColorst r:=cat(Col,convert(Knot[i,1],string),_,Q,qord,_,qnum);\n" }{MPLTEXT 1 0 57 "fprintf(tmpf3,\"%s[0]:=%d;\\n\",tmpColorstr,INVARS[4]);\n" } {MPLTEXT 1 0 45 "brind:=max(op(map(x->abs(x),Knot[i,2])))+1;\n" } {MPLTEXT 1 0 36 " for colnum from 1 to INVARS[4] do\n" }{MPLTEXT 1 0 48 " for crossvec from 1 to nops(Knot[i,2])+1 do\n" }{MPLTEXT 1 0 37 " for bstrand from 1 to brind do\n" }{MPLTEXT 1 0 78 " fp rintf(tmpf3,\"%s[%d][%d][%d]:=%d;\\n\",tmpColorstr,colnum,crossvec,\n" }{MPLTEXT 1 0 92 " bstrand ,INVARS[2][colnum][crossvec][bstrand]);\n" }{MPLTEXT 1 0 12 " od:od:od :\n" }{MPLTEXT 1 0 20 "JJ:=ssystem(date):\n" }{MPLTEXT 1 0 44 "fprintf (tmpf3,\"#Generated %s\\n\",JJ[2]);\n" }{MPLTEXT 1 0 33 " fprintf(tmp f3,\"\\n\\n\\n\");\n" }{MPLTEXT 1 0 16 "fclose(tmpf3);\n" }{MPLTEXT 1 0 49 "#tmpfilename3:=cat(cpath,Colors,Q,qord,_,qnum);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 29 "if writesolpath<>false then\n" }{MPLTEXT 1 0 51 "tmpco2str:=cat(co 2SolUntwist,Q,qord,_,qnum,Z_,p);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 36 " for x from 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 39 " for \+ y from 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 92 " fprintf(tmp f4,\"%s[%d,%d]:=%s;\\n\",tmpco2str,x,y,convert(INVARS[3][x,y],string)) ;\n" }{MPLTEXT 1 0 9 " od:od:\n" }{MPLTEXT 1 0 31 "fprintf(tmpf4,\"\\n \\n\\n\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 16 "fclose(tmpf4);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 22 "writesolp ath:=false;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 32 "print(\"finished all knots\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 28 " HH:=ssystem(date):H H[2]; \n" }{MPLTEXT 1 0 44 "fprintf(tmpf1,\"#Generated %s\\n\",HH[2]); \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 17 " fclose(tmpf1);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 "# fclose(tmpf3);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 200 42 "Local procedure for ClacTwistDLL procedure" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "tinverse:=proc(polym,m)\n" } {MPLTEXT 1 0 53 "local i,temp,L,deg,tinv,Cof,lowdeg,coffinv,tmppgcd;\n " }{MPLTEXT 1 0 18 "option remember;\n" }{MPLTEXT 1 0 31 "if type(poly m,polynom) then \n" }{MPLTEXT 1 0 26 " deg:=degree(polym,t);\n" } {MPLTEXT 1 0 7 "else \n" }{MPLTEXT 1 0 29 " printf(\"%s\\n\",ERROR); \n" }{MPLTEXT 1 0 12 " return;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 49 "Cof:=PolynomialTools[CoefficientList](polym,t);\n" }{MPLTEXT 1 0 11 "temp:=1; \n" }{MPLTEXT 1 0 26 " while Cof[temp]=0 do\n" } {MPLTEXT 1 0 21 " temp:=temp+1;\n" }{MPLTEXT 1 0 9 " od;\n" } {MPLTEXT 1 0 56 "if gcd(Cof[temp],m)=1 and gcd(Cof[nops(Cof)],m)=1 the n\n" }{MPLTEXT 1 0 13 " continue;\n" }{MPLTEXT 1 0 6 "else\n" } {MPLTEXT 1 0 49 " printf(\"%s\",\"ERROR, Not a finite ring.\");\n" } {MPLTEXT 1 0 11 " return;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 53 "lowdeg:=0; # lowdeg is the lowest degree of polym. \n" }{MPLTEXT 1 0 26 "while Cof[lowdeg+1]=0 do\n" }{MPLTEXT 1 0 20 " lowdeg:=lowdeg+ 1;\n" }{MPLTEXT 1 0 5 "od;\n" }{MPLTEXT 1 0 10 "tinv:=0;\n" }{MPLTEXT 1 0 39 "for i from (lowdeg+2) to nops(Cof) do\n" }{MPLTEXT 1 0 39 " t inv:=tinv-Cof[i]*t^(i-(lowdeg+2));\n" }{MPLTEXT 1 0 5 "od;\n" } {MPLTEXT 1 0 66 "# For example, if t^2+2*t+3=polym, then first do 3=-2 *t-t^2 and \n" }{MPLTEXT 1 0 59 "# compute 3*t^(-1)=-2-t. Then the nex t step cancels 3. \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 44 "tmppgcd :=igcdex(Cof[lowdeg+1],m,'s','r'); \n" }{MPLTEXT 1 0 81 "# This is 1 i ff the coeff of the lowest dgree is invertible (and it should be).\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 21 "if tmppgcd<>1 then \n" } {MPLTEXT 1 0 81 " printf(\"%s %d %s %d\",\"ERROR: Inverse dne for \" ,Cof[lowdeg+1],\"mod\",m);\n" }{MPLTEXT 1 0 6 "else\n" }{MPLTEXT 1 0 78 " coffinv:=s mod m; # This is he inverse of the coeff of the lowe st dgree. \n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 22 "tinv:=tinv*cof finv; \n" }{MPLTEXT 1 0 32 "tinv:=Rem(tinv,polym,t) mod m;\n" } {MPLTEXT 1 0 15 "return(tinv);\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 200 87 "The following procedures are included from the other packages. These were not modified." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "quandlesize:=proc(Quandle)\n" }{MPLTEXT 1 0 62 "#Procedure to dete rmine how many elements are in the quandle\n" }{MPLTEXT 1 0 64 "#Input : A zero indexed two dimensional array representing the \n" }{MPLTEXT 1 0 51 "# the multiplication table for the quandle.\n" }{MPLTEXT 1 0 78 "#Output: A positive integer. Representing the number of eleme nts in the set.\n" }{MPLTEXT 1 0 10 "local T;\n" }{MPLTEXT 1 0 65 "opt ion remember; #create table to avoid multiple function calls\n" } {MPLTEXT 1 0 29 "T:=convert(Quandle,matrix);\n" }{MPLTEXT 1 0 47 "if l inalg[rowdim](T)<>linalg[coldim](T) then \n" }{MPLTEXT 1 0 55 " prin f(\"%s %s %s\\n\",ERROR, quandle, dimensions);\n" }{MPLTEXT 1 0 33 "el se return(linalg[rowdim](T));\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "makeinv:=proc( Quandle)\n" }{MPLTEXT 1 0 67 "#Procedure that will create a zero index ed two dimensional array \n" }{MPLTEXT 1 0 78 "#representing the multi plication table for the second property of a quandle.\n" }{MPLTEXT 1 0 79 "# ie. There exists a unique c such that a=c*b. Will be used to c alculate the \n" }{MPLTEXT 1 0 39 "# colors for a negative crossin g.\n" }{MPLTEXT 1 0 69 "#Input: A zero indexed 2-dim array representin g the multiplication \n" }{MPLTEXT 1 0 32 "# table for the quand le.\n" }{MPLTEXT 1 0 37 "#Output:A zero indexed 2-dim array.\n" } {MPLTEXT 1 0 32 "local i,j,temp,L,quandleorder;\n" }{MPLTEXT 1 0 18 "o ption remember;\n" }{MPLTEXT 1 0 37 "quandleorder:=quandlesize(Quandle );\n" }{MPLTEXT 1 0 51 "L:=array(0..quandleorder-1,0..quandleorder-1,[ ]):\n" }{MPLTEXT 1 0 35 "for i from 0 to quandleorder-1 do\n" } {MPLTEXT 1 0 37 " for j from 0 to quandleorder-1 do\n" }{MPLTEXT 1 0 25 " temp:=Quandle[i,j];\n" }{MPLTEXT 1 0 19 " L[j,temp]:=i;\n" }{MPLTEXT 1 0 7 " od;\n" }{MPLTEXT 1 0 5 "od;\n" }{MPLTEXT 1 0 12 "re turn(L);\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "co2Solution:=proc(Quandle,m::posint)\n" }{MPLTEXT 1 0 67 "#Procedure to calculate the solutions to the 2-cocycle condition s\n" }{MPLTEXT 1 0 24 "#Input: (1) a Quandle.\n" }{MPLTEXT 1 0 26 "# \+ (2) the modulus.\n" }{MPLTEXT 1 0 20 "#Output: Solutions\n" } {MPLTEXT 1 0 57 "local x,y,z,i,EQ,f,vars,A,quanod,E,Sol,Sol_list,j,tem p,\n" }{MPLTEXT 1 0 16 " testsol;\n" }{MPLTEXT 1 0 18 "option rem ember;\n" }{MPLTEXT 1 0 24 "print(co2solproccall);\n" }{MPLTEXT 1 0 31 "quanod:=quandlesize(Quandle);\n" }{MPLTEXT 1 0 40 "f:=array(0..(qu anod-1),0..(quanod-1));\n" }{MPLTEXT 1 0 71 "EQ:=[]; \+ #defining the 2-cocycle condition\n" }{MPLTEXT 1 0 31 "for \+ x from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 34 " for y from 0 to (qua nod-1) do\n" }{MPLTEXT 1 0 37 " for z from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 83 " E[x,y,z]:= f[x,y]+f[Quandle[x,y], z]-f[x,z]- f[Quandle[x,z],Quandle[y,z]]:\n" }{MPLTEXT 1 0 34 " EQ:=[op(EQ) ,E[x,y,z]=0]:\n" }{MPLTEXT 1 0 14 "od: od: od: \n" }{MPLTEXT 1 0 31 "f or i from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 25 " EQ:=[op(EQ),f[i,i]= 0]:\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 72 "vars:=[seq(seq(f[i,j] ,j=0..(quanod-1)),i=0..(quanod-1))]; \n" }{MPLTEXT 1 0 34 "A:=linalg[genmatrix](EQ,vars,b):\n" }{MPLTEXT 1 0 33 "Sol:=Linsolve(A ,b,'r',t) mod m:\n" }{MPLTEXT 1 0 30 "Sol_list:=convert(Sol,list):\n" }{MPLTEXT 1 0 10 "temp:=1;\n" }{MPLTEXT 1 0 38 " #create the arra y of solutions\n" }{MPLTEXT 1 0 31 "for i from 0 to (quanod-1) do\n" } {MPLTEXT 1 0 33 " for j from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 36 " f[i,j]:=Sol_list[temp]:\n" }{MPLTEXT 1 0 26 " tem p:=temp+1;\n" }{MPLTEXT 1 0 9 " od:od:\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 14 "testsol:=[];\n" }{MPLTEXT 1 0 29 "for i from 1 to nop s(EQ) do\n" }{MPLTEXT 1 0 55 " testsol:=[op(testsol),map(x->x mod m,e val(EQ[i]))];\n" }{MPLTEXT 1 0 5 "od;\n" }{MPLTEXT 1 0 32 "testsol:=co nvert(testsol,set);\n" }{MPLTEXT 1 0 53 "#test to see if the solutions satisfy the equations\n" }{MPLTEXT 1 0 36 "if testsol=\{0=0\} then re turn(f);\n" }{MPLTEXT 1 0 62 "else printf(\"%s %s %s\\n\",co2Solution, solutions, invalid);\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "mirrorKnot:=proc(L)\n" }{MPLTEXT 1 0 23 "local i,S,b raidIndex;\n" }{MPLTEXT 1 0 42 "braidIndex:=max(op(map(x->abs(x),L)))+ 1;\n" }{MPLTEXT 1 0 8 "S:=[];\n" }{MPLTEXT 1 0 28 "for i from 1 to nop s(L) do\n" }{MPLTEXT 1 0 20 " if L[i]<0 then \n" }{MPLTEXT 1 0 34 " \+ S:=[op(S),braidIndex+L[i]];\n" }{MPLTEXT 1 0 10 " else \n" } {MPLTEXT 1 0 41 " S:=[op(S),(-1)*(braidIndex-L[i])];\n" }{MPLTEXT 1 0 8 " fi;\n" }{MPLTEXT 1 0 5 "od;\n" }{MPLTEXT 1 0 12 "return(S); \n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "barKnot:=proc(L)\n" }{MPLTEXT 1 0 12 "local i,S;\n" }{MPLTEXT 1 0 8 "S:=[];\n" }{MPLTEXT 1 0 28 "for i from 1 to nops(L) do\n" }{MPLTEXT 1 0 21 " S:=[L[i],op(S)];\n" }{MPLTEXT 1 0 5 "od;\n" }{MPLTEXT 1 0 12 "return(S);\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "connSumKnots:=proc(Knots_list)\n" }{MPLTEXT 1 0 64 "# Procedure to form the braid word of a connected sum of knots.\n" } {MPLTEXT 1 0 17 "#Input: A list.\n" }{MPLTEXT 1 0 66 "# [1] A li st of lists. The elements of the list are lists \n" }{MPLTEXT 1 0 56 " # representing the braid words of the knots \n" }{MPLTEXT 1 0 58 "# in the order that they are to be connected.\n" } {MPLTEXT 1 0 47 "# ex. [[1,1,1],[1,1,1],[1,-2,1,-2]]\n" } {MPLTEXT 1 0 23 "#Output: A list, [L].\n" }{MPLTEXT 1 0 33 "# [L ] The new braid word.\n" }{MPLTEXT 1 0 27 "# ex. of a function call \n " }{MPLTEXT 1 0 48 "# ConnSumKnots([[1,1,1],[1,1,1],[1,-2,1,-2]]);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 51 "local newIndex, i,k, j, NewKnot ,Braid_Index_list;\n" }{MPLTEXT 1 0 14 "NewKnot:=[];\n" }{MPLTEXT 1 0 22 "Braid_Index_list:[];\n" }{MPLTEXT 1 0 14 "newIndex:=0;\n" } {MPLTEXT 1 0 37 "for k from 1 to nops(Knots_list) do\n" }{MPLTEXT 1 0 65 " Braid_Index_list[k]:=max(op(map(x->abs(x),Knots_list[k])))+1;\n" }{MPLTEXT 1 0 5 "od;\n" }{MPLTEXT 1 0 37 "for i from 1 to nops(Knots_ list) do\n" }{MPLTEXT 1 0 43 " for j from 1 to nops(Knots_list[i]) d o\n" }{MPLTEXT 1 0 40 " if Knots_list[i][j]<0 then \n" } {MPLTEXT 1 0 60 " NewKnot:=[op(NewKnot),Knots_list[i][j]-newIn dex];\n" }{MPLTEXT 1 0 12 " else\n" }{MPLTEXT 1 0 60 " Ne wKnot:=[op(NewKnot),Knots_list[i][j]+newIndex];\n" }{MPLTEXT 1 0 11 " \+ fi;\n" }{MPLTEXT 1 0 8 " od;\n" }{MPLTEXT 1 0 44 " newIndex:= newIndex+Braid_Index_list[i];\n" }{MPLTEXT 1 0 34 " if i<> nops(Knot s_list) then \n" }{MPLTEXT 1 0 40 " NewKnot:=[op(NewKnot),newInde x];\n" }{MPLTEXT 1 0 8 " fi;\n" }{MPLTEXT 1 0 5 "od;\n" }{MPLTEXT 1 0 18 "return(NewKnot);\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 38 "co3Solution:=proc(Quandle,m::posint)\n" } {MPLTEXT 1 0 67 "#Procedure to calculate the solutions to the 3-cocycl e conditions\n" }{MPLTEXT 1 0 24 "#Input: (1) a Quandle.\n" }{MPLTEXT 1 0 26 "# (2) the modulus.\n" }{MPLTEXT 1 0 20 "#Output: Solutio ns\n" }{MPLTEXT 1 0 61 "local x,y,z,i,w,k,EQ,h,vars,A,quanod,E,Sol,Sol _list,j,temp,\n" }{MPLTEXT 1 0 10 "testsol;\n" }{MPLTEXT 1 0 18 "optio n remember;\n" }{MPLTEXT 1 0 24 "print(co3solproccall);\n" }{MPLTEXT 1 0 31 "quanod:=quandlesize(Quandle);\n" }{MPLTEXT 1 0 54 "h:=array(0. .(quanod-1),0..(quanod-1),0..(quanod-1));\n" }{MPLTEXT 1 0 71 "EQ:=[]; #defining the 3-cocycle condition\n" } {MPLTEXT 1 0 31 "for x from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 34 " \+ for y from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 37 " for z from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 39 " for w from 0 to (quanod -1) do\n" }{MPLTEXT 1 0 57 " E[x,y,z,w]:= h[x,z,w] - h[x,y,w] \+ + h[x,y,z] \n" }{MPLTEXT 1 0 100 "- h[Quandle[x,y],z,w] + h[Quandle[ x,z],Quandle[y,z],w]- h[Quandle[x,w],Quandle[y,w],Quandle[z,w]]:\n" } {MPLTEXT 1 0 28 "EQ:=[op(EQ),E[x,y,z,w]=0]:\n" }{MPLTEXT 1 0 17 "od: o d: od:od: \n" }{MPLTEXT 1 0 31 "for i from 0 to (quanod-1) do\n" } {MPLTEXT 1 0 33 " for j from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 30 " EQ:=[op(EQ),h[i,j,j]=0]:\n" }{MPLTEXT 1 0 8 "od:od:\n" }{MPLTEXT 1 0 95 "vars:=[seq(seq(seq(h[i,j,k],k=0..(quanod-1)),j=0..(quanod-1)), i=0..(quanod-1))]; \n" }{MPLTEXT 1 0 34 "A:=linalg[genmatr ix](EQ,vars,b):\n" }{MPLTEXT 1 0 33 "Sol:=Linsolve(A,b,'r',t) mod m:\n " }{MPLTEXT 1 0 30 "Sol_list:=convert(Sol,list):\n" }{MPLTEXT 1 0 10 " temp:=1;\n" }{MPLTEXT 1 0 31 "for i from 0 to (quanod-1) do\n" } {MPLTEXT 1 0 33 " for j from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 35 " for k from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 38 " h[i, j,k]:=Sol_list[temp]:\n" }{MPLTEXT 1 0 26 " temp:=temp+1;\n" }{MPLTEXT 1 0 12 " od:od:od:\n" }{MPLTEXT 1 0 14 "testsol:=[];\n" } {MPLTEXT 1 0 29 "for i from 1 to nops(EQ) do\n" }{MPLTEXT 1 0 55 " te stsol:=[op(testsol),map(x->x mod m,eval(EQ[i]))];\n" }{MPLTEXT 1 0 5 " od;\n" }{MPLTEXT 1 0 32 "testsol:=convert(testsol,set);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 36 "if testsol=\{0=0\} then return(h);\n" } {MPLTEXT 1 0 62 "else printf(\"%s %s %s\\n\",co3Solution,solutions, in valid);\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "Mochizuki3coc:=proc(Xpolym,Apolym,p ,m1,m2,a3)\n" }{MPLTEXT 1 0 61 "#Input: (1) The polynomial in t from t he Alexander quandle \n" }{MPLTEXT 1 0 74 "# that will be us ed to color the braid( Z_p[t^-1,t]/(Xpolym)).\n" }{MPLTEXT 1 0 61 "# \+ (2) The polynomial in t from the Alexander quandle \n" }{MPLTEXT 1 0 71 "# that is used for the coefficients (Z_p[t^-1,t]/(Ap olym)).\n" }{MPLTEXT 1 0 66 "# (3) The prime modulus from the ab ove Alexander quandles.\n" }{MPLTEXT 1 0 76 "# (4) m1 is the exp onent from Mochizuki's formula for the first term\n" }{MPLTEXT 1 0 60 "# f(x1,x2,x3)=(x1-x2)^(p^m1)(x2-x3)^(p^m2)x3^a3.\n" } {MPLTEXT 1 0 81 "# (5) m2 is the exponent from the second term i n Mochizuki formula above.\n" }{MPLTEXT 1 0 84 "# (6) a3 is the \+ third term in the formula. a3 must either be zero or a power\n" } {MPLTEXT 1 0 63 "# of p such that Apolym divides 1-t^(p^m1+p ^m2+a3).\n" }{MPLTEXT 1 0 58 "#Output: A table that has the values for the 3-cocycles.\n" }{MPLTEXT 1 0 57 "#Example Input: Mochizuki3coc(t^ 2-t+1,t^2-t+1,2,1,1,0);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 58 "local i,j,k,f, qsize, Quandle,Xe lements,temp, tempcheck;\n" }{MPLTEXT 1 0 18 "option remember;\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 16 "Xelements:=[];\n" }{MPLTEXT 1 0 28 "Xelements:=rres(Xpolym,p):\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 31 "#print(\"Mochizuki called\");\n" }{MPLTEXT 1 0 20 "#print(Xelements);\n" }{MPLTEXT 1 0 25 "qsize:=nops(Xelements); \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 69 "# In the following statemen t Xpolym is used. This is the polynomial\n" }{MPLTEXT 1 0 63 "# from t he Alexander quandle that is used to color the braid.\n" }{MPLTEXT 1 0 89 "# The paper by Kheira says that we should use the polynomial fro m the Alexander quandle\n" }{MPLTEXT 1 0 57 "# that is used for the co efficients in the Divides test\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 53 "tempcheck:=Divide(1-t^(p^m1+p^m2+a3),Apolym) mod p;\n" }{MPLTEXT 1 0 64 "#print(\"tempcheck is \",1-t^(p^m1+p^m2+a3),Xpolym,tempcheck); \n" }{MPLTEXT 1 0 27 "if a3=0 or tempcheck then\n" }{MPLTEXT 1 0 13 " \+ continue;\n" }{MPLTEXT 1 0 7 "else \n" }{MPLTEXT 1 0 50 " print(\"Mo chizuki conditions not satisfied\");\n" }{MPLTEXT 1 0 17 " return fal se;\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 45 "f:=array(0..qsize-1,0 ..qsize-1,0..qsize-1);\n" }{MPLTEXT 1 0 26 "for i from 1 to qsize do\n " }{MPLTEXT 1 0 28 " for j from 1 to qsize do\n" }{MPLTEXT 1 0 29 " \+ for k from 1 to qsize do\n" }{MPLTEXT 1 0 94 "temp:=(Xelements[i]-Xel ements[j])^(p^m1)*(Xelements[j]-Xelements[k])^(p^m2)*Xelements[k]^a3; \n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 24 "# a[3] is zero or p^m3\n" } {MPLTEXT 1 0 74 "#This procedure does not currently check to see if a[ 3] is prime power. \n" }{MPLTEXT 1 0 8 "#DEBUG\n" }{MPLTEXT 1 0 36 "#p rint(\"temp ploy is \",temp); \n" }{MPLTEXT 1 0 13 "#END DEBUG \n" } {MPLTEXT 1 0 43 "f[i-1,j-1,k-1]:=Rem(temp,Apolym,t) mod p;\n" } {MPLTEXT 1 0 8 "#DEBUG\n" }{MPLTEXT 1 0 56 "#print(\"temp ploy reduced in A is \",f[i-1,j-1,k-1]);\n" }{MPLTEXT 1 0 12 "#END DEBUG\n" } {MPLTEXT 1 0 8 "od:od:\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 12 "return(f);\n" }{MPLTEXT 1 0 6 "end: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "cocycle3check:=proc(cocy,Xpolym,Apo lym,p)\n" }{MPLTEXT 1 0 84 "#Input: (1) A table that contains the valu es for the 3-cocycles that is generated \n" }{MPLTEXT 1 0 49 "# \+ from the procedure Mochizuki3coc().\n" }{MPLTEXT 1 0 61 "# ( 2) The polynomial in t from the Alexander quandle \n" }{MPLTEXT 1 0 74 "# that will be used to color the braid( Z_p[t^-1,t]/(Xpo lym)).\n" }{MPLTEXT 1 0 61 "# (3) The polynomial in t from the A lexander quandle \n" }{MPLTEXT 1 0 71 "# that is used for th e coefficients (Z_p[t^-1,t]/(Apolym)).\n" }{MPLTEXT 1 0 66 "# (4 ) The prime modulus from the above Alexander quandles.\n" }{MPLTEXT 1 0 89 "#Output: A true or false value. This procedure will plug the val ues from the table cocy\n" }{MPLTEXT 1 0 78 "# into the 3-cocyc le condition to make sure it is a valid 3-cocycle. \n" }{MPLTEXT 1 0 71 "# Note: This only tests the Reidmeister type II and III mov es.\n" }{MPLTEXT 1 0 90 "#Example Input: cocycle3check(Mochizuki3coc(t ^2-t+1,t^2-t+1,2,1,1,0),t^2-t+1,t^2-t+1,2);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 52 "local i, j, k,x,y,z,w,temp,rrespol,quanod,Quandle;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 "option remember;\n" }{MPLTEXT 1 0 26 "rrespol:=rres(Xpolym,p);\n" }{MPLTEXT 1 0 18 "#print(rrespol); \n" }{MPLTEXT 1 0 33 "Quandle:=AlexQuandle(Xpolym,p);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 24 "quanod:=nops(rrespol);\n" }{MPLTEXT 1 0 34 "#print(convert(Quandle,matrix));\n" }{MPLTEXT 1 0 17 "#print(quanod); \n" }{MPLTEXT 1 0 31 "for i from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 32 " for j from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 26 " if cocy[i,j, j]<>0 then\n" }{MPLTEXT 1 0 45 " print(\"f[\",i,j,j,\"]=\",cocy[i,j ,j]);\n" }{MPLTEXT 1 0 19 " return false;\n" }{MPLTEXT 1 0 7 " fi; \n" }{MPLTEXT 1 0 8 "od;od;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 28 " # print(\"finished rII\");\n" }{MPLTEXT 1 0 31 "for x from 0 to (quano d-1) do\n" }{MPLTEXT 1 0 34 " for y from 0 to (quanod-1) do\n" } {MPLTEXT 1 0 37 " for z from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 39 " for w from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 59 " \+ temp:= cocy[x,z,w] - cocy[x,y,w] + cocy[x,y,z] \n" }{MPLTEXT 1 0 109 "- cocy[Quandle[x,y],z,w] + cocy[Quandle[x,z],Quandle[y,z],w]- coc y[Quandle[x,w],Quandle[y,w],Quandle[z,w]];\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 15 "#print(temp);\n" }{MPLTEXT 1 0 45 " if Rem(temp,Apolym,t) mod p<>0 then\n" }{MPLTEXT 1 0 71 " \+ print(\"temp from ReidIII is \",temp,\"xyzw is\",x,y,z,w);\n " }{MPLTEXT 1 0 26 " return false;\n" }{MPLTEXT 1 0 13 " \+ fi;\n" }{MPLTEXT 1 0 14 "od;od;od;od;\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 14 "return true;\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "Xi:=proc(n)\n" }{MPLTEXT 1 0 35 "#i nput: (1)A positive integer n. \n" }{MPLTEXT 1 0 55 "#output: A polyno mial in t. Sum((-t)^i,i = 0 .. n-1).\n" }{MPLTEXT 1 0 34 "# Xi( 0):=0 by definition.\n" }{MPLTEXT 1 0 24 "#Example input: Xi(3);\n" } {MPLTEXT 1 0 26 "#Example output: t^2-t+1\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 13 "if n=0 then\n" }{MPLTEXT 1 0 13 " return 0;\n" } {MPLTEXT 1 0 6 "else\n" }{MPLTEXT 1 0 32 " return(sum((-t)^i,i=0..n-1) );\n" }{MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "Mochizuki2coc:=proc(Xpolym,Apolym,p,m1,a2) \n" }{MPLTEXT 1 0 61 "#Input: (1) The polynomial in t from the Alexand er quandle \n" }{MPLTEXT 1 0 74 "# that will be used to colo r the braid( Z_p[t^-1,t]/(Xpolym)).\n" }{MPLTEXT 1 0 61 "# (2) T he polynomial in t from the Alexander quandle \n" }{MPLTEXT 1 0 71 "# \+ that is used for the coefficients (Z_p[t^-1,t]/(Apolym)).\n" }{MPLTEXT 1 0 66 "# (3) The prime modulus from the above Alexan der quandles.\n" }{MPLTEXT 1 0 76 "# (4) m1 is the exponent from Mochizuki's formula for the first term\n" }{MPLTEXT 1 0 46 "# \+ f(x1,x2,x3)=(x1-x2)^(p^m1)x2^a2.\n" }{MPLTEXT 1 0 85 "# (5) a 2 is the second term in the formula. a2 must either be zero or a power \n" }{MPLTEXT 1 0 58 "# of p such that Apolym divides 1-t^(p ^m1+a2).\n" }{MPLTEXT 1 0 58 "#Output: A table that has the values for the 2-cocycles.\n" }{MPLTEXT 1 0 55 "#Example Input: Mochizuki3coc(t^ 2-t+1,t^2-t+1,2,1,0);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 55 "local i,j,f, qsize, Quandle,Xelements,temp,tempcheck; \n" }{MPLTEXT 1 0 18 "option remember;\n" }{MPLTEXT 1 0 16 "Xelements: =[];\n" }{MPLTEXT 1 0 28 "Xelements:=rres(Xpolym,p):\n" }{MPLTEXT 1 0 25 "qsize:=nops(Xelements);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 48 " tempcheck:=Divide(1-t^(p^m1+a2),Xpolym) mod p;\n" }{MPLTEXT 1 0 59 "#p rint(\"tempcheck is \",1-t^(p^m1+a2),Xpolym,tempcheck);\n" }{MPLTEXT 1 0 27 "if a2=0 or tempcheck then\n" }{MPLTEXT 1 0 13 " continue;\n" }{MPLTEXT 1 0 7 "else \n" }{MPLTEXT 1 0 50 " print(\"Mochizuki condit ions not satisfied\");\n" }{MPLTEXT 1 0 17 " return false;\n" } {MPLTEXT 1 0 5 "fi;\n" }{MPLTEXT 1 0 20 "#print(Xelements);\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 34 "f:=array(0. .qsize-1,0..qsize-1);\n" }{MPLTEXT 1 0 26 "for i from 1 to qsize do\n" }{MPLTEXT 1 0 28 " for j from 1 to qsize do\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 59 "temp:=(Xelements[i]-Xelements[j])^(p^m1)*Xelements[j ]^a2;\n" }{MPLTEXT 1 0 18 "#print(temp); \n" }{MPLTEXT 1 0 40 " f[i- 1,j-1]:=Rem(temp,Apolym,t) mod p;\n" }{MPLTEXT 1 0 8 "od:od:\n" } {MPLTEXT 1 0 12 "return(f);\n" }{MPLTEXT 1 0 7 "end: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "cocycle2check:=proc(cocy,Xpolym,Apo lym,p)\n" }{MPLTEXT 1 0 84 "#Input: (1) A table that contains the valu es for the 2-cocycles that is generated \n" }{MPLTEXT 1 0 49 "# \+ from the procedure Mochizuki2coc().\n" }{MPLTEXT 1 0 61 "# ( 2) The polynomial in t from the Alexander quandle \n" }{MPLTEXT 1 0 74 "# that will be used to color the braid( Z_p[t^-1,t]/(Xpo lym)).\n" }{MPLTEXT 1 0 61 "# (3) The polynomial in t from the A lexander quandle \n" }{MPLTEXT 1 0 71 "# that is used for th e coefficients (Z_p[t^-1,t]/(Apolym)).\n" }{MPLTEXT 1 0 66 "# (4 ) The prime modulus from the above Alexander quandles.\n" }{MPLTEXT 1 0 89 "#Output: A true or false value. This procedure will plug the val ues from the table cocy\n" }{MPLTEXT 1 0 78 "# into the 2-cocyc le condition to make sure it is a valid 2-cocycle. \n" }{MPLTEXT 1 0 71 "# Note: This only tests the Reidmeister type II and III mov es.\n" }{MPLTEXT 1 0 90 "#Example Input: cocycle2check(Mochizuki2coc(t ^2-t+1,t^2-t+1,2,1,1,0),t^2-t+1,t^2-t+1,2);\n" }{MPLTEXT 1 0 2 "\n" } {MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 52 "local i, j, k,x,y,z,w,temp,rresp ol,quanod,Quandle;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 18 "option re member;\n" }{MPLTEXT 1 0 26 "rrespol:=rres(Xpolym,p);\n" }{MPLTEXT 1 0 18 "#print(rrespol);\n" }{MPLTEXT 1 0 33 "Quandle:=AlexQuandle(Xpoly m,p);\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 24 "quanod:=nops(rrespol); \n" }{MPLTEXT 1 0 34 "#print(convert(Quandle,matrix));\n" }{MPLTEXT 1 0 17 "#print(quanod);\n" }{MPLTEXT 1 0 31 "for i from 0 to (quanod-1) \+ do\n" }{MPLTEXT 1 0 25 " if cocy[i,i]<>0 then\n" }{MPLTEXT 1 0 41 " \+ print(\"f[\",i,i,\"]=\",cocy[i,i]);\n" }{MPLTEXT 1 0 19 " return false;\n" }{MPLTEXT 1 0 7 " fi;\n" }{MPLTEXT 1 0 5 "od;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 28 "# print(\"finished rII\");\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 77 "# E[x,y,z]:= f[x,y]+f[Quandle[x,y], z]-f[ x,z]-f[Quandle[x,z],Quandle[y,z]]:\n" }{MPLTEXT 1 0 31 "for x from 0 t o (quanod-1) do\n" }{MPLTEXT 1 0 34 " for y from 0 to (quanod-1) do \n" }{MPLTEXT 1 0 37 " for z from 0 to (quanod-1) do\n" }{MPLTEXT 1 0 91 " temp:= cocy[x,y]+cocy[Quandle[x,y], z]-cocy[x,z]-cocy [Quandle[x,z],Quandle[y,z]];\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 15 "#print(temp);\n" }{MPLTEXT 1 0 45 " if Re m(temp,Apolym,t) mod p<>0 then\n" }{MPLTEXT 1 0 68 " print( \"temp from ReidIII is \",temp,\"xyz is\",x,y,z);\n" }{MPLTEXT 1 0 26 " return false;\n" }{MPLTEXT 1 0 13 " fi;\n" } {MPLTEXT 1 0 11 "od;od;od;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 14 "r eturn true;\n" }{MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "MochizukiDihedral3coc:=proc(p)\n" }{MPLTEXT 1 0 58 "l ocal i,j,k,f, qsize, Quandle,Xelements,temp, tempcheck;\n" }{MPLTEXT 1 0 18 "option remember;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 39 "f:= array(0..(p-1),0..(p-1),0..(p-1));\n" }{MPLTEXT 1 0 26 "for i from 0 t o (p-1) do\n" }{MPLTEXT 1 0 28 " for j from 0 to (p-1) do\n" } {MPLTEXT 1 0 29 " for k from 0 to (p-1) do\n" }{MPLTEXT 1 0 52 "f[i, j,k]:=((i-j)*((2*k^p-j^p)-(2*k-j)^p)/p) mod p;\n" }{MPLTEXT 1 0 2 "\n" }{MPLTEXT 1 0 8 "od:od:\n" }{MPLTEXT 1 0 5 "od:\n" }{MPLTEXT 1 0 2 " \n" }{MPLTEXT 1 0 12 "return(f);\n" }{MPLTEXT 1 0 7 "end: " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 578 "#save validColorVectors,cvr tarray,Invar2_3UntwistedDLL,CalcUntwistinvars, fpQuan, #Invar2Untwiste dDLL,Calc2Untwistinvars,Invar3UntwistedDLL, #Calc3Untwistinvars,Invar2 _3MochizukiDLL,CalcMochinvars,Invar2MochizukiDLL,Calc2Mochinvars, #Inv ar3MochizukiDLL, Calc3Mochinvars, ismult, #CalcDihinvars,co2TwistedSol ,Invar2TwistedDLL,Calc2twistinvars,tinverse, quandlesize, makeinv, #co 2Solution, mirrorKnot, barKnot, connSumKnots, co3Solution, Mochizuki3c oc, cocycle3check, Xi, #Mochizuki2coc, cocycle2check, MochizukiDihedra l3coc, \"/media/sda1/WorksheetIVtnfr/quancocDLLpkgmaple8.m\";" }}} {EXCHG {PARA 3 "" 0 "" {TEXT 205 0 "" }}}} {MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }