--to use this code, go to http://habanero.math.cornell.edu:3690/ and click upload file, then choose this file, then in the window, type: input "CFKI.txt" --CFKIcomplexes should be of the form (multidegs,del,iota) where multidegs is a list of elements like {m,i,j}, which represents an elements x U^{-i}V^{-j} in Maslov grading m. del and iota are matrices of 1s and 0s. One puts a 1 in the (i,j)-component of del or iota if there is an arrow between x_i and some U^k x_j for any k, in CFK^infty. The powers of U are determined by the grading, and are added in AIComp. --AIComp takes CFKIcomplex and returns an iota-complex (not a knot complex). --CorrTerms takes an iota-complex and returns (d-upper,d,d-lower). --KnotTerms takes a CFKIcomplex and returns (d-upper,d,d-lower) of large surgeries. --CFKITensor input is two CFKIcomplexes and output is the appropriate tensor product. --An example of how to use the code would be the following (after copy pasting all the code below into Macaulay2) --Tl=(({-1,-1,-1},{0,-1,0},{0,0,-1}),transpose {{0,0,0},{1,0,0},{1,0,0}}, transpose{{1,0,0},{0,0,1},{0,1,0}}); --KnotTerms(Tl) --TlTl=CFKITensor(Tl,Tl); --KnotTerms(TlTl) R=ZZ/2[U, Degrees=>{-2}]; CorrTerms = (degs, del, iota) -> ( CF:=R^(-degs); D:=map(CF, CF, matrix(R,del)); Dg:=map(CF, CF**R^{1}, matrix(R,del)); HF:=prune (kernel(D)/image(Dg)); HFdual:= prune(Hom(HF, R^1)); d:=first degree(numerator(hilbertSeries(HFdual))); I:=map(CF, CF, matrix(R,iota)); CFI:=R^{0,1} ** CF; delI:=matrix{{D, 0}, {I+id_(CF), D}}; DI:=map(CFI, CFI, delI); DIg:=map(CFI, CFI**R^{1}, delI); HFI:=prune (kernel(DI)/image(DIg)); HFIdual:= prune(Hom(HFI, R^1)); dinv:=degrees(HFIdual); dinv1:= first first dinv; dinv2:= last last dinv; dlower:= if (even dinv1) then -dinv1 else -dinv2; dupper:= if (even dinv1) then 1-dinv2 else 1-dinv1; (dlower, d, dupper) ) DualI = C -> (-C#0, transpose C#1, transpose C#2); TensorI = (A, B) -> ( CFA:=R^(-A#0); CFB:=R^(-B#0); degs:= flatten for i to (length A#0 - 1) list apply (B#0, x -> x + (A#0)#i); del:=entries((matrix A#1)**id_(CFB) + id_(CFA)**(matrix B#1)); iota:=entries((matrix A#2)**(matrix B#2)); (degs, del, iota) ) --input is a CFKIcomplex and output is an iota complex. AIComp= A-> ( B:=A#0; del:=A#1; iota:=A#2; degs:=flatten for i from 0 to (length B -1) list if((B#i)#1> (B#i)#2) then (B#i)#0-2*((B#i)#1) else (B#i)#0-2*((B#i)#2); delnew:=for i from 0 to (length B-1) list flatten for j from 0 to (length B-1) list U^(abs((degs#i-degs#j+1)//2))*((del#i)#j); iotanew=for i from 0 to (length B-1) list flatten for j from 0 to (length B-1) list U^(abs((degs#i-degs#j)//2))*((iota#i)#j); (degs,delnew,iotanew) ) --input is two CFKI complexes. Output is their tensor product, using the product formula. CFKITensor= (A, B) -> ( CFA:=R^(length A#0); CFB:=R^(length B#0); degs:= toSequence flatten for i to (length A#0 - 1) list for j from 0 to (length B#0 -1) list (B#0)#j+(A#0)#i; del:=entries((matrix A#1)**id_(CFB) + id_(CFA)**(matrix B#1)); Phi1:=for i from 0 to (length A#0-1) list for j from 0 to (length A#0-1) list (((A#1)#i)#j)*( ((A#0)#i)#1 -((A#0)#j)#1 -(((A#0)#j)#0-((A#0)#i)#0-1)//2); Psi2:=for i from 0 to (length B#0-1) list for j from 0 to (length B#0-1) list (((B#1)#i)#j)*( ((B#0)#i)#2 -((B#0)#j)#2 -(((B#0)#j)#0-((B#0)#i)#0-1)//2); iota:=entries((matrix A#2)**(matrix B#2)+((matrix A#2)*(matrix Phi1))**((matrix B#2)*(matrix Psi2))); (degs, del, iota) ) --input is a list of CFKI complexes, like {Tr,Tr,Tr}, and output is their tensor product TensorList=(L)-> ( C:=L#0; for i from 1 to length L-1 do (C=CFKITensor(C, L#i)); C ) --input is CFKI complex, output is the dual CFKI complex CFKIDual = C -> (toSequence(-(toList C#0)), transpose C#1, transpose C#2); --input is a CFKIComplex, output is (V0-lower, V0, V0-upper) of large surgery. KnotTerms = C -> ( L:=CorrTerms(AIComp(C)); M:=for i from 0 to 2 list -(L#i)/2; M )