<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://katlas.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ben</id>
	<title>Knot Atlas - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://katlas.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ben"/>
	<link rel="alternate" type="text/html" href="https://katlas.org/wiki/Special:Contributions/Ben"/>
	<updated>2026-06-01T11:51:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=58069</id>
		<title>User:Ben/KRhomology</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=58069"/>
		<updated>2006-01-30T23:24:52Z</updated>

		<summary type="html">&lt;p&gt;Ben: /* Macaulay2 program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Calculations==&lt;br /&gt;
Since calculations have now been incorporated into the normal KAtlas data structure, I don&#039;t feel like there&#039;s much point in having a table of them here.&lt;br /&gt;
&lt;br /&gt;
==Macaulay2 program==&lt;br /&gt;
Save this as a file (called KR.m2), open Macaulay2 (in command line or emacs), and type &amp;lt;code&amp;gt;load &amp;quot;KR.m2&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;KRpoly&amp;lt;/code&amp;gt; is probabby the command you want (but it only works for knots at the moment). It outputs &amp;lt;math&amp;gt;\frac{1-t}{qt+1}KR_K(q,s,t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using &amp;lt;code&amp;gt;texMath&amp;lt;/code&amp;gt; puts things in format for LaTeX.  &lt;br /&gt;
&lt;br /&gt;
Changes from the previous version: the important change is in the construction of the Rouquier complex.  Now it works by breaking up the braid into (at the moment, very simple) patterns it recognizes, and uses simplified Rouquier complexes for those chunks.  This seems to be make a big difference in computational time, indicating that a program that could simplify large Rouquier complexes could lead to very large computational savings.  I&#039;ve made some progress in this direction, but am still struggling to produce something truly robust.&lt;br /&gt;
&lt;br /&gt;
The program posted on Jan. 15 had a bug in it, and shouldn&#039;t be used.  That bug is now fixed.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample session:&lt;br /&gt;
&amp;lt;pre&amp;gt;Macaulay 2, version 0.9&lt;br /&gt;
--Copyright 1993-2001, D. R. Grayson and M. E. Stillman&lt;br /&gt;
--Singular-Factory 1.3b, copyright 1993-2001, G.-M. Greuel, et al.&lt;br /&gt;
--Singular-Libfac 0.3.2, copyright 1996-2001, M. Messollen&lt;br /&gt;
&lt;br /&gt;
i1 : load &amp;quot;KR.m2&amp;quot;&lt;br /&gt;
KR.m2:113:11: warning: local declaration of N shields variable with same name&lt;br /&gt;
--loaded KR.m2&lt;br /&gt;
&lt;br /&gt;
i2 : texMath KRpoly (K01,true)&lt;br /&gt;
&lt;br /&gt;
o2 = 1&lt;br /&gt;
&lt;br /&gt;
i3 : texMath KRpoly (K31,true)&lt;br /&gt;
&lt;br /&gt;
o3 = s^{2} t^{2}+{q} t^{2}+1&lt;br /&gt;
&lt;br /&gt;
i4 : &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the code for the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--This file defines a new object for Macaulay2, called a &amp;quot;Link.&amp;quot;&lt;br /&gt;
--Like all objects in Macaulay2, a Link is just a hash table.&lt;br /&gt;
--Defining a link lets you store information about it for later use.  &lt;br /&gt;
&lt;br /&gt;
Link = new Type of MutableHashTable &lt;br /&gt;
Link.synonym = &amp;quot;link&amp;quot;&lt;br /&gt;
new Link := Link =&amp;gt; (cl) -&amp;gt; (&lt;br /&gt;
     C:=newClass(Link,new MutableHashTable);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--braidClosure is currently the only useful way of defining a link.  &lt;br /&gt;
--I think it should be clear from the examples below how to use it.&lt;br /&gt;
--(Remember to use {}, not () or [])&lt;br /&gt;
braidClosure = L -&amp;gt;(&lt;br /&gt;
     K:=new Link;&lt;br /&gt;
     K#braid=L;&lt;br /&gt;
     K)&lt;br /&gt;
&lt;br /&gt;
--This defines all links of 7 or fewer crossings by a braid closure.&lt;br /&gt;
K01=braidClosure {1};&lt;br /&gt;
K31=braidClosure {1,1,1};&lt;br /&gt;
K41=braidClosure {1,-2,1,-2};&lt;br /&gt;
K51=braidClosure {1,1,1,1,1};&lt;br /&gt;
K52=braidClosure {-1,-1,-2,1,-2};&lt;br /&gt;
K61=braidClosure {1,1,2,-1,-3,2,-3};&lt;br /&gt;
K62=braidClosure {-1,-1,-1,2,-1,2};&lt;br /&gt;
K63=braidClosure {-1,-1,2,-1,2,2};&lt;br /&gt;
K71=braidClosure {-1,-1,-1,-1,-1,-1,-1}&lt;br /&gt;
K72=braidClosure {-1,-1,-1,-2,1,-2,-3,2,-3}&lt;br /&gt;
K73=braidClosure {1,1,1,1,1,2,-1,2}&lt;br /&gt;
K74=braidClosure {1,1,2,-1,2,2,3,-2,3}&lt;br /&gt;
K75=braidClosure {-1,-1,-1,-1,-2,1,-2,-2}&lt;br /&gt;
K76=braidClosure {-1,-1,2,-1,-3,2,-3}&lt;br /&gt;
K77=braidClosure {1,-2,1,-2,3,-2,3}&lt;br /&gt;
&lt;br /&gt;
--Now all programs using the Rouqier complex (KR, KRHom, KRpoly) take an extra argument, which should be a truth value.  &lt;br /&gt;
--If this is &amp;quot;true,&amp;quot; then the program will simplify chunks of the Rouquier complex using prescribed homotopies.  &lt;br /&gt;
--If it is &amp;quot;false,&amp;quot; it will use the old brute force method.  &lt;br /&gt;
--Preliminary results indicate that the program will run MUCH faster if you use the &amp;quot;true&amp;quot; option, &lt;br /&gt;
--but it is not 100% vetted yet.  there might well be mistakes hiding in there.  Let the user beware.&lt;br /&gt;
&lt;br /&gt;
--this program now produces a complex homotopic to the Rouquier complex of the input braid, &lt;br /&gt;
--as well as a presentation for the module that corresponds to closing the braid (in matrix form).&lt;br /&gt;
KR = (K,v) -&amp;gt; (&lt;br /&gt;
          if not K#?braid then error &amp;quot;no braid representation&amp;quot; else (&lt;br /&gt;
               Kb:=K#braid;&lt;br /&gt;
               P:=K#nbcross=#Kb;&lt;br /&gt;
               Ka:=apply(Kb,abs);&lt;br /&gt;
               Kt:=apply(Kb,i-&amp;gt;(i&amp;gt;0));&lt;br /&gt;
               Ks:=sort Ka;&lt;br /&gt;
               bind:=K#bindex=last(Ks)+1;&lt;br /&gt;
               Cvars:=new MutableList from toList (-bind..-1);&lt;br /&gt;
	       I:=0;&lt;br /&gt;
	       J:=0;&lt;br /&gt;
	       Kp:={};&lt;br /&gt;
	       newv:=0;&lt;br /&gt;
               while I&amp;lt;P do (&lt;br /&gt;
		    print I;&lt;br /&gt;
		    M:=1;&lt;br /&gt;
		    while (Kb#?(I+M) and Kb#(I+M)==Kb#I) do M=M+1;&lt;br /&gt;
		    if (M&amp;gt;1 and v) then (&lt;br /&gt;
			 print (&amp;quot;used IImod &amp;quot; | toString(M));&lt;br /&gt;
			 Kp=append(Kp, ((&amp;quot;II&amp;quot;,M),(Cvars#(Ka_I-1),Cvars#(Ka_I+1-1),newv,Kt_I)));&lt;br /&gt;
			 newvp=newv+2;&lt;br /&gt;
			 J=I+M)&lt;br /&gt;
		    else if ((Kb#?(I+2) and Ka_I==Ka_(I+2)) and v) then (&lt;br /&gt;
			 if Ka_I==Ka_(I+1)+1 then (&lt;br /&gt;
			      if (Kb_(I+1)==Kb_(I+3) and Kb_I==Kb_(I+2)) then (&lt;br /&gt;
				   print &amp;quot;used babamod&amp;quot;;&lt;br /&gt;
				   Kp=append(Kp,(&amp;quot;baba&amp;quot;,(Cvars#(Ka_I),Cvars#(Ka_I-1),Cvars#(Ka_I-2),newv+1,newv,newv+2,Kt_I,Kt_(I+1),Kt_(I+2),Kt_(I+3))));&lt;br /&gt;
				   J=I+4;&lt;br /&gt;
				   )&lt;br /&gt;
			      else (&lt;br /&gt;
			      	   print &amp;quot;used abamod&amp;quot;;&lt;br /&gt;
			      	   Kp=append(Kp,(&amp;quot;aba&amp;quot;,(Cvars#(Ka_I),Cvars#(Ka_I-1),Cvars#(Ka_I-2),newv+1,newv,newv+2,Kt_I,Kt_(I+1),Kt_(I+2))));&lt;br /&gt;
				   J=I+3;&lt;br /&gt;
				   );&lt;br /&gt;
			      Cvars#(Ka_I-2)=newv+2;&lt;br /&gt;
			      newvp=newv+3)&lt;br /&gt;
			 else if Ka_I==Ka_(I+1)-1  then (&lt;br /&gt;
			      if (Kb_(I+1)==Kb_(I+3) and Kb_I==Kb_(I+2)) then ( &lt;br /&gt;
	     		      	   print &amp;quot;used babamod&amp;quot;;&lt;br /&gt;
			      	   Kp=append(Kp,(&amp;quot;baba&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),Cvars#(Ka_I+1),newv,newv+1,newv+2,Kt_I,Kt_(I+1),Kt_(I+2),Kt_(I+3))));&lt;br /&gt;
				   J=I+4;&lt;br /&gt;
				   )&lt;br /&gt;
			      else(&lt;br /&gt;
				   print &amp;quot;used abamod&amp;quot;;&lt;br /&gt;
			      	   Kp=append(Kp,(&amp;quot;aba&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),Cvars#(Ka_I+1),newv,newv+1,newv+2,Kt_I,Kt_(I+1),Kt_(I+2))));&lt;br /&gt;
				   J=I+3;&lt;br /&gt;
				   );&lt;br /&gt;
			      Cvars#(Ka_I+1)=newv+2;&lt;br /&gt;
			      newvp=newv+3&lt;br /&gt;
			      )&lt;br /&gt;
			 else (&lt;br /&gt;
			      print &amp;quot;used stmod&amp;quot;; &lt;br /&gt;
			      Kp=append(Kp,(&amp;quot;st&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),newv,Kt_I)));&lt;br /&gt;
			      newvp=newv+2;&lt;br /&gt;
			      J=I+1)&lt;br /&gt;
			 )&lt;br /&gt;
		    else (&lt;br /&gt;
			 print &amp;quot;used stmod&amp;quot;; &lt;br /&gt;
			 Kp=append(Kp,(&amp;quot;st&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),newv,Kt_I)));&lt;br /&gt;
			 newvp=newv+2;&lt;br /&gt;
			 J=I+1);&lt;br /&gt;
                    Cvars#(Ka_I-1)=newv;&lt;br /&gt;
                    Cvars#(Ka_I)=newv+1;&lt;br /&gt;
		    I=J;&lt;br /&gt;
		    newv=newvp;&lt;br /&gt;
                    );&lt;br /&gt;
	       print Kp;&lt;br /&gt;
	       elim=newv-bind;&lt;br /&gt;
	       R:=QQ[vars(1 .. newv+bind),MonomialOrder=&amp;gt;Eliminate elim];&lt;br /&gt;
	       Kp=apply(Kp,(S1,S2) -&amp;gt; (S1,apply(S2,i-&amp;gt; (if (class i===ZZ and i&amp;lt;0) then x=i+newv+bind else x=i; x))));&lt;br /&gt;
               Kmod:= chainComplex( gradedModule(R^1));&lt;br /&gt;
	       for J from 0 to #Kp-1 do (&lt;br /&gt;
	       	    if ((Kp_J)_0)_0==&amp;quot;II&amp;quot; then  Kmod=Kmod**IImod join((Kp_J)_1,  (((Kp_J)_0)_1,R))&lt;br /&gt;
		    else if (Kp_J)_0==&amp;quot;aba&amp;quot; then Kmod=Kmod**abamod append((Kp_J)_1,R)&lt;br /&gt;
		    else if (Kp_J)_0==&amp;quot;baba&amp;quot; then Kmod=Kmod**babamod append((Kp_J)_1,R)&lt;br /&gt;
		    else if (Kp_J)_0==&amp;quot;st&amp;quot; then Kmod=Kmod**stmod append((Kp_J)_1,R)&lt;br /&gt;
		    else error &amp;quot;oops, missed a case&amp;quot;	     &lt;br /&gt;
          	    );&lt;br /&gt;
--	       scan(spots Kmod, i -&amp;gt; if Kmod#dd#?i then print (isWellDefined Kmod.dd_i));&lt;br /&gt;
     	       M:=matrix {apply(bind, I-&amp;gt; R_(Cvars#I)-R_(newv+I))};&lt;br /&gt;
               return (Kmod,M);&lt;br /&gt;
          );&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--this produces a simpler complex for an arbitrary number of twists of two adjacent strands.&lt;br /&gt;
IImod = (H,I,J,W,n,S) -&amp;gt; (&lt;br /&gt;
     i:=ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
     if W then (&lt;br /&gt;
	  C=stmod(H,I,J,W,S)**S^{-n+1};&lt;br /&gt;
     	  L=singleton(C.dd_1);&lt;br /&gt;
     	  for j from 2 to n do (&lt;br /&gt;
	       if mod(j,2)==0 then L=prepend(map(S^{-n+j}/i,S^{-n+j-1}/i,S_H-S_J),L)&lt;br /&gt;
	       else L=prepend(map(S^{-n+j}/i,S^{-n+j-1}/i,S_I-S_J),L);&lt;br /&gt;
	       );&lt;br /&gt;
	  D=chainComplex L;&lt;br /&gt;
	  )&lt;br /&gt;
     else (&lt;br /&gt;
	  C=stmod(H,I,J,W,S)**S^{n-1};&lt;br /&gt;
     	  L=singleton(C.dd_0);&lt;br /&gt;
     	  for j from 2 to n do (&lt;br /&gt;
	       if mod(j,2)==0 then L=append(L,map(S^{n-j+2}/i,S^{n-j+1}/i,S_H-S_J))&lt;br /&gt;
	       else L=append(L,map(S^{n-j+2}/i,S^{n-j+1}/i,S_I-S_J));&lt;br /&gt;
	       );&lt;br /&gt;
	  D=(chainComplex L)[n];&lt;br /&gt;
	  );&lt;br /&gt;
     D)&lt;br /&gt;
&lt;br /&gt;
--this produces the standard Rouquier complex for a single crossing&lt;br /&gt;
stmod = (H,I,J,W,S) -&amp;gt; (&lt;br /&gt;
          if W then (&lt;br /&gt;
	       Mp=S^1/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
               Np=S^{-1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	       C=chainComplex(map(Mp,Np,(S_J-S_I))))&lt;br /&gt;
          else (&lt;br /&gt;
	       Mn=S^{1}/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
               Nn=S^{1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
               C=chainComplex(map(Nn,Mn))[1]);&lt;br /&gt;
          C)&lt;br /&gt;
     &lt;br /&gt;
--this produces a simplified Rouquier for braids of length 3 lifting the longest element of S_3.&lt;br /&gt;
abamod = (G,H,I,J,K,L,W,V,X,S) -&amp;gt; (&lt;br /&gt;
     i:=ideal(S_G-S_J,S_H-S_K,S_I-S_L);&lt;br /&gt;
     j1:=ideal(S_H+S_G-S_J-S_K,S_H*S_G-S_J*S_K,S_I-S_L);&lt;br /&gt;
     j2:=ideal(S_H+S_I-S_L-S_K,S_H*S_I-S_L*S_K,S_G-S_J);&lt;br /&gt;
     k1:=ideal(S_H+S_G+S_I-S_J-S_K-S_L, (S_I-S_K)*(S_I-S_L),(S_J-S_G)*(S_J-S_H));&lt;br /&gt;
     k2:=ideal(S_H+S_G+S_I-S_J-S_K-S_L, (S_L-S_H)*(S_I-S_L),(S_J-S_G)*(S_G-S_K));&lt;br /&gt;
     l:=ideal(S_H+S_G+S_I-S_J-S_K-S_L, S_H*S_G+S_I*S_G+S_I*S_H-S_J*S_K-S_L*S_J-S_K*S_L, S_H*S_G*S_I-S_J*S_K*S_L);&lt;br /&gt;
     if ((not W) and (not V) and (not X)) then (&lt;br /&gt;
	  M0=S^{3}/i;&lt;br /&gt;
	  M1=S^{3}/j1++S^{3}/j2;&lt;br /&gt;
	  M2=S^{3}/k1++S^{3}/k2;	  &lt;br /&gt;
	  M3=S^{3}/l;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{1_S,-1}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{1_S,-1},{1,-1}});&lt;br /&gt;
	  f3=map(M2,M3,matrix{{1_S},{1}});&lt;br /&gt;
	  C=chainComplex(f1,f2,f3)[3]&lt;br /&gt;
	  )&lt;br /&gt;
     else if (W and V and X) then (&lt;br /&gt;
	  M0=S^1/l;&lt;br /&gt;
	  M1=S^{-1}/k1++S^{-1}/k2;&lt;br /&gt;
	  M2=S^{-2}/j1++S^{-2}/j2;&lt;br /&gt;
	  M3=S^{-3}/i;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{S_I-S_J,-S_G+S_L}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{S_I-S_K,-S_H+S_J},{S_H-S_L,-S_G+S_K}});&lt;br /&gt;
	  f3=map(M2,M3,matrix{{-S_K+S_G},{-S_L+S_H}});&lt;br /&gt;
	  C=chainComplex(f1,f2,f3)&lt;br /&gt;
	  )      &lt;br /&gt;
     else if ((not W) and (not V) and X) then (&lt;br /&gt;
	  M0=S^{2}/k2++S^{1}/i;&lt;br /&gt;
	  M1=S^{2}/l++S^{1}/j1++S^{1}/j2;&lt;br /&gt;
	  M2=S^{1}/k1;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{1,S_H-S_L,S_G-S_K},{0,-1,1}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{S_I-S_J},{1},{1}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1]&lt;br /&gt;
	  )&lt;br /&gt;
     else if (W and (not V) and (not X)) then (&lt;br /&gt;
	  M0=S^{2}/k1++S^{1}/i;&lt;br /&gt;
	  M1=S^{2}/l++S^{1}/j1++S^{1}/j2;&lt;br /&gt;
	  M2=S^{1}/k2;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{1,S_I-S_K,S_H-S_J},{0,-1,1}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{S_G-S_L},{1},{1}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1]&lt;br /&gt;
	  )&lt;br /&gt;
     else if (W and V and (not X)) then (&lt;br /&gt;
     	  M2=S^{0}/k2++S^{-1}/i;&lt;br /&gt;
	  M1=S^{1}/l++S^{0}/j1++S^{0}/j2;&lt;br /&gt;
	  M0=S^{1}/k1;&lt;br /&gt;
	  f1=map(M0,M1,matrix {{-1,-S_I+S_K,S_J-S_H}});&lt;br /&gt;
	  f2=map(M1,M2,matrix {{S_G-S_L,0},{1,S_H-S_J},{1,-S_I+S_K}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1])&lt;br /&gt;
     else if ((not W) and V and X) then (&lt;br /&gt;
     	  M2=S^{0}/k1++S^{-1}/i;&lt;br /&gt;
	  M1=S^{1}/l++S^{0}/j1++S^{0}/j2;&lt;br /&gt;
	  M0=S^{1}/k2;&lt;br /&gt;
	  f1=map(M0,M1,matrix {{-1,-S_L+S_H,S_G-S_K}});&lt;br /&gt;
	  f2=map(M1,M2,matrix {{S_J-S_I,0},{1,S_K-S_G},{1,-S_L+S_H}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1]&lt;br /&gt;
	  )&lt;br /&gt;
     else if ((not W) and V and (not X)) then (&lt;br /&gt;
	  C=new ChainComplex;&lt;br /&gt;
	  C.ring=S;&lt;br /&gt;
C#0 = cokernel map(S^{{1}, {1}, {2}}, S^{{1}, {0}, {0}, {0}, {0}, {0}, {-1}, {-1}, {-1}}, {{0, S_H+S_G-S_K-S_J, 0, 0, 0, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, 0, -S_H*S_G+S_K*S_J, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2, 0}});&lt;br /&gt;
      C#1 = cokernel map(S^{{0}}, S^{{-1}, {-1}, {-2}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}});&lt;br /&gt;
      C#-2 = cokernel map(S^{{2}}, S^{{1}, {1}, {0}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}});&lt;br /&gt;
      C#-1 = cokernel map(S^{{1}, {2}, {2}}, S^{{1}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}});&lt;br /&gt;
      C#dd#0 = map(cokernel map(S^{{1}, {2}, {2}}, S^{{1}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}}), cokernel map(S^{{1}, {1}, {2}}, S^{{1}, {0}, {0}, {0}, {0}, {0}, {-1}, {-1}, {-1}}, {{0, S_H+S_G-S_K-S_J, 0, 0, 0, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, 0, -S_H*S_G+S_K*S_J, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2, 0}}), {{-1, 0, 0}, {S_H+S_G-S_J-S_L, -S_K, -1}, {0, S_G-S_K-S_J, -1}});&lt;br /&gt;
      C#dd#1 = map(cokernel map(S^{{1}, {1}, {2}}, S^{{1}, {0}, {0}, {0}, {0}, {0}, {-1}, {-1}, {-1}}, {{0, S_H+S_G-S_K-S_J, 0, 0, 0, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, 0, -S_H*S_G+S_K*S_J, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2, 0}}), cokernel map(S^{{0}}, S^{{-1}, {-1}, {-2}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}}), {{S_G-S_J}, {S_G-S_L}, {S_G^2-S_G*S_K-S_G*S_J-S_G*S_L+S_K*S_L+S_J*S_L}});&lt;br /&gt;
      C#dd#-1 = map(cokernel map(S^{{2}}, S^{{1}, {1}, {0}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}}), cokernel map(S^{{1}, {2}, {2}}, S^{{1}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}}), {{-S_H+S_L, -1, 1}});)&lt;br /&gt;
     else if (W and (not V) and X) then ( &lt;br /&gt;
	  C=new ChainComplex;&lt;br /&gt;
	  C.ring=S;&lt;br /&gt;
	  C#0 = cokernel map(S^{{0}, {0}, {1}}, S^{{0}, {-1}, {-1}, {-1}, {-1}, {-1}, {-2}, {-2}, {-2}}, {{0, S_H+S_G-S_K-S_J, 0, S_I-S_L, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, 0, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, -S_H*S_G+S_K*S_J}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2}});&lt;br /&gt;
       	  C#1 = cokernel map(S^{{-1}, {0}, {0}}, S^{{-1}, {-1}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}});&lt;br /&gt;
       	  C#2 = cokernel map(S^{{-1}}, S^{{-2}, {-2}, {-3}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}});&lt;br /&gt;
       	  C#-1 = cokernel map(S^{{1}}, S^{{0}, {0}, {-1}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}});&lt;br /&gt;
       	  C#dd#0 = map(cokernel map(S^{{1}}, S^{{0}, {0}, {-1}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}}), cokernel map(S^{{0}, {0}, {1}}, S^{{0}, {-1}, {-1}, {-1}, {-1}, {-1}, {-2}, {-2}, {-2}}, {{0, S_H+S_G-S_K-S_J, 0, S_I-S_L, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, 0, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, -S_H*S_G+S_K*S_J}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2}}), {{S_G-S_J, -S_J, -1}});&lt;br /&gt;
       	  C#dd#1 = map(cokernel map(S^{{0}, {0}, {1}}, S^{{0}, {-1}, {-1}, {-1}, {-1}, {-1}, {-2}, {-2}, {-2}}, {{0, S_H+S_G-S_K-S_J, 0, S_I-S_L, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, 0, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, -S_H*S_G+S_K*S_J}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2}}), cokernel map(S^{{-1}, {0}, {0}}, S^{{-1}, {-1}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}}), {{S_G-S_K, 1, 0}, {0, -1, -1}, {0, -S_H+S_K+S_J, S_J}});&lt;br /&gt;
       	  C#dd#2 = map(cokernel map(S^{{-1}, {0}, {0}}, S^{{-1}, {-1}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}}), cokernel map(S^{{-1}}, S^{{-2}, {-2}, {-3}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}}), {{1}, {-S_G+S_K}, {-S_H+S_J}});&lt;br /&gt;
      	  )&lt;br /&gt;
     else error &amp;quot;looks like I forgot a case&amp;quot;;&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--these extend Macaulay2&#039;s ability to take tensor products and induced maps.&lt;br /&gt;
ChainComplex ** Matrix := ChainComplexMap =&amp;gt; (C,f) -&amp;gt;(&lt;br /&gt;
     map(C ** target f,C** source f,i -&amp;gt; id_(C_i)**f))&lt;br /&gt;
&lt;br /&gt;
RingMap ** GradedModule := GradedModule =&amp;gt; (f,C) -&amp;gt; (&lt;br /&gt;
     D := new GradedModule;&lt;br /&gt;
     D#ring= target f;&lt;br /&gt;
     scan(spots C, i-&amp;gt;D#i=f**C#i);&lt;br /&gt;
     D) &lt;br /&gt;
&lt;br /&gt;
inducedchainMap = (C,D) -&amp;gt; (&lt;br /&gt;
     map(&lt;br /&gt;
          C,D,i-&amp;gt;( inducedMap(C_i,D_i)) --print &amp;quot;found another induced map&amp;quot;;&lt;br /&gt;
          )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
chainhomology = (FB,GB) -&amp;gt; (&lt;br /&gt;
          CB:=source FB;&lt;br /&gt;
          H:=inducedchainMap(ker FB,image GB,id_CB);&lt;br /&gt;
          E:=coker H;&lt;br /&gt;
	  E)&lt;br /&gt;
&lt;br /&gt;
--this has input a chain complex C and a sequence M.  &lt;br /&gt;
--The output is the complexes Tor^i(C,coker M) if M is a regular sequence.&lt;br /&gt;
Torify = (C,M) -&amp;gt; (&lt;br /&gt;
     J:=rank source M;&lt;br /&gt;
     KD:=apply(J+2,I-&amp;gt;(print (&amp;quot;took tensor product &amp;quot; | toString I); C**koszul(I,M)));&lt;br /&gt;
     Lt=apply(J+1,I-&amp;gt;(&lt;br /&gt;
          F:=KD_I;&lt;br /&gt;
          G:=KD_(I+1);&lt;br /&gt;
          E:=inducedchainMap(ker F,image G);&lt;br /&gt;
	  print (&amp;quot;found E &amp;quot; | toString I);&lt;br /&gt;
	  H:=coker E;&lt;br /&gt;
	  print (&amp;quot;found K-homology &amp;quot; | toString I);&lt;br /&gt;
	  H));&lt;br /&gt;
      Lt)&lt;br /&gt;
&lt;br /&gt;
--This has input a braid, output the K-homology of KR double complex (i.e. the complexes of Tor&#039;s)&lt;br /&gt;
KRHom = (K,v) -&amp;gt; (&lt;br /&gt;
          L:=Torify(KR(K,v));&lt;br /&gt;
          M:=apply(L,homology);&lt;br /&gt;
          N:=apply(M,prune);&lt;br /&gt;
	  K#KRHom=N;&lt;br /&gt;
          N)&lt;br /&gt;
&lt;br /&gt;
spots = C -&amp;gt; select(keys C, i -&amp;gt; class i === ZZ)&lt;br /&gt;
&lt;br /&gt;
degrees(GradedModule) := Function =&amp;gt; C -&amp;gt; (&lt;br /&gt;
     i -&amp;gt; degrees C_i)&lt;br /&gt;
&lt;br /&gt;
--input, a knot K. output ((1-t)/(1+q*t))*(the graded Hilbert &lt;br /&gt;
--polynomial of K).  THIS CURRENTLY ONLY WORKS FOR KNOTS, NOT LINKS.&lt;br /&gt;
KRpoly = (K,v) -&amp;gt; (&lt;br /&gt;
     L:=KRHom(K,v);&lt;br /&gt;
     R:=ring L_0;&lt;br /&gt;
     print &amp;quot;hello&amp;quot;;&lt;br /&gt;
     Rn:=#generators R;&lt;br /&gt;
     S:=QQ[t];&lt;br /&gt;
     f=map(S,R,apply(toList (1..Rn),i-&amp;gt;t));&lt;br /&gt;
     M:=apply(L, C -&amp;gt; f**C);&lt;br /&gt;
     N:=apply(M,degrees);&lt;br /&gt;
     K#KRdeg=N;&lt;br /&gt;
     Pring=QQ[q,s,t,Inverses=&amp;gt;true];&lt;br /&gt;
     spoM:=sort (spots M_0);&lt;br /&gt;
     P:=sum(apply(toList (0..#M-1), i-&amp;gt; (&lt;br /&gt;
		    q^i*sum(apply(spoM, j-&amp;gt; (&lt;br /&gt;
				   s^j*sum(apply(flatten N_i j, k-&amp;gt;t^k))&lt;br /&gt;
				   )&lt;br /&gt;
			 ))&lt;br /&gt;
	       )&lt;br /&gt;
	)); &lt;br /&gt;
     K#KRpoly=P;&lt;br /&gt;
     P//(q*t+1))&lt;br /&gt;
&lt;br /&gt;
--Basically the same as KRHom with more readable output.&lt;br /&gt;
KRdisp =(K,v) -&amp;gt; (&lt;br /&gt;
     L:=KRHom (K,v);&lt;br /&gt;
     N:=stack(between(&amp;quot; &amp;quot;, apply(#L,i-&amp;gt;net i | &amp;quot;  &amp;quot; | net L_i)));&lt;br /&gt;
     N)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=49324</id>
		<title>User:Ben/KRhomology</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=49324"/>
		<updated>2006-01-30T23:23:24Z</updated>

		<summary type="html">&lt;p&gt;Ben: /* Macaulay2 program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Calculations==&lt;br /&gt;
Since calculations have now been incorporated into the normal KAtlas data structure, I don&#039;t feel like there&#039;s much point in having a table of them here.&lt;br /&gt;
&lt;br /&gt;
==Macaulay2 program==&lt;br /&gt;
Save this as a file (called KR.m2), open Macaulay2 (in command line or emacs), and type &amp;lt;code&amp;gt;load &amp;quot;KR.m2&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;KRpoly&amp;lt;/code&amp;gt; is probabby the command you want (but it only works for knots at the moment). It outputs &amp;lt;math&amp;gt;\frac{1-t}{qt+1}KR_K(q,s,t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using &amp;lt;code&amp;gt;texMath&amp;lt;/code&amp;gt; puts things in format for LaTeX.  &lt;br /&gt;
&lt;br /&gt;
Changes from the previous version: the important change is in the construction of the Rouquier complex.  Now it works by breaking up the braid into (at the moment, very simple) patterns it recognizes, and uses simplified Rouquier complexes for those chunks.  This seems to be make a big difference in computational time, indicating that a program that could simplify large Rouquier complexes could lead to very large computational savings.  I&#039;ve made some progress in this direction, but am still struggling to produce something truly robust.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample session:&lt;br /&gt;
&amp;lt;pre&amp;gt;Macaulay 2, version 0.9&lt;br /&gt;
--Copyright 1993-2001, D. R. Grayson and M. E. Stillman&lt;br /&gt;
--Singular-Factory 1.3b, copyright 1993-2001, G.-M. Greuel, et al.&lt;br /&gt;
--Singular-Libfac 0.3.2, copyright 1996-2001, M. Messollen&lt;br /&gt;
&lt;br /&gt;
i1 : load &amp;quot;KR.m2&amp;quot;&lt;br /&gt;
KR.m2:113:11: warning: local declaration of N shields variable with same name&lt;br /&gt;
--loaded KR.m2&lt;br /&gt;
&lt;br /&gt;
i2 : texMath KRpoly (K01,true)&lt;br /&gt;
&lt;br /&gt;
o2 = 1&lt;br /&gt;
&lt;br /&gt;
i3 : texMath KRpoly (K31,true)&lt;br /&gt;
&lt;br /&gt;
o3 = s^{2} t^{2}+{q} t^{2}+1&lt;br /&gt;
&lt;br /&gt;
i4 : &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the code for the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--This file defines a new object for Macaulay2, called a &amp;quot;Link.&amp;quot;&lt;br /&gt;
--Like all objects in Macaulay2, a Link is just a hash table.&lt;br /&gt;
--Defining a link lets you store information about it for later use.  &lt;br /&gt;
&lt;br /&gt;
Link = new Type of MutableHashTable &lt;br /&gt;
Link.synonym = &amp;quot;link&amp;quot;&lt;br /&gt;
new Link := Link =&amp;gt; (cl) -&amp;gt; (&lt;br /&gt;
     C:=newClass(Link,new MutableHashTable);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--braidClosure is currently the only useful way of defining a link.  &lt;br /&gt;
--I think it should be clear from the examples below how to use it.&lt;br /&gt;
--(Remember to use {}, not () or [])&lt;br /&gt;
braidClosure = L -&amp;gt;(&lt;br /&gt;
     K:=new Link;&lt;br /&gt;
     K#braid=L;&lt;br /&gt;
     K)&lt;br /&gt;
&lt;br /&gt;
--This defines all links of 7 or fewer crossings by a braid closure.&lt;br /&gt;
K01=braidClosure {1};&lt;br /&gt;
K31=braidClosure {1,1,1};&lt;br /&gt;
K41=braidClosure {1,-2,1,-2};&lt;br /&gt;
K51=braidClosure {1,1,1,1,1};&lt;br /&gt;
K52=braidClosure {-1,-1,-2,1,-2};&lt;br /&gt;
K61=braidClosure {1,1,2,-1,-3,2,-3};&lt;br /&gt;
K62=braidClosure {-1,-1,-1,2,-1,2};&lt;br /&gt;
K63=braidClosure {-1,-1,2,-1,2,2};&lt;br /&gt;
K71=braidClosure {-1,-1,-1,-1,-1,-1,-1}&lt;br /&gt;
K72=braidClosure {-1,-1,-1,-2,1,-2,-3,2,-3}&lt;br /&gt;
K73=braidClosure {1,1,1,1,1,2,-1,2}&lt;br /&gt;
K74=braidClosure {1,1,2,-1,2,2,3,-2,3}&lt;br /&gt;
K75=braidClosure {-1,-1,-1,-1,-2,1,-2,-2}&lt;br /&gt;
K76=braidClosure {-1,-1,2,-1,-3,2,-3}&lt;br /&gt;
K77=braidClosure {1,-2,1,-2,3,-2,3}&lt;br /&gt;
&lt;br /&gt;
--Now all programs using the Rouqier complex (KR, KRHom, KRpoly) take an extra argument, which should be a truth value.  &lt;br /&gt;
--If this is &amp;quot;true,&amp;quot; then the program will simplify chunks of the Rouquier complex using prescribed homotopies.  &lt;br /&gt;
--If it is &amp;quot;false,&amp;quot; it will use the old brute force method.  &lt;br /&gt;
--Preliminary results indicate that the program will run MUCH faster if you use the &amp;quot;true&amp;quot; option, &lt;br /&gt;
--but it is not 100% vetted yet.  there might well be mistakes hiding in there.  Let the user beware.&lt;br /&gt;
&lt;br /&gt;
--this program now produces a complex homotopic to the Rouquier complex of the input braid, &lt;br /&gt;
--as well as a presentation for the module that corresponds to closing the braid (in matrix form).&lt;br /&gt;
KR = (K,v) -&amp;gt; (&lt;br /&gt;
          if not K#?braid then error &amp;quot;no braid representation&amp;quot; else (&lt;br /&gt;
               Kb:=K#braid;&lt;br /&gt;
               P:=K#nbcross=#Kb;&lt;br /&gt;
               Ka:=apply(Kb,abs);&lt;br /&gt;
               Kt:=apply(Kb,i-&amp;gt;(i&amp;gt;0));&lt;br /&gt;
               Ks:=sort Ka;&lt;br /&gt;
               bind:=K#bindex=last(Ks)+1;&lt;br /&gt;
               Cvars:=new MutableList from toList (-bind..-1);&lt;br /&gt;
	       I:=0;&lt;br /&gt;
	       J:=0;&lt;br /&gt;
	       Kp:={};&lt;br /&gt;
	       newv:=0;&lt;br /&gt;
               while I&amp;lt;P do (&lt;br /&gt;
		    print I;&lt;br /&gt;
		    M:=1;&lt;br /&gt;
		    while (Kb#?(I+M) and Kb#(I+M)==Kb#I) do M=M+1;&lt;br /&gt;
		    if (M&amp;gt;1 and v) then (&lt;br /&gt;
			 print (&amp;quot;used IImod &amp;quot; | toString(M));&lt;br /&gt;
			 Kp=append(Kp, ((&amp;quot;II&amp;quot;,M),(Cvars#(Ka_I-1),Cvars#(Ka_I+1-1),newv,Kt_I)));&lt;br /&gt;
			 newvp=newv+2;&lt;br /&gt;
			 J=I+M)&lt;br /&gt;
		    else if ((Kb#?(I+2) and Ka_I==Ka_(I+2)) and v) then (&lt;br /&gt;
			 if Ka_I==Ka_(I+1)+1 then (&lt;br /&gt;
			      if (Kb_(I+1)==Kb_(I+3) and Kb_I==Kb_(I+2)) then (&lt;br /&gt;
				   print &amp;quot;used babamod&amp;quot;;&lt;br /&gt;
				   Kp=append(Kp,(&amp;quot;baba&amp;quot;,(Cvars#(Ka_I),Cvars#(Ka_I-1),Cvars#(Ka_I-2),newv+1,newv,newv+2,Kt_I,Kt_(I+1),Kt_(I+2),Kt_(I+3))));&lt;br /&gt;
				   J=I+4;&lt;br /&gt;
				   )&lt;br /&gt;
			      else (&lt;br /&gt;
			      	   print &amp;quot;used abamod&amp;quot;;&lt;br /&gt;
			      	   Kp=append(Kp,(&amp;quot;aba&amp;quot;,(Cvars#(Ka_I),Cvars#(Ka_I-1),Cvars#(Ka_I-2),newv+1,newv,newv+2,Kt_I,Kt_(I+1),Kt_(I+2))));&lt;br /&gt;
				   J=I+3;&lt;br /&gt;
				   );&lt;br /&gt;
			      Cvars#(Ka_I-2)=newv+2;&lt;br /&gt;
			      newvp=newv+3)&lt;br /&gt;
			 else if Ka_I==Ka_(I+1)-1  then (&lt;br /&gt;
			      if (Kb_(I+1)==Kb_(I+3) and Kb_I==Kb_(I+2)) then ( &lt;br /&gt;
	     		      	   print &amp;quot;used babamod&amp;quot;;&lt;br /&gt;
			      	   Kp=append(Kp,(&amp;quot;baba&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),Cvars#(Ka_I+1),newv,newv+1,newv+2,Kt_I,Kt_(I+1),Kt_(I+2),Kt_(I+3))));&lt;br /&gt;
				   J=I+4;&lt;br /&gt;
				   )&lt;br /&gt;
			      else(&lt;br /&gt;
				   print &amp;quot;used abamod&amp;quot;;&lt;br /&gt;
			      	   Kp=append(Kp,(&amp;quot;aba&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),Cvars#(Ka_I+1),newv,newv+1,newv+2,Kt_I,Kt_(I+1),Kt_(I+2))));&lt;br /&gt;
				   J=I+3;&lt;br /&gt;
				   );&lt;br /&gt;
			      Cvars#(Ka_I+1)=newv+2;&lt;br /&gt;
			      newvp=newv+3&lt;br /&gt;
			      )&lt;br /&gt;
			 else (&lt;br /&gt;
			      print &amp;quot;used stmod&amp;quot;; &lt;br /&gt;
			      Kp=append(Kp,(&amp;quot;st&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),newv,Kt_I)));&lt;br /&gt;
			      newvp=newv+2;&lt;br /&gt;
			      J=I+1)&lt;br /&gt;
			 )&lt;br /&gt;
		    else (&lt;br /&gt;
			 print &amp;quot;used stmod&amp;quot;; &lt;br /&gt;
			 Kp=append(Kp,(&amp;quot;st&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),newv,Kt_I)));&lt;br /&gt;
			 newvp=newv+2;&lt;br /&gt;
			 J=I+1);&lt;br /&gt;
                    Cvars#(Ka_I-1)=newv;&lt;br /&gt;
                    Cvars#(Ka_I)=newv+1;&lt;br /&gt;
		    I=J;&lt;br /&gt;
		    newv=newvp;&lt;br /&gt;
                    );&lt;br /&gt;
	       print Kp;&lt;br /&gt;
	       elim=newv-bind;&lt;br /&gt;
	       R:=QQ[vars(1 .. newv+bind),MonomialOrder=&amp;gt;Eliminate elim];&lt;br /&gt;
	       Kp=apply(Kp,(S1,S2) -&amp;gt; (S1,apply(S2,i-&amp;gt; (if (class i===ZZ and i&amp;lt;0) then x=i+newv+bind else x=i; x))));&lt;br /&gt;
               Kmod:= chainComplex( gradedModule(R^1));&lt;br /&gt;
	       for J from 0 to #Kp-1 do (&lt;br /&gt;
	       	    if ((Kp_J)_0)_0==&amp;quot;II&amp;quot; then  Kmod=Kmod**IImod join((Kp_J)_1,  (((Kp_J)_0)_1,R))&lt;br /&gt;
		    else if (Kp_J)_0==&amp;quot;aba&amp;quot; then Kmod=Kmod**abamod append((Kp_J)_1,R)&lt;br /&gt;
		    else if (Kp_J)_0==&amp;quot;baba&amp;quot; then Kmod=Kmod**babamod append((Kp_J)_1,R)&lt;br /&gt;
		    else if (Kp_J)_0==&amp;quot;st&amp;quot; then Kmod=Kmod**stmod append((Kp_J)_1,R)&lt;br /&gt;
		    else error &amp;quot;oops, missed a case&amp;quot;	     &lt;br /&gt;
          	    );&lt;br /&gt;
--	       scan(spots Kmod, i -&amp;gt; if Kmod#dd#?i then print (isWellDefined Kmod.dd_i));&lt;br /&gt;
     	       M:=matrix {apply(bind, I-&amp;gt; R_(Cvars#I)-R_(newv+I))};&lt;br /&gt;
               return (Kmod,M);&lt;br /&gt;
          );&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--this produces a simpler complex for an arbitrary number of twists of two adjacent strands.&lt;br /&gt;
IImod = (H,I,J,W,n,S) -&amp;gt; (&lt;br /&gt;
     i:=ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
     if W then (&lt;br /&gt;
	  C=stmod(H,I,J,W,S)**S^{-n+1};&lt;br /&gt;
     	  L=singleton(C.dd_1);&lt;br /&gt;
     	  for j from 2 to n do (&lt;br /&gt;
	       if mod(j,2)==0 then L=prepend(map(S^{-n+j}/i,S^{-n+j-1}/i,S_H-S_J),L)&lt;br /&gt;
	       else L=prepend(map(S^{-n+j}/i,S^{-n+j-1}/i,S_I-S_J),L);&lt;br /&gt;
	       );&lt;br /&gt;
	  D=chainComplex L;&lt;br /&gt;
	  )&lt;br /&gt;
     else (&lt;br /&gt;
	  C=stmod(H,I,J,W,S)**S^{n-1};&lt;br /&gt;
     	  L=singleton(C.dd_0);&lt;br /&gt;
     	  for j from 2 to n do (&lt;br /&gt;
	       if mod(j,2)==0 then L=append(L,map(S^{n-j+2}/i,S^{n-j+1}/i,S_H-S_J))&lt;br /&gt;
	       else L=append(L,map(S^{n-j+2}/i,S^{n-j+1}/i,S_I-S_J));&lt;br /&gt;
	       );&lt;br /&gt;
	  D=(chainComplex L)[n];&lt;br /&gt;
	  );&lt;br /&gt;
     D)&lt;br /&gt;
&lt;br /&gt;
--this produces the standard Rouquier complex for a single crossing&lt;br /&gt;
stmod = (H,I,J,W,S) -&amp;gt; (&lt;br /&gt;
          if W then (&lt;br /&gt;
	       Mp=S^1/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
               Np=S^{-1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	       C=chainComplex(map(Mp,Np,(S_J-S_I))))&lt;br /&gt;
          else (&lt;br /&gt;
	       Mn=S^{1}/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
               Nn=S^{1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
               C=chainComplex(map(Nn,Mn))[1]);&lt;br /&gt;
          C)&lt;br /&gt;
     &lt;br /&gt;
--this produces a simplified Rouquier for braids of length 3 lifting the longest element of S_3.&lt;br /&gt;
abamod = (G,H,I,J,K,L,W,V,X,S) -&amp;gt; (&lt;br /&gt;
     i:=ideal(S_G-S_J,S_H-S_K,S_I-S_L);&lt;br /&gt;
     j1:=ideal(S_H+S_G-S_J-S_K,S_H*S_G-S_J*S_K,S_I-S_L);&lt;br /&gt;
     j2:=ideal(S_H+S_I-S_L-S_K,S_H*S_I-S_L*S_K,S_G-S_J);&lt;br /&gt;
     k1:=ideal(S_H+S_G+S_I-S_J-S_K-S_L, (S_I-S_K)*(S_I-S_L),(S_J-S_G)*(S_J-S_H));&lt;br /&gt;
     k2:=ideal(S_H+S_G+S_I-S_J-S_K-S_L, (S_L-S_H)*(S_I-S_L),(S_J-S_G)*(S_G-S_K));&lt;br /&gt;
     l:=ideal(S_H+S_G+S_I-S_J-S_K-S_L, S_H*S_G+S_I*S_G+S_I*S_H-S_J*S_K-S_L*S_J-S_K*S_L, S_H*S_G*S_I-S_J*S_K*S_L);&lt;br /&gt;
     if ((not W) and (not V) and (not X)) then (&lt;br /&gt;
	  M0=S^{3}/i;&lt;br /&gt;
	  M1=S^{3}/j1++S^{3}/j2;&lt;br /&gt;
	  M2=S^{3}/k1++S^{3}/k2;	  &lt;br /&gt;
	  M3=S^{3}/l;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{1_S,-1}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{1_S,-1},{1,-1}});&lt;br /&gt;
	  f3=map(M2,M3,matrix{{1_S},{1}});&lt;br /&gt;
	  C=chainComplex(f1,f2,f3)[3]&lt;br /&gt;
	  )&lt;br /&gt;
     else if (W and V and X) then (&lt;br /&gt;
	  M0=S^1/l;&lt;br /&gt;
	  M1=S^{-1}/k1++S^{-1}/k2;&lt;br /&gt;
	  M2=S^{-2}/j1++S^{-2}/j2;&lt;br /&gt;
	  M3=S^{-3}/i;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{S_I-S_J,-S_G+S_L}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{S_I-S_K,-S_H+S_J},{S_H-S_L,-S_G+S_K}});&lt;br /&gt;
	  f3=map(M2,M3,matrix{{-S_K+S_G},{-S_L+S_H}});&lt;br /&gt;
	  C=chainComplex(f1,f2,f3)&lt;br /&gt;
	  )      &lt;br /&gt;
     else if ((not W) and (not V) and X) then (&lt;br /&gt;
	  M0=S^{2}/k2++S^{1}/i;&lt;br /&gt;
	  M1=S^{2}/l++S^{1}/j1++S^{1}/j2;&lt;br /&gt;
	  M2=S^{1}/k1;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{1,S_H-S_L,S_G-S_K},{0,-1,1}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{S_I-S_J},{1},{1}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1]&lt;br /&gt;
	  )&lt;br /&gt;
     else if (W and (not V) and (not X)) then (&lt;br /&gt;
	  M0=S^{2}/k1++S^{1}/i;&lt;br /&gt;
	  M1=S^{2}/l++S^{1}/j1++S^{1}/j2;&lt;br /&gt;
	  M2=S^{1}/k2;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{1,S_I-S_K,S_H-S_J},{0,-1,1}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{S_G-S_L},{1},{1}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1]&lt;br /&gt;
	  )&lt;br /&gt;
     else if (W and V and (not X)) then (&lt;br /&gt;
     	  M2=S^{0}/k2++S^{-1}/i;&lt;br /&gt;
	  M1=S^{1}/l++S^{0}/j1++S^{0}/j2;&lt;br /&gt;
	  M0=S^{1}/k1;&lt;br /&gt;
	  f1=map(M0,M1,matrix {{-1,-S_I+S_K,S_J-S_H}});&lt;br /&gt;
	  f2=map(M1,M2,matrix {{S_G-S_L,0},{1,S_H-S_J},{1,-S_I+S_K}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1])&lt;br /&gt;
     else if ((not W) and V and X) then (&lt;br /&gt;
     	  M2=S^{0}/k1++S^{-1}/i;&lt;br /&gt;
	  M1=S^{1}/l++S^{0}/j1++S^{0}/j2;&lt;br /&gt;
	  M0=S^{1}/k2;&lt;br /&gt;
	  f1=map(M0,M1,matrix {{-1,-S_L+S_H,S_G-S_K}});&lt;br /&gt;
	  f2=map(M1,M2,matrix {{S_J-S_I,0},{1,S_K-S_G},{1,-S_L+S_H}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1]&lt;br /&gt;
	  )&lt;br /&gt;
     else if ((not W) and V and (not X)) then (&lt;br /&gt;
	  C=new ChainComplex;&lt;br /&gt;
	  C.ring=S;&lt;br /&gt;
C#0 = cokernel map(S^{{1}, {1}, {2}}, S^{{1}, {0}, {0}, {0}, {0}, {0}, {-1}, {-1}, {-1}}, {{0, S_H+S_G-S_K-S_J, 0, 0, 0, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, 0, -S_H*S_G+S_K*S_J, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2, 0}});&lt;br /&gt;
      C#1 = cokernel map(S^{{0}}, S^{{-1}, {-1}, {-2}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}});&lt;br /&gt;
      C#-2 = cokernel map(S^{{2}}, S^{{1}, {1}, {0}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}});&lt;br /&gt;
      C#-1 = cokernel map(S^{{1}, {2}, {2}}, S^{{1}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}});&lt;br /&gt;
      C#dd#0 = map(cokernel map(S^{{1}, {2}, {2}}, S^{{1}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}}), cokernel map(S^{{1}, {1}, {2}}, S^{{1}, {0}, {0}, {0}, {0}, {0}, {-1}, {-1}, {-1}}, {{0, S_H+S_G-S_K-S_J, 0, 0, 0, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, 0, -S_H*S_G+S_K*S_J, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2, 0}}), {{-1, 0, 0}, {S_H+S_G-S_J-S_L, -S_K, -1}, {0, S_G-S_K-S_J, -1}});&lt;br /&gt;
      C#dd#1 = map(cokernel map(S^{{1}, {1}, {2}}, S^{{1}, {0}, {0}, {0}, {0}, {0}, {-1}, {-1}, {-1}}, {{0, S_H+S_G-S_K-S_J, 0, 0, 0, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, 0, -S_H*S_G+S_K*S_J, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2, 0}}), cokernel map(S^{{0}}, S^{{-1}, {-1}, {-2}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}}), {{S_G-S_J}, {S_G-S_L}, {S_G^2-S_G*S_K-S_G*S_J-S_G*S_L+S_K*S_L+S_J*S_L}});&lt;br /&gt;
      C#dd#-1 = map(cokernel map(S^{{2}}, S^{{1}, {1}, {0}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}}), cokernel map(S^{{1}, {2}, {2}}, S^{{1}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}}), {{-S_H+S_L, -1, 1}});)&lt;br /&gt;
     else if (W and (not V) and X) then ( &lt;br /&gt;
	  C=new ChainComplex;&lt;br /&gt;
	  C.ring=S;&lt;br /&gt;
	  C#0 = cokernel map(S^{{0}, {0}, {1}}, S^{{0}, {-1}, {-1}, {-1}, {-1}, {-1}, {-2}, {-2}, {-2}}, {{0, S_H+S_G-S_K-S_J, 0, S_I-S_L, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, 0, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, -S_H*S_G+S_K*S_J}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2}});&lt;br /&gt;
       	  C#1 = cokernel map(S^{{-1}, {0}, {0}}, S^{{-1}, {-1}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}});&lt;br /&gt;
       	  C#2 = cokernel map(S^{{-1}}, S^{{-2}, {-2}, {-3}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}});&lt;br /&gt;
       	  C#-1 = cokernel map(S^{{1}}, S^{{0}, {0}, {-1}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}});&lt;br /&gt;
       	  C#dd#0 = map(cokernel map(S^{{1}}, S^{{0}, {0}, {-1}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}}), cokernel map(S^{{0}, {0}, {1}}, S^{{0}, {-1}, {-1}, {-1}, {-1}, {-1}, {-2}, {-2}, {-2}}, {{0, S_H+S_G-S_K-S_J, 0, S_I-S_L, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, 0, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, -S_H*S_G+S_K*S_J}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2}}), {{S_G-S_J, -S_J, -1}});&lt;br /&gt;
       	  C#dd#1 = map(cokernel map(S^{{0}, {0}, {1}}, S^{{0}, {-1}, {-1}, {-1}, {-1}, {-1}, {-2}, {-2}, {-2}}, {{0, S_H+S_G-S_K-S_J, 0, S_I-S_L, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, 0, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, -S_H*S_G+S_K*S_J}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2}}), cokernel map(S^{{-1}, {0}, {0}}, S^{{-1}, {-1}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}}), {{S_G-S_K, 1, 0}, {0, -1, -1}, {0, -S_H+S_K+S_J, S_J}});&lt;br /&gt;
       	  C#dd#2 = map(cokernel map(S^{{-1}, {0}, {0}}, S^{{-1}, {-1}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}}), cokernel map(S^{{-1}}, S^{{-2}, {-2}, {-3}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}}), {{1}, {-S_G+S_K}, {-S_H+S_J}});&lt;br /&gt;
      	  )&lt;br /&gt;
     else error &amp;quot;looks like I forgot a case&amp;quot;;&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--these extend Macaulay2&#039;s ability to take tensor products and induced maps.&lt;br /&gt;
ChainComplex ** Matrix := ChainComplexMap =&amp;gt; (C,f) -&amp;gt;(&lt;br /&gt;
     map(C ** target f,C** source f,i -&amp;gt; id_(C_i)**f))&lt;br /&gt;
&lt;br /&gt;
RingMap ** GradedModule := GradedModule =&amp;gt; (f,C) -&amp;gt; (&lt;br /&gt;
     D := new GradedModule;&lt;br /&gt;
     D#ring= target f;&lt;br /&gt;
     scan(spots C, i-&amp;gt;D#i=f**C#i);&lt;br /&gt;
     D) &lt;br /&gt;
&lt;br /&gt;
inducedchainMap = (C,D) -&amp;gt; (&lt;br /&gt;
     map(&lt;br /&gt;
          C,D,i-&amp;gt;( inducedMap(C_i,D_i)) --print &amp;quot;found another induced map&amp;quot;;&lt;br /&gt;
          )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
chainhomology = (FB,GB) -&amp;gt; (&lt;br /&gt;
          CB:=source FB;&lt;br /&gt;
          H:=inducedchainMap(ker FB,image GB,id_CB);&lt;br /&gt;
          E:=coker H;&lt;br /&gt;
	  E)&lt;br /&gt;
&lt;br /&gt;
--this has input a chain complex C and a sequence M.  &lt;br /&gt;
--The output is the complexes Tor^i(C,coker M) if M is a regular sequence.&lt;br /&gt;
Torify = (C,M) -&amp;gt; (&lt;br /&gt;
     J:=rank source M;&lt;br /&gt;
     KD:=apply(J+2,I-&amp;gt;(print (&amp;quot;took tensor product &amp;quot; | toString I); C**koszul(I,M)));&lt;br /&gt;
     Lt=apply(J+1,I-&amp;gt;(&lt;br /&gt;
          F:=KD_I;&lt;br /&gt;
          G:=KD_(I+1);&lt;br /&gt;
          E:=inducedchainMap(ker F,image G);&lt;br /&gt;
	  print (&amp;quot;found E &amp;quot; | toString I);&lt;br /&gt;
	  H:=coker E;&lt;br /&gt;
	  print (&amp;quot;found K-homology &amp;quot; | toString I);&lt;br /&gt;
	  H));&lt;br /&gt;
      Lt)&lt;br /&gt;
&lt;br /&gt;
--This has input a braid, output the K-homology of KR double complex (i.e. the complexes of Tor&#039;s)&lt;br /&gt;
KRHom = (K,v) -&amp;gt; (&lt;br /&gt;
          L:=Torify(KR(K,v));&lt;br /&gt;
          M:=apply(L,homology);&lt;br /&gt;
          N:=apply(M,prune);&lt;br /&gt;
	  K#KRHom=N;&lt;br /&gt;
          N)&lt;br /&gt;
&lt;br /&gt;
spots = C -&amp;gt; select(keys C, i -&amp;gt; class i === ZZ)&lt;br /&gt;
&lt;br /&gt;
degrees(GradedModule) := Function =&amp;gt; C -&amp;gt; (&lt;br /&gt;
     i -&amp;gt; degrees C_i)&lt;br /&gt;
&lt;br /&gt;
--input, a knot K. output ((1-t)/(1+q*t))*(the graded Hilbert &lt;br /&gt;
--polynomial of K).  THIS CURRENTLY ONLY WORKS FOR KNOTS, NOT LINKS.&lt;br /&gt;
KRpoly = (K,v) -&amp;gt; (&lt;br /&gt;
     L:=KRHom(K,v);&lt;br /&gt;
     R:=ring L_0;&lt;br /&gt;
     print &amp;quot;hello&amp;quot;;&lt;br /&gt;
     Rn:=#generators R;&lt;br /&gt;
     S:=QQ[t];&lt;br /&gt;
     f=map(S,R,apply(toList (1..Rn),i-&amp;gt;t));&lt;br /&gt;
     M:=apply(L, C -&amp;gt; f**C);&lt;br /&gt;
     N:=apply(M,degrees);&lt;br /&gt;
     K#KRdeg=N;&lt;br /&gt;
     Pring=QQ[q,s,t,Inverses=&amp;gt;true];&lt;br /&gt;
     spoM:=sort (spots M_0);&lt;br /&gt;
     P:=sum(apply(toList (0..#M-1), i-&amp;gt; (&lt;br /&gt;
		    q^i*sum(apply(spoM, j-&amp;gt; (&lt;br /&gt;
				   s^j*sum(apply(flatten N_i j, k-&amp;gt;t^k))&lt;br /&gt;
				   )&lt;br /&gt;
			 ))&lt;br /&gt;
	       )&lt;br /&gt;
	)); &lt;br /&gt;
     K#KRpoly=P;&lt;br /&gt;
     P//(q*t+1))&lt;br /&gt;
&lt;br /&gt;
--Basically the same as KRHom with more readable output.&lt;br /&gt;
KRdisp =(K,v) -&amp;gt; (&lt;br /&gt;
     L:=KRHom (K,v);&lt;br /&gt;
     N:=stack(between(&amp;quot; &amp;quot;, apply(#L,i-&amp;gt;net i | &amp;quot;  &amp;quot; | net L_i)));&lt;br /&gt;
     N)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=49323</id>
		<title>User:Ben/KRhomology</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=49323"/>
		<updated>2006-01-15T22:34:20Z</updated>

		<summary type="html">&lt;p&gt;Ben: added revised program, deleted table of computations&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Calculations==&lt;br /&gt;
Since calculations have now been incorporated into the normal KAtlas data structure, I don&#039;t feel like there&#039;s much point in having a table of them here.&lt;br /&gt;
&lt;br /&gt;
==Macaulay2 program==&lt;br /&gt;
Save this as a file (called KR.m2), open Macaulay2 (in command line or emacs), and type &amp;lt;code&amp;gt;load &amp;quot;KR.m2&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;KRpoly&amp;lt;/code&amp;gt; is probabby the command you want (but it only works for knots at the moment). It outputs &amp;lt;math&amp;gt;\frac{1-t}{qt+1}KR_K(q,s,t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using &amp;lt;code&amp;gt;texMath&amp;lt;/code&amp;gt; puts things in format for LaTeX.  &lt;br /&gt;
&lt;br /&gt;
Changes from the previous version: the important change is in the construction of the Rouquier complex.  Now it works by breaking up the braid into (at the moment, very simple) patterns it recognizes, and uses simplified Rouquier complexes for those chunks.  This seems to be make a big difference in computational time, indicating that a program that could simplify large Rouquier complexes could lead to very large computational savings.  I&#039;ve made some progress in this direction, but am still struggling to produce something truly robust.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample session:&lt;br /&gt;
&amp;lt;pre&amp;gt;Macaulay 2, version 0.9&lt;br /&gt;
--Copyright 1993-2001, D. R. Grayson and M. E. Stillman&lt;br /&gt;
--Singular-Factory 1.3b, copyright 1993-2001, G.-M. Greuel, et al.&lt;br /&gt;
--Singular-Libfac 0.3.2, copyright 1996-2001, M. Messollen&lt;br /&gt;
&lt;br /&gt;
i1 : load &amp;quot;KR.m2&amp;quot;&lt;br /&gt;
KR.m2:113:11: warning: local declaration of N shields variable with same name&lt;br /&gt;
--loaded KR.m2&lt;br /&gt;
&lt;br /&gt;
i2 : texMath KRpoly (K01,true)&lt;br /&gt;
&lt;br /&gt;
o2 = 1&lt;br /&gt;
&lt;br /&gt;
i3 : texMath KRpoly (K31,true)&lt;br /&gt;
&lt;br /&gt;
o3 = s^{2} t^{2}+{q} t^{2}+1&lt;br /&gt;
&lt;br /&gt;
i4 : &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the code for the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--This file defines a new object for Macaulay2, called a &amp;quot;Link.&amp;quot;&lt;br /&gt;
--Like all objects in Macaulay2, a Link is just a hash table.&lt;br /&gt;
--Defining a link lets you store information about it for later use.  &lt;br /&gt;
&lt;br /&gt;
Link = new Type of MutableHashTable &lt;br /&gt;
Link.synonym = &amp;quot;link&amp;quot;&lt;br /&gt;
new Link := Link =&amp;gt; (cl) -&amp;gt; (&lt;br /&gt;
     C:=newClass(Link,new MutableHashTable);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--braidClosure is currently the only useful way of defining a link.  &lt;br /&gt;
--I think it should be clear from the examples below how to use it.&lt;br /&gt;
--(Remember to use {}, not () or [])&lt;br /&gt;
braidClosure = L -&amp;gt;(&lt;br /&gt;
     K:=new Link;&lt;br /&gt;
     K#braid=L;&lt;br /&gt;
     K)&lt;br /&gt;
&lt;br /&gt;
--This defines all links of 7 or fewer crossings by a braid closure.&lt;br /&gt;
K01=braidClosure {1};&lt;br /&gt;
K31=braidClosure {1,1,1};&lt;br /&gt;
K41=braidClosure {1,-2,1,-2};&lt;br /&gt;
K51=braidClosure {1,1,1,1,1};&lt;br /&gt;
K52=braidClosure {-1,-1,-2,1,-2};&lt;br /&gt;
K61=braidClosure {1,1,2,-1,-3,2,-3};&lt;br /&gt;
K62=braidClosure {-1,-1,-1,2,-1,2};&lt;br /&gt;
K63=braidClosure {-1,-1,2,-1,2,2};&lt;br /&gt;
K71=braidClosure {-1,-1,-1,-1,-1,-1,-1}&lt;br /&gt;
K72=braidClosure {-1,-1,-1,-2,1,-2,-3,2,-3}&lt;br /&gt;
K73=braidClosure {1,1,1,1,1,2,-1,2}&lt;br /&gt;
K74=braidClosure {1,1,2,-1,2,2,3,-2,3}&lt;br /&gt;
K75=braidClosure {-1,-1,-1,-1,-2,1,-2,-2}&lt;br /&gt;
K76=braidClosure {-1,-1,2,-1,-3,2,-3}&lt;br /&gt;
K77=braidClosure {1,-2,1,-2,3,-2,3}&lt;br /&gt;
&lt;br /&gt;
--Now all programs using the Rouqier complex (KR, KRHom, KRpoly) take an extra argument, which should be a truth value.  &lt;br /&gt;
--If this is &amp;quot;true,&amp;quot; then the program will simplify chunks of the Rouquier complex using prescribed homotopies.  &lt;br /&gt;
--If it is &amp;quot;false,&amp;quot; it will use the old brute force method.  &lt;br /&gt;
--Preliminary results indicate that the program will run MUCH faster if you use the &amp;quot;true&amp;quot; option, &lt;br /&gt;
--but it is not 100% vetted yet.  there might well be mistakes hiding in there.  Let the user beware.&lt;br /&gt;
&lt;br /&gt;
--this program now produces a complex homotopic to the Rouquier complex of the input braid, &lt;br /&gt;
--as well as a presentation for the module that corresponds to closing the braid (in matrix form).&lt;br /&gt;
KR = (K,v) -&amp;gt; (&lt;br /&gt;
          if not K#?braid then error &amp;quot;no braid representation&amp;quot; else (&lt;br /&gt;
               Kb:=K#braid;&lt;br /&gt;
               P:=K#nbcross=#Kb;&lt;br /&gt;
               Ka:=apply(Kb,abs);&lt;br /&gt;
               Kt:=apply(Kb,i-&amp;gt;(i&amp;gt;0));&lt;br /&gt;
               Ks:=sort Ka;&lt;br /&gt;
               bind:=K#bindex=last(Ks)+1;&lt;br /&gt;
               Cvars:=new MutableList from toList (-bind..-1);&lt;br /&gt;
	       I:=0;&lt;br /&gt;
	       J:=0;&lt;br /&gt;
	       Kp:={};&lt;br /&gt;
	       newv:=0;&lt;br /&gt;
               while I&amp;lt;P do (&lt;br /&gt;
		    print I;&lt;br /&gt;
		    M:=1;&lt;br /&gt;
		    while (Kb#?(I+M) and Kb#(I+M)==Kb#I) do M=M+1;&lt;br /&gt;
		    if (M&amp;gt;1 and v) then (&lt;br /&gt;
			 print (&amp;quot;used IImod &amp;quot; | toString(M));&lt;br /&gt;
			 Kp=append(Kp, ((&amp;quot;II&amp;quot;,M),(Cvars#(Ka_I-1),Cvars#(Ka_I+1-1),newv,Kt_I)));&lt;br /&gt;
			 newvp=newv+2;&lt;br /&gt;
			 J=I+M)&lt;br /&gt;
		    else if ((Kb#?(I+2) and Ka_I==Ka_(I+2)) and v) then (&lt;br /&gt;
			 if Ka_I==Ka_(I+1)+1 then (&lt;br /&gt;
			      if (Kb_(I+1)==Kb_(I+3) and Kb_I==Kb_(I+2)) then (&lt;br /&gt;
				   print &amp;quot;used babamod&amp;quot;;&lt;br /&gt;
				   Kp=append(Kp,(&amp;quot;baba&amp;quot;,(Cvars#(Ka_I),Cvars#(Ka_I-1),Cvars#(Ka_I-2),newv+1,newv,newv+2,Kt_I,Kt_(I+1),Kt_(I+2),Kt_(I+3))));&lt;br /&gt;
				   J=I+4;&lt;br /&gt;
				   )&lt;br /&gt;
			      else (&lt;br /&gt;
			      	   print &amp;quot;used abamod&amp;quot;;&lt;br /&gt;
			      	   Kp=append(Kp,(&amp;quot;aba&amp;quot;,(Cvars#(Ka_I),Cvars#(Ka_I-1),Cvars#(Ka_I-2),newv+1,newv,newv+2,Kt_I,Kt_(I+1),Kt_(I+2))));&lt;br /&gt;
				   J=I+3;&lt;br /&gt;
				   );&lt;br /&gt;
			      Cvars#(Ka_I-2)=newv+2;&lt;br /&gt;
			      newvp=newv+3)&lt;br /&gt;
			 else if Ka_I==Ka_(I+1)-1  then (&lt;br /&gt;
			      if (Kb_(I+1)==Kb_(I+3) and Kb_I==Kb_(I+2)) then ( &lt;br /&gt;
	     		      	   print &amp;quot;used babamod&amp;quot;;&lt;br /&gt;
			      	   Kp=append(Kp,(&amp;quot;baba&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),Cvars#(Ka_I+1),newv,newv+1,newv+2,Kt_I,Kt_(I+1),Kt_(I+2),Kt_(I+3))));&lt;br /&gt;
				   J=I+4;&lt;br /&gt;
				   )&lt;br /&gt;
			      else(&lt;br /&gt;
				   print &amp;quot;used abamod&amp;quot;;&lt;br /&gt;
			      	   Kp=append(Kp,(&amp;quot;aba&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),Cvars#(Ka_I+1),newv,newv+1,newv+2,Kt_I,Kt_(I+1),Kt_(I+2))));&lt;br /&gt;
				   J=I+3;&lt;br /&gt;
				   );&lt;br /&gt;
			      Cvars#(Ka_I+1)=newv+2;&lt;br /&gt;
			      newvp=newv+3&lt;br /&gt;
			      )&lt;br /&gt;
			 else (&lt;br /&gt;
			      print &amp;quot;used stmod&amp;quot;; &lt;br /&gt;
			      Kp=append(Kp,(&amp;quot;st&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),newv,Kt_I)));&lt;br /&gt;
			      newvp=newv+2;&lt;br /&gt;
			      J=I+1)&lt;br /&gt;
			 )&lt;br /&gt;
		    else (&lt;br /&gt;
			 print &amp;quot;used stmod&amp;quot;; &lt;br /&gt;
			 Kp=append(Kp,(&amp;quot;st&amp;quot;,(Cvars#(Ka_I-1),Cvars#(Ka_I),newv,Kt_I)));&lt;br /&gt;
			 newvp=newv+2;&lt;br /&gt;
			 J=I+1);&lt;br /&gt;
                    Cvars#(Ka_I-1)=newv;&lt;br /&gt;
                    Cvars#(Ka_I)=newv+1;&lt;br /&gt;
		    I=J;&lt;br /&gt;
		    newv=newvp;&lt;br /&gt;
                    );&lt;br /&gt;
	       print Kp;&lt;br /&gt;
	       elim=newv-bind;&lt;br /&gt;
	       R:=QQ[vars(1 .. newv+bind),MonomialOrder=&amp;gt;Eliminate elim];&lt;br /&gt;
	       Kp=apply(Kp,(S1,S2) -&amp;gt; (S1,apply(S2,i-&amp;gt; (if (class i===ZZ and i&amp;lt;0) then x=i+newv+bind else x=i; x))));&lt;br /&gt;
               Kmod:= chainComplex( gradedModule(R^1));&lt;br /&gt;
	       for J from 0 to #Kp-1 do (&lt;br /&gt;
	       	    if ((Kp_J)_0)_0==&amp;quot;II&amp;quot; then  Kmod=Kmod**IImod join((Kp_J)_1,  (((Kp_J)_0)_1,R))&lt;br /&gt;
		    else if (Kp_J)_0==&amp;quot;aba&amp;quot; then Kmod=Kmod**abamod append((Kp_J)_1,R)&lt;br /&gt;
		    else if (Kp_J)_0==&amp;quot;baba&amp;quot; then Kmod=Kmod**babamod append((Kp_J)_1,R)&lt;br /&gt;
		    else if (Kp_J)_0==&amp;quot;st&amp;quot; then Kmod=Kmod**stmod append((Kp_J)_1,R)&lt;br /&gt;
		    else error &amp;quot;oops, missed a case&amp;quot;	     &lt;br /&gt;
          	    );&lt;br /&gt;
--	       scan(spots Kmod, i -&amp;gt; if Kmod#dd#?i then print (isWellDefined Kmod.dd_i));&lt;br /&gt;
     	       M:=matrix {apply(bind, I-&amp;gt; R_(Cvars#I)-R_(newv+I))};&lt;br /&gt;
               return (Kmod,M);&lt;br /&gt;
          );&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--this produces a simpler complex for an arbitrary number of twists of two adjacent strands.&lt;br /&gt;
IImod = (H,I,J,W,n,S) -&amp;gt; (&lt;br /&gt;
     i:=ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
     Dp:=chainComplex map(S^{0}/i,S^{-1}/i,S_I-S_J);&lt;br /&gt;
     Dn:=chainComplex map(S^{2}/i,S^{1}/i,S_I-S_J)[1];&lt;br /&gt;
     if mod(n,2)==0 then C=ftmod(H,I,J,W,S);&lt;br /&gt;
     if mod(n,2)==1 then C=stmod(H,I,J,W,S);&lt;br /&gt;
     while n&amp;gt;2 do (&lt;br /&gt;
	  if W then C=C[-2]**S^{-2}++Dp&lt;br /&gt;
	  else C=C[2]**S^{2}++Dn;&lt;br /&gt;
	  n=n-2;&lt;br /&gt;
	  );&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--this produces a simpler complex for a full twist of two strands.  Now just feeds into &amp;quot;IImod.&amp;quot;&lt;br /&gt;
ftmod = (H,I,J,W,S) -&amp;gt; (&lt;br /&gt;
     i:=ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
     j:=ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
     if W then (&lt;br /&gt;
	  M0=S^1/i;&lt;br /&gt;
	  M1=S^{-1}/i;&lt;br /&gt;
	  M2=S^{-2}/j;&lt;br /&gt;
	  f1=map(M0,M1,S_H-S_I-S_J+S_(J+1));&lt;br /&gt;
	  f2=map(M1,M2,S_J-S_I);&lt;br /&gt;
	  C=chainComplex(f1,f2));&lt;br /&gt;
     if not W then (&lt;br /&gt;
	  M0=S^{2}/j;&lt;br /&gt;
	  M1=S^{2}/i;&lt;br /&gt;
	  M2=S^{1}/i;&lt;br /&gt;
	  f1=map(M0,M1);&lt;br /&gt;
	  f2=map(M1,M2,S_H-S_J-S_I+S_(J+1));&lt;br /&gt;
	  C=chainComplex(f1,f2)[2]);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--this produces the standard Rouquier complex for a single crossing&lt;br /&gt;
stmod = (H,I,J,W,S) -&amp;gt; (&lt;br /&gt;
          if W then (&lt;br /&gt;
	       Mp=S^1/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
               Np=S^{-1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	       C=chainComplex(map(Mp,Np,(S_J-S_I))))&lt;br /&gt;
          else (&lt;br /&gt;
	       Mn=S^{1}/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
               Nn=S^{1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
               C=chainComplex(map(Nn,Mn))[1]);&lt;br /&gt;
          C)&lt;br /&gt;
     &lt;br /&gt;
--this produces a simplified Rouquier for braids of length 3 lifting the longest element of S_3.&lt;br /&gt;
abamod = (G,H,I,J,K,L,W,V,X,S) -&amp;gt; (&lt;br /&gt;
     i:=ideal(S_G-S_J,S_H-S_K,S_I-S_L);&lt;br /&gt;
     j1:=ideal(S_H+S_G-S_J-S_K,S_H*S_G-S_J*S_K,S_I-S_L);&lt;br /&gt;
     j2:=ideal(S_H+S_I-S_L-S_K,S_H*S_I-S_L*S_K,S_G-S_J);&lt;br /&gt;
     k1:=ideal(S_H+S_G+S_I-S_J-S_K-S_L, (S_I-S_K)*(S_I-S_L),(S_J-S_G)*(S_J-S_H));&lt;br /&gt;
     k2:=ideal(S_H+S_G+S_I-S_J-S_K-S_L, (S_L-S_H)*(S_I-S_L),(S_J-S_G)*(S_G-S_K));&lt;br /&gt;
     l:=ideal(S_H+S_G+S_I-S_J-S_K-S_L, S_H*S_G+S_I*S_G+S_I*S_H-S_J*S_K-S_L*S_J-S_K*S_L, S_H*S_G*S_I-S_J*S_K*S_L);&lt;br /&gt;
     if ((not W) and (not V) and (not X)) then (&lt;br /&gt;
	  M0=S^{3}/i;&lt;br /&gt;
	  M1=S^{3}/j1++S^{3}/j2;&lt;br /&gt;
	  M2=S^{3}/k1++S^{3}/k2;	  &lt;br /&gt;
	  M3=S^{3}/l;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{1_S,-1}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{1_S,-1},{1,-1}});&lt;br /&gt;
	  f3=map(M2,M3,matrix{{1_S},{1}});&lt;br /&gt;
	  C=chainComplex(f1,f2,f3)[3]&lt;br /&gt;
	  )&lt;br /&gt;
     else if (W and V and X) then (&lt;br /&gt;
	  M0=S^1/l;&lt;br /&gt;
	  M1=S^{-1}/k1++S^{-1}/k2;&lt;br /&gt;
	  M2=S^{-2}/j1++S^{-2}/j2;&lt;br /&gt;
	  M3=S^{-3}/i;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{S_I-S_J,-S_G+S_L}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{S_I-S_K,-S_H+S_J},{S_H-S_L,-S_G+S_K}});&lt;br /&gt;
	  f3=map(M2,M3,matrix{{-S_K+S_G},{-S_L+S_H}});&lt;br /&gt;
	  C=chainComplex(f1,f2,f3)&lt;br /&gt;
	  )      &lt;br /&gt;
     else if ((not W) and (not V) and X) then (&lt;br /&gt;
	  M0=S^{2}/k2++S^{1}/i;&lt;br /&gt;
	  M1=S^{2}/l++S^{1}/j1++S^{1}/j2;&lt;br /&gt;
	  M2=S^{1}/k1;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{1,S_H-S_L,S_G-S_K},{0,-1,1}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{S_I-S_J},{1},{1}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1]&lt;br /&gt;
	  )&lt;br /&gt;
     else if (W and (not V) and (not X)) then (&lt;br /&gt;
	  M0=S^{2}/k1++S^{1}/i;&lt;br /&gt;
	  M1=S^{2}/l++S^{1}/j1++S^{1}/j2;&lt;br /&gt;
	  M2=S^{1}/k2;&lt;br /&gt;
	  f1=map(M0,M1,matrix{{1,S_I-S_K,S_H-S_J},{0,-1,1}});&lt;br /&gt;
	  f2=map(M1,M2,matrix{{S_G-S_L},{1},{1}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1]&lt;br /&gt;
	  )&lt;br /&gt;
     else if (W and V and (not X)) then (&lt;br /&gt;
     	  M2=S^{0}/k2++S^{-1}/i;&lt;br /&gt;
	  M1=S^{1}/l++S^{0}/j1++S^{0}/j2;&lt;br /&gt;
	  M0=S^{1}/k1;&lt;br /&gt;
	  f1=map(M0,M1,matrix {{-1,-S_I+S_K,S_J-S_H}});&lt;br /&gt;
	  f2=map(M1,M2,matrix {{S_G-S_L,0},{1,S_H-S_J},{1,-S_I+S_K}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1])&lt;br /&gt;
     else if ((not W) and V and X) then (&lt;br /&gt;
     	  M2=S^{0}/k1++S^{-1}/i;&lt;br /&gt;
	  M1=S^{1}/l++S^{0}/j1++S^{0}/j2;&lt;br /&gt;
	  M0=S^{1}/k2;&lt;br /&gt;
	  f1=map(M0,M1,matrix {{-1,-S_L+S_H,S_G-S_K}});&lt;br /&gt;
	  f2=map(M1,M2,matrix {{S_J-S_I,0},{1,S_K-S_G},{1,-S_L+S_H}});&lt;br /&gt;
	  C=chainComplex(f1,f2)[1]&lt;br /&gt;
	  )&lt;br /&gt;
     else if ((not W) and V and (not X)) then (&lt;br /&gt;
	  C=new ChainComplex;&lt;br /&gt;
	  C.ring=S;&lt;br /&gt;
C#0 = cokernel map(S^{{1}, {1}, {2}}, S^{{1}, {0}, {0}, {0}, {0}, {0}, {-1}, {-1}, {-1}}, {{0, S_H+S_G-S_K-S_J, 0, 0, 0, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, 0, -S_H*S_G+S_K*S_J, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2, 0}});&lt;br /&gt;
      C#1 = cokernel map(S^{{0}}, S^{{-1}, {-1}, {-2}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}});&lt;br /&gt;
      C#-2 = cokernel map(S^{{2}}, S^{{1}, {1}, {0}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}});&lt;br /&gt;
      C#-1 = cokernel map(S^{{1}, {2}, {2}}, S^{{1}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}});&lt;br /&gt;
      C#dd#0 = map(cokernel map(S^{{1}, {2}, {2}}, S^{{1}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}}), cokernel map(S^{{1}, {1}, {2}}, S^{{1}, {0}, {0}, {0}, {0}, {0}, {-1}, {-1}, {-1}}, {{0, S_H+S_G-S_K-S_J, 0, 0, 0, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, 0, -S_H*S_G+S_K*S_J, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2, 0}}), {{-1, 0, 0}, {S_H+S_G-S_J-S_L, -S_K, -1}, {0, S_G-S_K-S_J, -1}});&lt;br /&gt;
      C#dd#1 = map(cokernel map(S^{{1}, {1}, {2}}, S^{{1}, {0}, {0}, {0}, {0}, {0}, {-1}, {-1}, {-1}}, {{0, S_H+S_G-S_K-S_J, 0, 0, 0, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, 0, -S_H*S_G+S_K*S_J, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2, 0}}), cokernel map(S^{{0}}, S^{{-1}, {-1}, {-2}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}}), {{S_G-S_J}, {S_G-S_L}, {S_G^2-S_G*S_K-S_G*S_J-S_G*S_L+S_K*S_L+S_J*S_L}});&lt;br /&gt;
      C#dd#-1 = map(cokernel map(S^{{2}}, S^{{1}, {1}, {0}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}}), cokernel map(S^{{1}, {2}, {2}}, S^{{1}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}}), {{-S_H+S_L, -1, 1}});)&lt;br /&gt;
     else if (W and (not V) and X) then ( &lt;br /&gt;
	  C=new ChainComplex;&lt;br /&gt;
	  C.ring=S;&lt;br /&gt;
	  C#0 = cokernel map(S^{{0}, {0}, {1}}, S^{{0}, {-1}, {-1}, {-1}, {-1}, {-1}, {-2}, {-2}, {-2}}, {{0, S_H+S_G-S_K-S_J, 0, S_I-S_L, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, 0, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, -S_H*S_G+S_K*S_J}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2}});&lt;br /&gt;
       	  C#1 = cokernel map(S^{{-1}, {0}, {0}}, S^{{-1}, {-1}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}});&lt;br /&gt;
       	  C#2 = cokernel map(S^{{-1}}, S^{{-2}, {-2}, {-3}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}});&lt;br /&gt;
       	  C#-1 = cokernel map(S^{{1}}, S^{{0}, {0}, {-1}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}});&lt;br /&gt;
       	  C#dd#0 = map(cokernel map(S^{{1}}, S^{{0}, {0}, {-1}}, {{S_H+S_G-S_K-S_J, S_I-S_L, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J}}), cokernel map(S^{{0}, {0}, {1}}, S^{{0}, {-1}, {-1}, {-1}, {-1}, {-1}, {-2}, {-2}, {-2}}, {{0, S_H+S_G-S_K-S_J, 0, S_I-S_L, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, 0, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, -S_H*S_G+S_K*S_J}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2}}), {{S_G-S_J, -S_J, -1}});&lt;br /&gt;
       	  C#dd#1 = map(cokernel map(S^{{0}, {0}, {1}}, S^{{0}, {-1}, {-1}, {-1}, {-1}, {-1}, {-2}, {-2}, {-2}}, {{0, S_H+S_G-S_K-S_J, 0, S_I-S_L, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0}, {0, 0, S_I+S_H+S_G-S_K-S_J-S_L, 0, S_H+S_G-S_K-S_J, -S_H-S_G+S_K+S_J, 0, S_H^2+S_H*S_G+S_G^2-S_H*S_K-S_G*S_K-S_H*S_J-S_G*S_J+S_K*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, -S_H*S_G+S_K*S_J}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, S_H*S_G-S_H*S_K-S_G*S_K+S_K^2-S_H*S_J-S_G*S_J+S_K*S_J+S_J^2, S_H^2+S_G^2-S_K^2-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0, 0, S_H*S_K*S_J+S_G*S_K*S_J-S_K^2*S_J-S_K*S_J^2}}), cokernel map(S^{{-1}, {0}, {0}}, S^{{-1}, {-1}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}}), {{S_G-S_K, 1, 0}, {0, -1, -1}, {0, -S_H+S_K+S_J, S_J}});&lt;br /&gt;
       	  C#dd#2 = map(cokernel map(S^{{-1}, {0}, {0}}, S^{{-1}, {-1}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}, {-2}}, {{0, 0, S_G-S_J, S_H-S_K, S_I-S_L, 0, 0, 0, 0}, {S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_G^2-S_G*S_K-S_G*S_J+S_K*S_J, 0, 0, S_H^2+S_H*S_G-S_H*S_K-S_H*S_J-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L}, {0, S_I+S_H+S_G-S_K-S_J-S_L, 0, 0, 0, 0, S_H*S_G-S_H*S_J-S_G*S_J+S_J^2, S_H^2+S_G^2-S_H*S_K-S_G*S_K+S_K*S_J-S_J^2-S_H*S_L-S_G*S_L+S_K*S_L+S_J*S_L, 0}}), cokernel map(S^{{-1}}, S^{{-2}, {-2}, {-3}}, {{S_G-S_J, S_I+S_H-S_K-S_L, S_H^2-S_H*S_K-S_H*S_L+S_K*S_L}}), {{1}, {-S_G+S_K}, {-S_H+S_J}});&lt;br /&gt;
      	  )&lt;br /&gt;
     else error &amp;quot;looks like I forgot a case&amp;quot;;&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--these extend Macaulay2&#039;s ability to take tensor products and induced maps.&lt;br /&gt;
ChainComplex ** Matrix := ChainComplexMap =&amp;gt; (C,f) -&amp;gt;(&lt;br /&gt;
     map(C ** target f,C** source f,i -&amp;gt; id_(C_i)**f))&lt;br /&gt;
&lt;br /&gt;
RingMap ** GradedModule := GradedModule =&amp;gt; (f,C) -&amp;gt; (&lt;br /&gt;
     D := new GradedModule;&lt;br /&gt;
     D#ring= target f;&lt;br /&gt;
     scan(spots C, i-&amp;gt;D#i=f**C#i);&lt;br /&gt;
     D) &lt;br /&gt;
&lt;br /&gt;
inducedchainMap = (C,D) -&amp;gt; (&lt;br /&gt;
     map(&lt;br /&gt;
          C,D,i-&amp;gt;( inducedMap(C_i,D_i)) --print &amp;quot;found another induced map&amp;quot;;&lt;br /&gt;
          )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
chainhomology = (FB,GB) -&amp;gt; (&lt;br /&gt;
          CB:=source FB;&lt;br /&gt;
          H:=inducedchainMap(ker FB,image GB,id_CB);&lt;br /&gt;
          E:=coker H;&lt;br /&gt;
	  E)&lt;br /&gt;
&lt;br /&gt;
--this has input a chain complex C and a sequence M.  &lt;br /&gt;
--The output is the complexes Tor^i(C,coker M) if M is a regular sequence.&lt;br /&gt;
Torify = (C,M) -&amp;gt; (&lt;br /&gt;
     J:=rank source M;&lt;br /&gt;
     KD:=apply(J+2,I-&amp;gt;(print (&amp;quot;took tensor product &amp;quot; | toString I); C**koszul(I,M)));&lt;br /&gt;
     Lt=apply(J+1,I-&amp;gt;(&lt;br /&gt;
          F:=KD_I;&lt;br /&gt;
          G:=KD_(I+1);&lt;br /&gt;
          E:=inducedchainMap(ker F,image G);&lt;br /&gt;
	  print (&amp;quot;found E &amp;quot; | toString I);&lt;br /&gt;
	  H:=coker E;&lt;br /&gt;
	  print (&amp;quot;found K-homology &amp;quot; | toString I);&lt;br /&gt;
	  H));&lt;br /&gt;
      Lt)&lt;br /&gt;
&lt;br /&gt;
--This has input a braid, output the K-homology of KR double complex (i.e. the complexes of Tor&#039;s)&lt;br /&gt;
KRHom = (K,v) -&amp;gt; (&lt;br /&gt;
          L:=Torify(KR(K,v));&lt;br /&gt;
          M:=apply(L,homology);&lt;br /&gt;
          N:=apply(M,prune);&lt;br /&gt;
	  K#KRHom=N;&lt;br /&gt;
          N)&lt;br /&gt;
&lt;br /&gt;
spots = C -&amp;gt; select(keys C, i -&amp;gt; class i === ZZ)&lt;br /&gt;
&lt;br /&gt;
degrees(GradedModule) := Function =&amp;gt; C -&amp;gt; (&lt;br /&gt;
     i -&amp;gt; degrees C_i)&lt;br /&gt;
&lt;br /&gt;
--input, a knot K. output ((1-t)/(1+q*t))*(the graded Hilbert &lt;br /&gt;
--polynomial of K).  THIS CURRENTLY ONLY WORKS FOR KNOTS, NOT LINKS.&lt;br /&gt;
KRpoly = (K,v) -&amp;gt; (&lt;br /&gt;
     L:=KRHom(K,v);&lt;br /&gt;
     R:=ring L_0;&lt;br /&gt;
     print &amp;quot;hello&amp;quot;;&lt;br /&gt;
     Rn:=#generators R;&lt;br /&gt;
     S:=QQ[t];&lt;br /&gt;
     f=map(S,R,apply(toList (1..Rn),i-&amp;gt;t));&lt;br /&gt;
     M:=apply(L, C -&amp;gt; f**C);&lt;br /&gt;
     N:=apply(M,degrees);&lt;br /&gt;
     K#KRdeg=N;&lt;br /&gt;
     Pring=QQ[q,s,t,Inverses=&amp;gt;true];&lt;br /&gt;
     spoM:=sort (spots M_0);&lt;br /&gt;
     P:=sum(apply(toList (0..#M-1), i-&amp;gt; (&lt;br /&gt;
		    q^i*sum(apply(spoM, j-&amp;gt; (&lt;br /&gt;
				   s^j*sum(apply(flatten N_i j, k-&amp;gt;t^k))&lt;br /&gt;
				   )&lt;br /&gt;
			 ))&lt;br /&gt;
	       )&lt;br /&gt;
	)); &lt;br /&gt;
     K#KRpoly=P;&lt;br /&gt;
     P//(q*t+1))&lt;br /&gt;
&lt;br /&gt;
--Basically the same as KRHom with more readable output.&lt;br /&gt;
KRdisp =(K,v) -&amp;gt; (&lt;br /&gt;
     L:=KRHom (K,v);&lt;br /&gt;
     N:=stack(between(&amp;quot; &amp;quot;, apply(#L,i-&amp;gt;net i | &amp;quot;  &amp;quot; | net L_i)));&lt;br /&gt;
     N)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben&amp;diff=120909</id>
		<title>User:Ben</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben&amp;diff=120909"/>
		<updated>2005-12-13T00:13:58Z</updated>

		<summary type="html">&lt;p&gt;Ben: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://math.berkeley.edu/~bwebste My homepage]&lt;br /&gt;
&lt;br /&gt;
[[User:Ben/KRhomology|My adventures]] in KR homology.&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=File:Kiw-webster-slides.pdf&amp;diff=120973</id>
		<title>File:Kiw-webster-slides.pdf</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=File:Kiw-webster-slides.pdf&amp;diff=120973"/>
		<updated>2005-12-13T00:12:59Z</updated>

		<summary type="html">&lt;p&gt;Ben: Slides from a talk on KR homology given by Ben Webster at Knots in Washington XXI.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Slides from a talk on KR homology given by Ben Webster at Knots in Washington XXI.&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben&amp;diff=49238</id>
		<title>User:Ben</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben&amp;diff=49238"/>
		<updated>2005-12-13T00:11:27Z</updated>

		<summary type="html">&lt;p&gt;Ben: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://math.berkeley.edu/~bwebste My homepage]&lt;br /&gt;
&lt;br /&gt;
[[User:Ben/KRhomology|My adventures]] in KR homology.&lt;br /&gt;
&lt;br /&gt;
[[Media:kiw-webster-slides.pdf]]&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=49218</id>
		<title>User:Ben/KRhomology</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=49218"/>
		<updated>2005-12-08T16:29:44Z</updated>

		<summary type="html">&lt;p&gt;Ben: fixed bugs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Actual calculations==&lt;br /&gt;
Note: these polynomials are missing fudge factors.  These will be fixed when I get back to Berkeley on Wednesday.&lt;br /&gt;
&lt;br /&gt;
Here is a table of known KR homologies.  We let &amp;lt;math&amp;gt;KR_K(q,s,t)&amp;lt;/math&amp;gt; be the Hilbert series of KR homology.  Note that a factor of the Hilbert series of the unknot appears in all of them.  This will not be true of links, I believe.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, computation seems to bog down very fast.  [[6_1]] has been giving me a lot of trouble, probably because it has braid index 4.  If someone with a faster machine would run it, I would be very appreciative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039; the polynomial for [[5_2]] here is incorrect. The correct value appears on the main Knot Atlas page for [[5_2]]. --[[User:Scott|Scott]] 12:48, 3 Dec 2005 (EST)&lt;br /&gt;
&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[0_1]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\frac{{q} {t}+1}{1-t}&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[3_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(s^{2} t^{2}+{q} t^{2}+1)&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[4_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(t^{{-1}}+{q} {t}+{q} s^{{-1}}+{q} s^{{-{2}}} t^{{-1}}+q^{2} s^{{-{2}}} {t})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(1+s^{2} t^{2}+s^{4} t^{4}+{q} s^{2} t^{4}+{q} t^{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_2]]   &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)({q}+q^{2} s^{{-{2}}}+t^{{-{2}}}+q^{2} s^{{-{3}}} t^{{-1}}+{q} s^{{-{2}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[6_2]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)({q} {t}+q^{2} s^{{-{2}}} {t}+{q} s^{{-1}}+t^{{-1}}+2 {q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+q^{2} s^{{-{4}}} t^{{-1}}+{q}s^{{-{3}}} t^{{-{2}}}+s^{{-{2}}} t^{{-{3}}}+{q} s^{{-{4}}} t^{{-{3}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  [[6_3]]&lt;br /&gt;
| &amp;lt;math&amp;gt;{\left(\frac{{q} {t}+1}{1-t}\right)(q} {s} t^{2}+q^{2} s^{{-1}} t^{2}+{q} {t}+{s}+q^{2} s^{{-{2}}} {t}+3 {q} s^{{-1}}+t^{{-1}}+q^{2} s^{{-{3}}}+{q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+{q} s^{{-{3}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
I&#039;ve been running more calculations on panda and neuron, two of the fast computers in the math department. I&#039;ve got panda working through all the braid index 3 knots, and it&#039;s started giving some results. [[7_3]]  took about half an hour, and consumed about a gig of memory. --[[User:Scott|Scott]] 02:16, 30 Nov 2005 (EST)&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[7_3]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)({q} s^{3} t^{5}+s^{4} t^{4}+q^{2} {s} t^{5}+{q} s^{2} t^{4}+s^{3} t^{3}+2 {q} {s} t^{3}+s^{2} t^{2}+q^{2} s^{{-1}} t^{3}+{q} t^{2}+{s} {t}+{q} s^{{-1}} {t}+1)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[7_5]]&lt;br /&gt;
| &amp;lt;math&amp;gt; \left(\frac{{q} {t}+1}{1-t}\right) (q^{2} s^{{-{2}}}+{q} s^{{-1}} t^{{-1}}+q^{2} s^{{-{3}}} t^{{-1}}+2 {q} s^{{-{2}}} t^{{-{2}}}+s^{{-1}} t^{{-{3}}}+2 q^{2} s^{{-{4}}} t^{{-{2}}}+2 {q} s^{{-{3}}} t^{{-{3}}}+s^{{-{2}}} t^{{-{4}}}+q^{2} s^{{-{5}}} t^{{-{3}}}+2 {q} s^{{-{4}}} t^{{-{4}}}+s^{{-{3}}} t^{{-{5}}}+q^{2} s^{{-{6}}} t^{{-{4}}}+{q} s^{{-{5}}} t^{{-{5}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
neuron is working on braid index 4 knots, starting with [[6_1]], and seems to be working fine. [[6_1]] took over an hour, and about 1.2 gigs of memory. --[[User:Scott|Scott]] 02:59, 30 Nov 2005 (EST)&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[6_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(q^{2} s^{{-1}} t^{2}+{q} {t}+q^{3} s^{{-{3}}} t^{2}+q^{2} s^{{-{2}}} {t}+2 {q} s^{{-1}}+t^{{-1}}+q^{2} s^{{-{3}}}+{q} s^{{-{2}}} t^{{-1}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Theoretical stuff==&lt;br /&gt;
I have some ideas which I hope will be of interest to ya&#039;ll, but I&#039;d like to mull them a bit longer.  Maybe when I get back on Wednesday.&lt;br /&gt;
&lt;br /&gt;
For those who are curious, the polynomials above should follow the skein relation &amp;lt;math&amp;gt;q(-)+q^{-1}(+)=(t^{-1}-t)(| |)&amp;lt;/math&amp;gt; after subsituting &#039;&#039;s=-1.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Macaulay2 program==&lt;br /&gt;
Save this as a file (called KR.m2), open Macaulay2 (in command line or emacs), and type &amp;lt;code&amp;gt;load &amp;quot;KR.m2&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;KRpoly&amp;lt;/code&amp;gt; is probabby the command you want (but it only works for knots at the moment). It outputs &amp;lt;math&amp;gt;\frac{1-t}{qt+1}KR_K(q,s,t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using &amp;lt;code&amp;gt;texMath&amp;lt;/code&amp;gt; puts things in format for LaTeX.  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample session:&lt;br /&gt;
&amp;lt;pre&amp;gt;Macaulay 2, version 0.9&lt;br /&gt;
--Copyright 1993-2001, D. R. Grayson and M. E. Stillman&lt;br /&gt;
--Singular-Factory 1.3b, copyright 1993-2001, G.-M. Greuel, et al.&lt;br /&gt;
--Singular-Libfac 0.3.2, copyright 1996-2001, M. Messollen&lt;br /&gt;
&lt;br /&gt;
i1 : load &amp;quot;KR.m2&amp;quot;&lt;br /&gt;
KR.m2:113:11: warning: local declaration of N shields variable with same name&lt;br /&gt;
--loaded KR.m2&lt;br /&gt;
&lt;br /&gt;
i2 : texMath KRpoly K01&lt;br /&gt;
&lt;br /&gt;
o2 = 1&lt;br /&gt;
&lt;br /&gt;
i3 : texMath KRpoly K31&lt;br /&gt;
&lt;br /&gt;
o3 = s^{2} t^{2}+{q} t^{2}+1&lt;br /&gt;
&lt;br /&gt;
i4 : &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the code for the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--KR.m2&lt;br /&gt;
--This file defines a new object for Macaulay2, called a &amp;quot;Link.&amp;quot;&lt;br /&gt;
--Like all objects in Macaulay2, a Link is just a hash table.&lt;br /&gt;
--Defining a link lets you store information about it for later use.  &lt;br /&gt;
&lt;br /&gt;
Link = new Type of MutableHashTable &lt;br /&gt;
Link.synonym = &amp;quot;link&amp;quot;&lt;br /&gt;
new Link := Link =&amp;gt; (cl) -&amp;gt; (&lt;br /&gt;
     C:=newClass(Link,new MutableHashTable);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--braidClosure is currently the only useful way of defining a link.  &lt;br /&gt;
--I think it should be clear from the examples below how to use it.&lt;br /&gt;
--(Remember to use {}, not () or [])&lt;br /&gt;
braidClosure = L -&amp;gt;(&lt;br /&gt;
     K=new Link;&lt;br /&gt;
     K#braid=L;&lt;br /&gt;
     K)&lt;br /&gt;
&lt;br /&gt;
--This defines all links of 7 or fewer crossings by a braid closure.&lt;br /&gt;
K01=braidClosure {1};&lt;br /&gt;
K31=braidClosure {1,1,1};&lt;br /&gt;
K41=braidClosure {1,-2,1,-2};&lt;br /&gt;
K51=braidClosure {1,1,1,1,1};&lt;br /&gt;
--Warning: early versions of this program included the wrong braid representation for 5_2 (missing the first -1). Scott.&lt;br /&gt;
K52=braidClosure {-1,-1,-1,-2,1,-2};&lt;br /&gt;
K61=braidClosure {1,1,2,-1,-3,2,-3};&lt;br /&gt;
K62=braidClosure {-1,-1,-1,2,-1,2};&lt;br /&gt;
K63=braidClosure {-1,-1,2,-1,2,2};&lt;br /&gt;
K71=braidClosure {-1,-1,-1,-1,-1,-1,-1}&lt;br /&gt;
K72=braidClosure {-1,-1,-1,-2,1,-2,-3,2,-3}&lt;br /&gt;
K73=braidClosure {1,1,1,1,1,2,-1,2}&lt;br /&gt;
K74=braidClosure {1,1,2,-1,2,2,3,-2,3}&lt;br /&gt;
K75=braidClosure {-1,-1,-1,-1,-2,1,-2,-2}&lt;br /&gt;
K76=braidClosure {-1,-1,2,-1,-3,2,-3}&lt;br /&gt;
K77=braidClosure {1,-2,1,-2,3,-2,3}&lt;br /&gt;
&lt;br /&gt;
--This outputs a List of complexes, one in each Hochschild degree.&lt;br /&gt;
--The homology of these complexes is actual KR homology.  Mostly this function&lt;br /&gt;
--just feeds into others.&lt;br /&gt;
KR = K -&amp;gt; (&lt;br /&gt;
     if K#?KR then return K#KR else (&lt;br /&gt;
          if not K#?braid then error &amp;quot;no braid representation&amp;quot; else (&lt;br /&gt;
               Kb=K#braid;&lt;br /&gt;
               P=K#nbcross=#Kb;&lt;br /&gt;
               Ka=apply(Kb,abs);&lt;br /&gt;
               Kt=apply(Kb,i-&amp;gt;(i&amp;gt;0));&lt;br /&gt;
               Ks=sort Ka;&lt;br /&gt;
               --error Ks;&lt;br /&gt;
               bind=K#bindex=last(Ks)+1;&lt;br /&gt;
               R=QQ[vars(1 .. 2*P+bind)];&lt;br /&gt;
               Kmod = chainComplex( gradedModule(R^1));&lt;br /&gt;
               Cvars=new MutableList from toList (0..bind);&lt;br /&gt;
               --error Cvars#3;&lt;br /&gt;
               for I from 0 to P-1 do (&lt;br /&gt;
                    Kmod=Kmod**KhMods(Cvars#(Ka_I)-1,Cvars#(Ka_I+1)-1,bind+2*I,R,Kt_I);&lt;br /&gt;
                    Cvars#(Ka_I)=bind+2*I+1;&lt;br /&gt;
                    Cvars#(Ka_I+1)=bind+2*I+2;&lt;br /&gt;
                    );&lt;br /&gt;
               Ml=toList (1..bind);&lt;br /&gt;
               M=matrix {apply(Ml, I-&amp;gt; R_(Cvars#I-1)-R_(I-1))};&lt;br /&gt;
               KKR=Torify(Kmod,M);&lt;br /&gt;
               return KKR)&lt;br /&gt;
          )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--this function just makes the modules used in the complex above.&lt;br /&gt;
KhMods = (H,I,J,S,W) -&amp;gt; (&lt;br /&gt;
          Mp=S^1/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
          Np=S^{-1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
          Mn=S^{1}/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
          Nn=S^{1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
          if W then C=chainComplex(map(Mp,Np,(S_J-S_I))) else C=chainComplex(map(Nn,Mn))[1];&lt;br /&gt;
          C)&lt;br /&gt;
&lt;br /&gt;
--these extend Macaulay2&#039;s ability to take tensor products and induced maps.&lt;br /&gt;
ChainComplex ** Matrix := ChainComplexMap =&amp;gt; (C,f) -&amp;gt;(&lt;br /&gt;
     map(C ** target f,C** source f,i -&amp;gt; id_(C_i)**f))&lt;br /&gt;
&lt;br /&gt;
RingMap ** GradedModule := GradedModule =&amp;gt; (f,C) -&amp;gt; (&lt;br /&gt;
     D := new GradedModule;&lt;br /&gt;
     D#ring= target f;&lt;br /&gt;
     scan(spots C, i-&amp;gt;D#i=f**C#i);&lt;br /&gt;
     D) &lt;br /&gt;
&lt;br /&gt;
inducedchainMap = (C,D,f) -&amp;gt; (&lt;br /&gt;
     map(&lt;br /&gt;
          C,D,i-&amp;gt;inducedMap(C_i,D_i)&lt;br /&gt;
          )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--This has input a chain complex C and output a list of the complexes&lt;br /&gt;
--Tor^i(C,coker M), provided M is a regular sequence.&lt;br /&gt;
Torify = (C,M) -&amp;gt; (&lt;br /&gt;
     J:=rank source M;&lt;br /&gt;
     L:=(0..J);&lt;br /&gt;
     Lt=apply(L,I-&amp;gt;(&lt;br /&gt;
          F:=koszul(I,M);&lt;br /&gt;
          G:=koszul(I+1,M);&lt;br /&gt;
          FB=C**F;&lt;br /&gt;
          GB=C**G;&lt;br /&gt;
          CB=source FB;&lt;br /&gt;
          H=inducedchainMap(ker FB,image GB,id_CB);&lt;br /&gt;
          E=coker H;&lt;br /&gt;
          E));&lt;br /&gt;
     Lt)&lt;br /&gt;
&lt;br /&gt;
--input, a link.  output, KR homology (as modules).  this is less useful than you think, just because of the difficulty of reading the output.&lt;br /&gt;
KRHom = K -&amp;gt; (&lt;br /&gt;
          L:=KR(K);&lt;br /&gt;
          M:=apply(L,homology);&lt;br /&gt;
          N:=apply(M,prune);&lt;br /&gt;
          N)&lt;br /&gt;
&lt;br /&gt;
--This sends a chain complex to the list of degrees for which Macaulay2 remembers a module in it.&lt;br /&gt;
spots = C -&amp;gt; select(keys C, i -&amp;gt; class i === ZZ)&lt;br /&gt;
&lt;br /&gt;
degrees(GradedModule) := Function =&amp;gt; C -&amp;gt; (&lt;br /&gt;
     i -&amp;gt; degrees C_i)&lt;br /&gt;
&lt;br /&gt;
--input, a knot K. output ((1-t)/(1+q*t))*(the graded Hilbert &lt;br /&gt;
--polynomial of K).  THIS CURRENTLY ONLY WORKS FOR KNOTS, NOT LINKS.&lt;br /&gt;
KRpoly = K -&amp;gt; (&lt;br /&gt;
--     if K#?KRpoly then return K#KRpoly;&lt;br /&gt;
     L:=KRHom K;&lt;br /&gt;
     R:=ring L_0;&lt;br /&gt;
     Rn:=#generators R;&lt;br /&gt;
     S:=QQ[t];&lt;br /&gt;
     f=map(S,R,apply(toList (1..Rn),i-&amp;gt;t));&lt;br /&gt;
     M:=apply(L, C -&amp;gt; f**C);&lt;br /&gt;
     N:=apply(M,degrees);&lt;br /&gt;
     K#KRdeg=N;&lt;br /&gt;
     Pring=QQ[q,s,t,Inverses=&amp;gt;true];&lt;br /&gt;
     spoM:=sort (spots M_0);&lt;br /&gt;
     P:=sum(apply(toList (0..#M-1), i-&amp;gt; (&lt;br /&gt;
                    q^i*sum(apply(spoM, j-&amp;gt; (&lt;br /&gt;
                                   s^j*sum(apply(flatten N_i j, k-&amp;gt;t^k))&lt;br /&gt;
                                   )&lt;br /&gt;
                         ))&lt;br /&gt;
               )&lt;br /&gt;
        )); &lt;br /&gt;
     K#KRpoly=P//(q*t+1);&lt;br /&gt;
     K#KRpoly)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=49217</id>
		<title>User:Ben/KRhomology</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=49217"/>
		<updated>2005-12-08T16:04:34Z</updated>

		<summary type="html">&lt;p&gt;Ben: changed program to hopefully use less memory&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Actual calculations==&lt;br /&gt;
Note: these polynomials are missing fudge factors.  These will be fixed when I get back to Berkeley on Wednesday.&lt;br /&gt;
&lt;br /&gt;
Here is a table of known KR homologies.  We let &amp;lt;math&amp;gt;KR_K(q,s,t)&amp;lt;/math&amp;gt; be the Hilbert series of KR homology.  Note that a factor of the Hilbert series of the unknot appears in all of them.  This will not be true of links, I believe.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, computation seems to bog down very fast.  [[6_1]] has been giving me a lot of trouble, probably because it has braid index 4.  If someone with a faster machine would run it, I would be very appreciative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039; the polynomial for [[5_2]] here is incorrect. The correct value appears on the main Knot Atlas page for [[5_2]]. --[[User:Scott|Scott]] 12:48, 3 Dec 2005 (EST)&lt;br /&gt;
&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[0_1]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\frac{{q} {t}+1}{1-t}&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[3_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(s^{2} t^{2}+{q} t^{2}+1)&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[4_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(t^{{-1}}+{q} {t}+{q} s^{{-1}}+{q} s^{{-{2}}} t^{{-1}}+q^{2} s^{{-{2}}} {t})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(1+s^{2} t^{2}+s^{4} t^{4}+{q} s^{2} t^{4}+{q} t^{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_2]]   &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)({q}+q^{2} s^{{-{2}}}+t^{{-{2}}}+q^{2} s^{{-{3}}} t^{{-1}}+{q} s^{{-{2}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[6_2]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)({q} {t}+q^{2} s^{{-{2}}} {t}+{q} s^{{-1}}+t^{{-1}}+2 {q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+q^{2} s^{{-{4}}} t^{{-1}}+{q}s^{{-{3}}} t^{{-{2}}}+s^{{-{2}}} t^{{-{3}}}+{q} s^{{-{4}}} t^{{-{3}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  [[6_3]]&lt;br /&gt;
| &amp;lt;math&amp;gt;{\left(\frac{{q} {t}+1}{1-t}\right)(q} {s} t^{2}+q^{2} s^{{-1}} t^{2}+{q} {t}+{s}+q^{2} s^{{-{2}}} {t}+3 {q} s^{{-1}}+t^{{-1}}+q^{2} s^{{-{3}}}+{q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+{q} s^{{-{3}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
I&#039;ve been running more calculations on panda and neuron, two of the fast computers in the math department. I&#039;ve got panda working through all the braid index 3 knots, and it&#039;s started giving some results. [[7_3]]  took about half an hour, and consumed about a gig of memory. --[[User:Scott|Scott]] 02:16, 30 Nov 2005 (EST)&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[7_3]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)({q} s^{3} t^{5}+s^{4} t^{4}+q^{2} {s} t^{5}+{q} s^{2} t^{4}+s^{3} t^{3}+2 {q} {s} t^{3}+s^{2} t^{2}+q^{2} s^{{-1}} t^{3}+{q} t^{2}+{s} {t}+{q} s^{{-1}} {t}+1)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[7_5]]&lt;br /&gt;
| &amp;lt;math&amp;gt; \left(\frac{{q} {t}+1}{1-t}\right) (q^{2} s^{{-{2}}}+{q} s^{{-1}} t^{{-1}}+q^{2} s^{{-{3}}} t^{{-1}}+2 {q} s^{{-{2}}} t^{{-{2}}}+s^{{-1}} t^{{-{3}}}+2 q^{2} s^{{-{4}}} t^{{-{2}}}+2 {q} s^{{-{3}}} t^{{-{3}}}+s^{{-{2}}} t^{{-{4}}}+q^{2} s^{{-{5}}} t^{{-{3}}}+2 {q} s^{{-{4}}} t^{{-{4}}}+s^{{-{3}}} t^{{-{5}}}+q^{2} s^{{-{6}}} t^{{-{4}}}+{q} s^{{-{5}}} t^{{-{5}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
neuron is working on braid index 4 knots, starting with [[6_1]], and seems to be working fine. [[6_1]] took over an hour, and about 1.2 gigs of memory. --[[User:Scott|Scott]] 02:59, 30 Nov 2005 (EST)&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[6_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(q^{2} s^{{-1}} t^{2}+{q} {t}+q^{3} s^{{-{3}}} t^{2}+q^{2} s^{{-{2}}} {t}+2 {q} s^{{-1}}+t^{{-1}}+q^{2} s^{{-{3}}}+{q} s^{{-{2}}} t^{{-1}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Theoretical stuff==&lt;br /&gt;
I have some ideas which I hope will be of interest to ya&#039;ll, but I&#039;d like to mull them a bit longer.  Maybe when I get back on Wednesday.&lt;br /&gt;
&lt;br /&gt;
For those who are curious, the polynomials above should follow the skein relation &amp;lt;math&amp;gt;q(-)+q^{-1}(+)=(t^{-1}-t)(| |)&amp;lt;/math&amp;gt; after subsituting &#039;&#039;s=-1.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Macaulay2 program==&lt;br /&gt;
Save this as a file (called KR.m2), open Macaulay2 (in command line or emacs), and type &amp;lt;code&amp;gt;load &amp;quot;KR.m2&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;KRpoly&amp;lt;/code&amp;gt; is probabby the command you want (but it only works for knots at the moment). It outputs &amp;lt;math&amp;gt;\frac{1-t}{qt+1}KR_K(q,s,t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using &amp;lt;code&amp;gt;texMath&amp;lt;/code&amp;gt; puts things in format for LaTeX.  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample session:&lt;br /&gt;
&amp;lt;pre&amp;gt;Macaulay 2, version 0.9&lt;br /&gt;
--Copyright 1993-2001, D. R. Grayson and M. E. Stillman&lt;br /&gt;
--Singular-Factory 1.3b, copyright 1993-2001, G.-M. Greuel, et al.&lt;br /&gt;
--Singular-Libfac 0.3.2, copyright 1996-2001, M. Messollen&lt;br /&gt;
&lt;br /&gt;
i1 : load &amp;quot;KR.m2&amp;quot;&lt;br /&gt;
KR.m2:113:11: warning: local declaration of N shields variable with same name&lt;br /&gt;
--loaded KR.m2&lt;br /&gt;
&lt;br /&gt;
i2 : texMath KRpoly K01&lt;br /&gt;
&lt;br /&gt;
o2 = 1&lt;br /&gt;
&lt;br /&gt;
i3 : texMath KRpoly K31&lt;br /&gt;
&lt;br /&gt;
o3 = s^{2} t^{2}+{q} t^{2}+1&lt;br /&gt;
&lt;br /&gt;
i4 : &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the code for the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--KR.m2&lt;br /&gt;
--This file defines a new object for Macaulay2, called a &amp;quot;Link.&amp;quot;&lt;br /&gt;
--Like all objects in Macaulay2, a Link is just a hash table.&lt;br /&gt;
--Defining a link lets you store information about it for later use.  &lt;br /&gt;
&lt;br /&gt;
Link = new Type of MutableHashTable &lt;br /&gt;
Link.synonym = &amp;quot;link&amp;quot;&lt;br /&gt;
new Link := Link =&amp;gt; (cl) -&amp;gt; (&lt;br /&gt;
     C:=newClass(Link,new MutableHashTable);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--braidClosure is currently the only useful way of defining a link.  &lt;br /&gt;
--I think it should be clear from the examples below how to use it.&lt;br /&gt;
--(Remember to use {}, not () or [])&lt;br /&gt;
braidClosure = L -&amp;gt;(&lt;br /&gt;
     K=new Link;&lt;br /&gt;
     K#braid=L;&lt;br /&gt;
     K)&lt;br /&gt;
&lt;br /&gt;
--This defines all links of 7 or fewer crossings by a braid closure.&lt;br /&gt;
K01=braidClosure {1};&lt;br /&gt;
K31=braidClosure {1,1,1};&lt;br /&gt;
K41=braidClosure {1,-2,1,-2};&lt;br /&gt;
K51=braidClosure {1,1,1,1,1};&lt;br /&gt;
--Warning: early versions of this program included the wrong braid representation for 5_2 (missing the first -1). Scott.&lt;br /&gt;
K52=braidClosure {-1,-1,-1,-2,1,-2};&lt;br /&gt;
K61=braidClosure {1,1,2,-1,-3,2,-3};&lt;br /&gt;
K62=braidClosure {-1,-1,-1,2,-1,2};&lt;br /&gt;
K63=braidClosure {-1,-1,2,-1,2,2};&lt;br /&gt;
K71=braidClosure {-1,-1,-1,-1,-1,-1,-1}&lt;br /&gt;
K72=braidClosure {-1,-1,-1,-2,1,-2,-3,2,-3}&lt;br /&gt;
K73=braidClosure {1,1,1,1,1,2,-1,2}&lt;br /&gt;
K74=braidClosure {1,1,2,-1,2,2,3,-2,3}&lt;br /&gt;
K75=braidClosure {-1,-1,-1,-1,-2,1,-2,-2}&lt;br /&gt;
K76=braidClosure {-1,-1,2,-1,-3,2,-3}&lt;br /&gt;
K77=braidClosure {1,-2,1,-2,3,-2,3}&lt;br /&gt;
&lt;br /&gt;
--This outputs a List of complexes, one in each Hochschild degree.&lt;br /&gt;
--The homology of these complexes is actual KR homology.  Mostly this function&lt;br /&gt;
--just feeds into others.&lt;br /&gt;
KR = K -&amp;gt; (&lt;br /&gt;
     if K#?KR then return K#KR else (&lt;br /&gt;
          if not K#?braid then error &amp;quot;no braid representation&amp;quot; else (&lt;br /&gt;
               Kb=K#braid;&lt;br /&gt;
               P=K#nbcross=#Kb;&lt;br /&gt;
               Ka=apply(Kb,abs);&lt;br /&gt;
               Kt=apply(Kb,i-&amp;gt;(i&amp;gt;0));&lt;br /&gt;
               Ks=sort Ka;&lt;br /&gt;
               --error Ks;&lt;br /&gt;
               bind=K#bindex=last(Ks)+1;&lt;br /&gt;
               R=QQ[vars(1 .. 2*P+bind)];&lt;br /&gt;
               Kmod = chainComplex( gradedModule(R^1));&lt;br /&gt;
               Cvars=new MutableList from toList (0..bind);&lt;br /&gt;
               --error Cvars#3;&lt;br /&gt;
               for I from 0 to P-1 do (&lt;br /&gt;
                    Kmod=Kmod**KhMods(Cvars#(Ka_I)-1,Cvars#(Ka_I+1)-1,bind+2*I,R,Kt_I);&lt;br /&gt;
                    Cvars#(Ka_I)=bind+2*I+1;&lt;br /&gt;
                    Cvars#(Ka_I+1)=bind+2*I+2;&lt;br /&gt;
                    );&lt;br /&gt;
               Ml=toList (1..bind);&lt;br /&gt;
               M=matrix {apply(Ml, I-&amp;gt; R_(Cvars#I-1)-R_(I-1))};&lt;br /&gt;
               KKR=Torify(Kmod,M);&lt;br /&gt;
               return KKR)&lt;br /&gt;
          )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--this function just makes the modules used in the complex above.&lt;br /&gt;
KhMods = (H,I,J,S,W) -&amp;gt; (&lt;br /&gt;
          Mp=S^1/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
          Np=S^{-1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
          Mn=S^{1}/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
          Nn=S^{1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
          if W then C=chainComplex(map(Mp,Np,(S_J-S_I))) else C=chainComplex(map(Nn,Mn))[1];&lt;br /&gt;
          C)&lt;br /&gt;
&lt;br /&gt;
--these extend Macaulay2&#039;s ability to take tensor products and induced maps.&lt;br /&gt;
ChainComplex ** Matrix := ChainComplexMap =&amp;gt; (C,f) -&amp;gt;(&lt;br /&gt;
     map(C ** target f,C** source f,i -&amp;gt; id_(C_i)**f))&lt;br /&gt;
&lt;br /&gt;
RingMap ** GradedModule := GradedModule =&amp;gt; (f,C) -&amp;gt; (&lt;br /&gt;
     D := new GradedModule;&lt;br /&gt;
     D#ring= target f;&lt;br /&gt;
     scan(spots C, i-&amp;gt;D#i=f**C#i);&lt;br /&gt;
     D) &lt;br /&gt;
&lt;br /&gt;
inducedchainMap = (C,D,f) -&amp;gt; (&lt;br /&gt;
     map(&lt;br /&gt;
          C,D,i-&amp;gt;inducedMap(C_i,D_i)&lt;br /&gt;
          )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--This has input a chain complex C and output a list of the complexes&lt;br /&gt;
--Tor^i(C,coker M), provided M is a regular sequence.&lt;br /&gt;
Torify = (C,M) -&amp;gt; (&lt;br /&gt;
     J:=rank source M;&lt;br /&gt;
     L:=(0..J);&lt;br /&gt;
     Lt=apply(L,I-&amp;gt;(&lt;br /&gt;
          F:=koszul(I,M);&lt;br /&gt;
          G:=koszul(I+1,M);&lt;br /&gt;
          FB=C**F;&lt;br /&gt;
          GB=C**G;&lt;br /&gt;
          CB=source FB;&lt;br /&gt;
          H=inducedchainMap(ker FB,image GB,id_CB);&lt;br /&gt;
          E=coker H;&lt;br /&gt;
          E));&lt;br /&gt;
     Lt)&lt;br /&gt;
&lt;br /&gt;
--input, a link.  output, KR homology (as modules).  this is less useful than you think, just because of the difficulty of reading the output.&lt;br /&gt;
KRHom = K -&amp;gt; (&lt;br /&gt;
          L:=KR(K);&lt;br /&gt;
          M:=apply(L,homology);&lt;br /&gt;
          N:=apply(M,prune);&lt;br /&gt;
          N)&lt;br /&gt;
&lt;br /&gt;
--This sends a chain complex to the list of degrees for which Macaulay2 remembers a module in it.&lt;br /&gt;
spots = C -&amp;gt; select(keys C, i -&amp;gt; class i === ZZ)&lt;br /&gt;
&lt;br /&gt;
degrees(GradedModule) := Function =&amp;gt; C -&amp;gt; (&lt;br /&gt;
     i -&amp;gt; degrees C_i)&lt;br /&gt;
&lt;br /&gt;
--input, a knot K. output ((1-t)/(1+q*t))*(the graded Hilbert &lt;br /&gt;
--polynomial of K).  THIS CURRENTLY ONLY WORKS FOR KNOTS, NOT LINKS.&lt;br /&gt;
KRpoly = K -&amp;gt; (&lt;br /&gt;
     if K#?KRpoly then return K#KRpoly;&lt;br /&gt;
     L:=KRHom K;&lt;br /&gt;
     R:=ring L_0;&lt;br /&gt;
     Rn:=#generators R;&lt;br /&gt;
     S:=QQ[t];&lt;br /&gt;
     f=map(S,R,apply(toList (1..Rn),i-&amp;gt;t));&lt;br /&gt;
     M:=apply(L, C -&amp;gt; f**C);&lt;br /&gt;
     N:=apply(M,degrees);&lt;br /&gt;
     K#KRdeg=N;&lt;br /&gt;
     Pring=QQ[q,s,t,Inverses=&amp;gt;true];&lt;br /&gt;
     spoM:=sort (spots M_0);&lt;br /&gt;
     P:=sum(apply(toList (0..#M-1), i-&amp;gt; (&lt;br /&gt;
                    q^i*sum(apply(spoM, j-&amp;gt; (&lt;br /&gt;
                                   s^j*sum(apply(flatten N_i j, k-&amp;gt;t^k))&lt;br /&gt;
                                   )&lt;br /&gt;
                         ))&lt;br /&gt;
               )&lt;br /&gt;
        )); &lt;br /&gt;
     K#KRpoly=P//(q*t+1)&lt;br /&gt;
     K#KRpoly)&lt;br /&gt;
     &lt;br /&gt;
KRdisp =K -&amp;gt; (&lt;br /&gt;
     if not K#?KRdeg then KRpoly K;&lt;br /&gt;
     N=K#KRdeg;&lt;br /&gt;
     spoM=spots K#KRHom_0;&lt;br /&gt;
     net P || &amp;quot;  &amp;quot; || ( &amp;quot;  &amp;quot; || stack apply(spoM, net)) | &amp;quot;  &amp;quot; | horizontalJoin between(&amp;quot;  &amp;quot;, apply(&lt;br /&gt;
               toList (0..#M-1),i-&amp;gt; net i || stack(&lt;br /&gt;
                    apply(&lt;br /&gt;
                         spoM,j-&amp;gt;net(flatten(N_i j))&lt;br /&gt;
                         )&lt;br /&gt;
                    )&lt;br /&gt;
               )&lt;br /&gt;
          )&lt;br /&gt;
     )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=49216</id>
		<title>User:Ben/KRhomology</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=49216"/>
		<updated>2005-12-08T13:31:34Z</updated>

		<summary type="html">&lt;p&gt;Ben: /* Theoretical stuff */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Actual calculations==&lt;br /&gt;
Note: these polynomials are missing fudge factors.  These will be fixed when I get back to Berkeley on Wednesday.&lt;br /&gt;
&lt;br /&gt;
Here is a table of known KR homologies.  We let &amp;lt;math&amp;gt;KR_K(q,s,t)&amp;lt;/math&amp;gt; be the Hilbert series of KR homology.  Note that a factor of the Hilbert series of the unknot appears in all of them.  This will not be true of links, I believe.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, computation seems to bog down very fast.  [[6_1]] has been giving me a lot of trouble, probably because it has braid index 4.  If someone with a faster machine would run it, I would be very appreciative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039; the polynomial for [[5_2]] here is incorrect. The correct value appears on the main Knot Atlas page for [[5_2]]. --[[User:Scott|Scott]] 12:48, 3 Dec 2005 (EST)&lt;br /&gt;
&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[0_1]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\frac{{q} {t}+1}{1-t}&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[3_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(s^{2} t^{2}+{q} t^{2}+1)&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[4_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(t^{{-1}}+{q} {t}+{q} s^{{-1}}+{q} s^{{-{2}}} t^{{-1}}+q^{2} s^{{-{2}}} {t})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(1+s^{2} t^{2}+s^{4} t^{4}+{q} s^{2} t^{4}+{q} t^{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_2]]   &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)({q}+q^{2} s^{{-{2}}}+t^{{-{2}}}+q^{2} s^{{-{3}}} t^{{-1}}+{q} s^{{-{2}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[6_2]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)({q} {t}+q^{2} s^{{-{2}}} {t}+{q} s^{{-1}}+t^{{-1}}+2 {q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+q^{2} s^{{-{4}}} t^{{-1}}+{q}s^{{-{3}}} t^{{-{2}}}+s^{{-{2}}} t^{{-{3}}}+{q} s^{{-{4}}} t^{{-{3}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  [[6_3]]&lt;br /&gt;
| &amp;lt;math&amp;gt;{\left(\frac{{q} {t}+1}{1-t}\right)(q} {s} t^{2}+q^{2} s^{{-1}} t^{2}+{q} {t}+{s}+q^{2} s^{{-{2}}} {t}+3 {q} s^{{-1}}+t^{{-1}}+q^{2} s^{{-{3}}}+{q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+{q} s^{{-{3}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
I&#039;ve been running more calculations on panda and neuron, two of the fast computers in the math department. I&#039;ve got panda working through all the braid index 3 knots, and it&#039;s started giving some results. [[7_3]]  took about half an hour, and consumed about a gig of memory. --[[User:Scott|Scott]] 02:16, 30 Nov 2005 (EST)&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[7_3]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)({q} s^{3} t^{5}+s^{4} t^{4}+q^{2} {s} t^{5}+{q} s^{2} t^{4}+s^{3} t^{3}+2 {q} {s} t^{3}+s^{2} t^{2}+q^{2} s^{{-1}} t^{3}+{q} t^{2}+{s} {t}+{q} s^{{-1}} {t}+1)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[7_5]]&lt;br /&gt;
| &amp;lt;math&amp;gt; \left(\frac{{q} {t}+1}{1-t}\right) (q^{2} s^{{-{2}}}+{q} s^{{-1}} t^{{-1}}+q^{2} s^{{-{3}}} t^{{-1}}+2 {q} s^{{-{2}}} t^{{-{2}}}+s^{{-1}} t^{{-{3}}}+2 q^{2} s^{{-{4}}} t^{{-{2}}}+2 {q} s^{{-{3}}} t^{{-{3}}}+s^{{-{2}}} t^{{-{4}}}+q^{2} s^{{-{5}}} t^{{-{3}}}+2 {q} s^{{-{4}}} t^{{-{4}}}+s^{{-{3}}} t^{{-{5}}}+q^{2} s^{{-{6}}} t^{{-{4}}}+{q} s^{{-{5}}} t^{{-{5}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
neuron is working on braid index 4 knots, starting with [[6_1]], and seems to be working fine. [[6_1]] took over an hour, and about 1.2 gigs of memory. --[[User:Scott|Scott]] 02:59, 30 Nov 2005 (EST)&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[6_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(q^{2} s^{{-1}} t^{2}+{q} {t}+q^{3} s^{{-{3}}} t^{2}+q^{2} s^{{-{2}}} {t}+2 {q} s^{{-1}}+t^{{-1}}+q^{2} s^{{-{3}}}+{q} s^{{-{2}}} t^{{-1}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Theoretical stuff==&lt;br /&gt;
I have some ideas which I hope will be of interest to ya&#039;ll, but I&#039;d like to mull them a bit longer.  Maybe when I get back on Wednesday.&lt;br /&gt;
&lt;br /&gt;
For those who are curious, the polynomials above should follow the skein relation &amp;lt;math&amp;gt;q(-)+q^{-1}(+)=(t^{-1}-t)(| |)&amp;lt;/math&amp;gt; after subsituting &#039;&#039;s=-1.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Macaulay2 program==&lt;br /&gt;
Save this as a file (called KR.m2), open Macaulay2 (in command line or emacs), and type &amp;lt;code&amp;gt;load &amp;quot;KR.m2&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;KRpoly&amp;lt;/code&amp;gt; is probabby the command you want (but it only works for knots at the moment). It outputs &amp;lt;math&amp;gt;\frac{1-t}{qt+1}KR_K(q,s,t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using &amp;lt;code&amp;gt;texMath&amp;lt;/code&amp;gt; puts things in format for LaTeX.  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample session:&lt;br /&gt;
&amp;lt;pre&amp;gt;Macaulay 2, version 0.9&lt;br /&gt;
--Copyright 1993-2001, D. R. Grayson and M. E. Stillman&lt;br /&gt;
--Singular-Factory 1.3b, copyright 1993-2001, G.-M. Greuel, et al.&lt;br /&gt;
--Singular-Libfac 0.3.2, copyright 1996-2001, M. Messollen&lt;br /&gt;
&lt;br /&gt;
i1 : load &amp;quot;KR.m2&amp;quot;&lt;br /&gt;
KR.m2:113:11: warning: local declaration of N shields variable with same name&lt;br /&gt;
--loaded KR.m2&lt;br /&gt;
&lt;br /&gt;
i2 : texMath KRpoly K01&lt;br /&gt;
&lt;br /&gt;
o2 = 1&lt;br /&gt;
&lt;br /&gt;
i3 : texMath KRpoly K31&lt;br /&gt;
&lt;br /&gt;
o3 = s^{2} t^{2}+{q} t^{2}+1&lt;br /&gt;
&lt;br /&gt;
i4 : &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the code for the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--KR.m2&lt;br /&gt;
--This file defines a new object for Macaulay2, called a &amp;quot;Link.&amp;quot;&lt;br /&gt;
--Like all objects in Macaulay2, a Link is just a hash table.&lt;br /&gt;
--Defining a link lets you store information about it for later use.  &lt;br /&gt;
&lt;br /&gt;
Link = new Type of MutableHashTable &lt;br /&gt;
Link.synonym = &amp;quot;link&amp;quot;&lt;br /&gt;
new Link := Link =&amp;gt; (cl) -&amp;gt; (&lt;br /&gt;
     C:=newClass(Link,new MutableHashTable);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--braidClosure is currently the only useful way of defining a link.  &lt;br /&gt;
--I think it should be clear from the examples below how to use it.&lt;br /&gt;
--(Remember to use {}, not () or [])&lt;br /&gt;
braidClosure = L -&amp;gt;(&lt;br /&gt;
     K=new Link;&lt;br /&gt;
     K#braid=L;&lt;br /&gt;
     K)&lt;br /&gt;
&lt;br /&gt;
--This defines all links of 7 or fewer crossings by a braid closure.&lt;br /&gt;
K01=braidClosure {1};&lt;br /&gt;
K31=braidClosure {1,1,1};&lt;br /&gt;
K41=braidClosure {1,-2,1,-2};&lt;br /&gt;
K51=braidClosure {1,1,1,1,1};&lt;br /&gt;
--Warning: early versions of this program included the wrong braid representation for 5_2 (missing the first -1). Scott.&lt;br /&gt;
K52=braidClosure {-1,-1,-1,-2,1,-2};&lt;br /&gt;
K61=braidClosure {1,1,2,-1,-3,2,-3};&lt;br /&gt;
K62=braidClosure {-1,-1,-1,2,-1,2};&lt;br /&gt;
K63=braidClosure {-1,-1,2,-1,2,2};&lt;br /&gt;
K71=braidClosure {-1,-1,-1,-1,-1,-1,-1}&lt;br /&gt;
K72=braidClosure {-1,-1,-1,-2,1,-2,-3,2,-3}&lt;br /&gt;
K73=braidClosure {1,1,1,1,1,2,-1,2}&lt;br /&gt;
K74=braidClosure {1,1,2,-1,2,2,3,-2,3}&lt;br /&gt;
K75=braidClosure {-1,-1,-1,-1,-2,1,-2,-2}&lt;br /&gt;
K76=braidClosure {-1,-1,2,-1,-3,2,-3}&lt;br /&gt;
K77=braidClosure {1,-2,1,-2,3,-2,3}&lt;br /&gt;
&lt;br /&gt;
--This outputs a List of complexes, one in each Hochschild degree.&lt;br /&gt;
--The homology of these complexes is actual KR homology.  Mostly this function&lt;br /&gt;
--just feeds into others.&lt;br /&gt;
KR = K -&amp;gt; (&lt;br /&gt;
     if K#?KR then return K#KR else (&lt;br /&gt;
     	  if not K#?braid then error &amp;quot;no braid representation&amp;quot; else (&lt;br /&gt;
     	       Kb=K#braid;&lt;br /&gt;
	       P=K#nbcross=#Kb;&lt;br /&gt;
     	       Ka=apply(Kb,abs);&lt;br /&gt;
     	       Kt=apply(Kb,i-&amp;gt;(i&amp;gt;0));&lt;br /&gt;
     	       Ks=sort Ka;&lt;br /&gt;
     	       --error Ks;&lt;br /&gt;
     	       bind=K#bindex=last(Ks)+1;&lt;br /&gt;
     	       R=QQ[vars(1 .. 2*P+bind)];&lt;br /&gt;
     	       Kmod = chainComplex( gradedModule(R^1));&lt;br /&gt;
     	       Cvars=new MutableList from toList (0..bind);&lt;br /&gt;
      	       --error Cvars#3;&lt;br /&gt;
     	       for I from 0 to P-1 do (&lt;br /&gt;
	  	    Kmod=Kmod**KhMods(Cvars#(Ka_I)-1,Cvars#(Ka_I+1)-1,bind+2*I,R,Kt_I);&lt;br /&gt;
	  	    Cvars#(Ka_I)=bind+2*I+1;&lt;br /&gt;
	  	    Cvars#(Ka_I+1)=bind+2*I+2;&lt;br /&gt;
	  	    );&lt;br /&gt;
               Ml=toList (1..bind);&lt;br /&gt;
     	       M=matrix {apply(Ml, I-&amp;gt; R_(Cvars#I-1)-R_(I-1))};&lt;br /&gt;
     	       K#KR=Torify(Kmod,M);&lt;br /&gt;
	       return K#KR)&lt;br /&gt;
       	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--this function just makes the modules used in the complex above.&lt;br /&gt;
KhMods = (H,I,J,S,W) -&amp;gt; (&lt;br /&gt;
          Mp=S^1/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Np=S^{-1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  Mn=S^{1}/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Nn=S^{1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  if W then C=chainComplex(map(Mp,Np,(S_J-S_I))) else C=chainComplex(map(Nn,Mn))[1];&lt;br /&gt;
	  C)&lt;br /&gt;
&lt;br /&gt;
--these extend Macaulay2&#039;s ability to take tensor products and induced maps.&lt;br /&gt;
ChainComplex ** Matrix := ChainComplexMap =&amp;gt; (C,f) -&amp;gt;(&lt;br /&gt;
     map(C ** target f,C** source f,i -&amp;gt; id_(C_i)**f))&lt;br /&gt;
&lt;br /&gt;
RingMap ** GradedModule := GradedModule =&amp;gt; (f,C) -&amp;gt; (&lt;br /&gt;
     D := new GradedModule;&lt;br /&gt;
     D#ring= target f;&lt;br /&gt;
     scan(spots C, i-&amp;gt;D#i=f**C#i);&lt;br /&gt;
     D) &lt;br /&gt;
&lt;br /&gt;
inducedchainMap = (C,D,f) -&amp;gt; (&lt;br /&gt;
     map(&lt;br /&gt;
	  C,D,i-&amp;gt;inducedMap(C_i,D_i)&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--This has input a chain complex C and output a list of the complexes&lt;br /&gt;
--Tor^i(C,coker M), provided M is a regular sequence.&lt;br /&gt;
Torify = (C,M) -&amp;gt; (&lt;br /&gt;
     J:=rank source M;&lt;br /&gt;
     L:=(0..J);&lt;br /&gt;
     Lt=apply(L,I-&amp;gt;(&lt;br /&gt;
	  F:=koszul(I,M);&lt;br /&gt;
	  G:=koszul(I+1,M);&lt;br /&gt;
	  FB=C**F;&lt;br /&gt;
	  GB=C**G;&lt;br /&gt;
	  CB=source FB;&lt;br /&gt;
     	  --error CB==target GB;&lt;br /&gt;
	  H=inducedchainMap(ker FB,image GB,id_CB);&lt;br /&gt;
	  --error H;&lt;br /&gt;
	  E=coker H;&lt;br /&gt;
	  E));&lt;br /&gt;
     Lt)&lt;br /&gt;
&lt;br /&gt;
--input, a link.  output, KR homology (as modules).  this is less useful than you think, just because of the difficulty of reading the output.&lt;br /&gt;
KRHom = K -&amp;gt; (&lt;br /&gt;
     if K#?KRHom then N:=K#KRHom else (&lt;br /&gt;
     	  L:=KR(K);&lt;br /&gt;
     	  M:=apply(L,homology);&lt;br /&gt;
     	  N:=apply(M,prune);&lt;br /&gt;
	  K#KRHom=N;&lt;br /&gt;
	  );&lt;br /&gt;
     stack(apply(N,net)))&lt;br /&gt;
&lt;br /&gt;
--This sends a chain complex to the list of degrees for which Macaulay2 remembers a module in it.&lt;br /&gt;
spots = C -&amp;gt; select(keys C, i -&amp;gt; class i === ZZ)&lt;br /&gt;
&lt;br /&gt;
degrees(GradedModule) := Function =&amp;gt; C -&amp;gt; (&lt;br /&gt;
     i -&amp;gt; degrees C_i)&lt;br /&gt;
&lt;br /&gt;
--input, a knot K. output ((1-t)/(1+q*t))*(the graded Hilbert &lt;br /&gt;
--polynomial of K).  THIS CURRENTLY ONLY WORKS FOR KNOTS, NOT LINKS.&lt;br /&gt;
KRpoly = K -&amp;gt; (&lt;br /&gt;
     if K#?KRpoly then return K#KRpoly;&lt;br /&gt;
     if not K#?KRHom then KRHom(K);&lt;br /&gt;
     L:=K#KRHom;&lt;br /&gt;
     R:=ring L_0;&lt;br /&gt;
     Rn:=#generators R;&lt;br /&gt;
     S:=QQ[t];&lt;br /&gt;
     f=map(S,R,apply(toList (1..Rn),i-&amp;gt;t));&lt;br /&gt;
     M:=apply(L, C -&amp;gt; f**C);&lt;br /&gt;
     N:=apply(M,degrees);&lt;br /&gt;
     K#KRdeg=N;&lt;br /&gt;
     Pring=QQ[q,s,t,Inverses=&amp;gt;true];&lt;br /&gt;
     spoM:=sort (spots M_0);&lt;br /&gt;
     P:=sum(apply(toList (0..#M-1), i-&amp;gt; (&lt;br /&gt;
		    q^i*sum(apply(spoM, j-&amp;gt; (&lt;br /&gt;
				   s^j*sum(apply(flatten N_i j, k-&amp;gt;t^k))&lt;br /&gt;
				   )&lt;br /&gt;
			 ))&lt;br /&gt;
	       )&lt;br /&gt;
	)); &lt;br /&gt;
     K#KRpoly=P;&lt;br /&gt;
     P//(q*t+1))&lt;br /&gt;
     &lt;br /&gt;
KRdisp =K -&amp;gt; (&lt;br /&gt;
     if not K#?KRdeg then KRpoly K;&lt;br /&gt;
     N=K#KRdeg;&lt;br /&gt;
     spoM=spots K#KRHom_0;&lt;br /&gt;
     net P || &amp;quot;  &amp;quot; || ( &amp;quot;  &amp;quot; || stack apply(spoM, net)) | &amp;quot;  &amp;quot; | horizontalJoin between(&amp;quot;  &amp;quot;, apply(&lt;br /&gt;
	       toList (0..#M-1),i-&amp;gt; net i || stack(&lt;br /&gt;
		    apply(&lt;br /&gt;
			 spoM,j-&amp;gt;net(flatten(N_i j))&lt;br /&gt;
			 )&lt;br /&gt;
		    )&lt;br /&gt;
	       )&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=48641</id>
		<title>User:Ben/KRhomology</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=48641"/>
		<updated>2005-11-29T05:05:08Z</updated>

		<summary type="html">&lt;p&gt;Ben: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Actual calculations==&lt;br /&gt;
Here is a table of known KR homologies.  We let &amp;lt;math&amp;gt;KR_K(q,s,t)&amp;lt;/math&amp;gt; be the Hilbert series of KR homology.  Note that a factor of the Hilbert series of the unknot appears in all of them.  This will not be true of links, I believe.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, computation seems to bog down very fast.  [[6_1]] has been giving me a lot of trouble, probably because it has braid index 4.  If someone with a faster machine would run it, I would be very appreciative.&lt;br /&gt;
&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[0_1]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\frac{{q} {t}+1}{1-t}&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[3_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(s^{2} t^{2}+{q} t^{2}+1)&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[4_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(t^{{-1}}+{q} {t}+{q} s^{{-1}}+{q} s^{{-{2}}} t^{{-1}}+q^{2} s^{{-{2}}} {t})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)(1+s^{2} t^{2}+s^{4} t^{4}+{q} s^{2} t^{4}+{q} t^{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_2]]   &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)({q}+q^{2} s^{{-{2}}}+t^{{-{2}}}+q^{2} s^{{-{3}}} t^{{-1}}+{q} s^{{-{2}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[6_2]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{1-t}\right)({q} {t}+q^{2} s^{{-{2}}} {t}+{q} s^{{-1}}+t^{{-1}}+2 {q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+q^{2} s^{{-{4}}} t^{{-1}}+{q}s^{{-{3}}} t^{{-{2}}}+s^{{-{2}}} t^{{-{3}}}+{q} s^{{-{4}}} t^{{-{3}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  [[6_3]]&lt;br /&gt;
| &amp;lt;math&amp;gt;{\left(\frac{{q} {t}+1}{1-t}\right)(q} {s} t^{2}+q^{2} s^{{-1}} t^{2}+{q} {t}+{s}+q^{2} s^{{-{2}}} {t}+3 {q} s^{{-1}}+t^{{-1}}+q^{2} s^{{-{3}}}+{q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+{q} s^{{-{3}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Theoretical stuff==&lt;br /&gt;
I have some ideas which I hope will be of interest to ya&#039;ll, but I&#039;d like to mull them a bit longer.  Maybe when I get back on Wednesday.&lt;br /&gt;
&lt;br /&gt;
==Macaulay2 program==&lt;br /&gt;
Save this as a file (called KR.m2), open Macaulay2 (in command line or emacs), and type &amp;lt;code&amp;gt;load &amp;quot;KR.m2&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;KRpoly&amp;lt;/code&amp;gt; is probabby the command you want (but it only works for knots at the moment). It outputs &amp;lt;math&amp;gt;\frac{1-t}{qt+1}KR_K(q,s,t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using &amp;lt;code&amp;gt;texMath&amp;lt;/code&amp;gt; puts things in format for LaTeX.  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample session:&lt;br /&gt;
&amp;lt;pre&amp;gt;Macaulay 2, version 0.9&lt;br /&gt;
--Copyright 1993-2001, D. R. Grayson and M. E. Stillman&lt;br /&gt;
--Singular-Factory 1.3b, copyright 1993-2001, G.-M. Greuel, et al.&lt;br /&gt;
--Singular-Libfac 0.3.2, copyright 1996-2001, M. Messollen&lt;br /&gt;
&lt;br /&gt;
i1 : load &amp;quot;KR.m2&amp;quot;&lt;br /&gt;
KR.m2:113:11: warning: local declaration of N shields variable with same name&lt;br /&gt;
--loaded KR.m2&lt;br /&gt;
&lt;br /&gt;
i2 : texMath KRpoly K01&lt;br /&gt;
&lt;br /&gt;
o2 = 1&lt;br /&gt;
&lt;br /&gt;
i3 : texMath KRpoly K31&lt;br /&gt;
&lt;br /&gt;
o3 = s^{2} t^{2}+{q} t^{2}+1&lt;br /&gt;
&lt;br /&gt;
i4 : &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the code for the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--KR.m2&lt;br /&gt;
--This file defines a new object for Macaulay2, called a &amp;quot;Link.&amp;quot;&lt;br /&gt;
--Like all objects in Macaulay2, a Link is just a hash table.&lt;br /&gt;
--Defining a link lets you store information about it for later use.  &lt;br /&gt;
&lt;br /&gt;
Link = new Type of MutableHashTable &lt;br /&gt;
Link.synonym = &amp;quot;link&amp;quot;&lt;br /&gt;
new Link := Link =&amp;gt; (cl) -&amp;gt; (&lt;br /&gt;
     C:=newClass(Link,new MutableHashTable);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--braidClosure is currently the only useful way of defining a link.  &lt;br /&gt;
--I think it should be clear from the examples below how to use it.&lt;br /&gt;
--(Remember to use {}, not () or [])&lt;br /&gt;
braidClosure = L -&amp;gt;(&lt;br /&gt;
     K=new Link;&lt;br /&gt;
     K#braid=L;&lt;br /&gt;
     K)&lt;br /&gt;
&lt;br /&gt;
--This defines all links of 7 or fewer crossings by a braid closure.&lt;br /&gt;
K01=braidClosure {1};&lt;br /&gt;
K31=braidClosure {1,1,1};&lt;br /&gt;
K41=braidClosure {1,-2,1,-2};&lt;br /&gt;
K51=braidClosure {1,1,1,1,1};&lt;br /&gt;
K52=braidClosure {-1,-1,-2,1,-2};&lt;br /&gt;
K61=braidClosure {1,1,2,-1,-3,2,-3};&lt;br /&gt;
K62=braidClosure {-1,-1,-1,2,-1,2};&lt;br /&gt;
K63=braidClosure {-1,-1,2,-1,2,2};&lt;br /&gt;
K71=braidClosure {-1,-1,-1,-1,-1,-1,-1}&lt;br /&gt;
K72=braidClosure {-1,-1,-1,-2,1,-2,-3,2,-3}&lt;br /&gt;
K73=braidClosure {1,1,1,1,1,2,-1,2}&lt;br /&gt;
K74=braidClosure {1,1,2,-1,2,2,3,-2,3}&lt;br /&gt;
K75=braidClosure {-1,-1,-1,-1,-2,1,-2,-2}&lt;br /&gt;
K76=braidClosure {-1,-1,2,-1,-3,2,-3}&lt;br /&gt;
K77=braidClosure {1,-2,1,-2,3,-2,3}&lt;br /&gt;
&lt;br /&gt;
--This outputs a List of complexes, one in each Hochschild degree.&lt;br /&gt;
--The homology of these complexes is actual KR homology.  Mostly this function&lt;br /&gt;
--just feeds into others.&lt;br /&gt;
KR = K -&amp;gt; (&lt;br /&gt;
     if K#?KR then return K#KR else (&lt;br /&gt;
     	  if not K#?braid then error &amp;quot;no braid representation&amp;quot; else (&lt;br /&gt;
     	       Kb=K#braid;&lt;br /&gt;
	       P=K#nbcross=#Kb;&lt;br /&gt;
     	       Ka=apply(Kb,abs);&lt;br /&gt;
     	       Kt=apply(Kb,i-&amp;gt;(i&amp;gt;0));&lt;br /&gt;
     	       Ks=sort Ka;&lt;br /&gt;
     	       --error Ks;&lt;br /&gt;
     	       bind=K#bindex=last(Ks)+1;&lt;br /&gt;
     	       R=QQ[vars(1 .. 2*P+bind)];&lt;br /&gt;
     	       Kmod = chainComplex( gradedModule(R^1));&lt;br /&gt;
     	       Cvars=new MutableList from toList (0..bind);&lt;br /&gt;
      	       --error Cvars#3;&lt;br /&gt;
     	       for I from 0 to P-1 do (&lt;br /&gt;
	  	    Kmod=Kmod**KhMods(Cvars#(Ka_I)-1,Cvars#(Ka_I+1)-1,bind+2*I,R,Kt_I);&lt;br /&gt;
	  	    Cvars#(Ka_I)=bind+2*I+1;&lt;br /&gt;
	  	    Cvars#(Ka_I+1)=bind+2*I+2;&lt;br /&gt;
	  	    );&lt;br /&gt;
               Ml=toList (1..bind);&lt;br /&gt;
     	       M=matrix {apply(Ml, I-&amp;gt; R_(Cvars#I-1)-R_(I-1))};&lt;br /&gt;
     	       K#KR=Torify(Kmod,M);&lt;br /&gt;
	       return K#KR)&lt;br /&gt;
       	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--this function just makes the modules used in the complex above.&lt;br /&gt;
KhMods = (H,I,J,S,W) -&amp;gt; (&lt;br /&gt;
          Mp=S^1/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Np=S^{-1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  Mn=S^{1}/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Nn=S^{1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  if W then C=chainComplex(map(Mp,Np,(S_J-S_I))) else C=chainComplex(map(Nn,Mn))[1];&lt;br /&gt;
	  C)&lt;br /&gt;
&lt;br /&gt;
--these extend Macaulay2&#039;s ability to take tensor products and induced maps.&lt;br /&gt;
ChainComplex ** Matrix := ChainComplexMap =&amp;gt; (C,f) -&amp;gt;(&lt;br /&gt;
     map(C ** target f,C** source f,i -&amp;gt; id_(C_i)**f))&lt;br /&gt;
&lt;br /&gt;
RingMap ** GradedModule := GradedModule =&amp;gt; (f,C) -&amp;gt; (&lt;br /&gt;
     D := new GradedModule;&lt;br /&gt;
     D#ring= target f;&lt;br /&gt;
     scan(spots C, i-&amp;gt;D#i=f**C#i);&lt;br /&gt;
     D) &lt;br /&gt;
&lt;br /&gt;
inducedchainMap = (C,D,f) -&amp;gt; (&lt;br /&gt;
     map(&lt;br /&gt;
	  C,D,i-&amp;gt;inducedMap(C_i,D_i)&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--This has input a chain complex C and output a list of the complexes&lt;br /&gt;
--Tor^i(C,coker M), provided M is a regular sequence.&lt;br /&gt;
Torify = (C,M) -&amp;gt; (&lt;br /&gt;
     J:=rank source M;&lt;br /&gt;
     L:=(0..J);&lt;br /&gt;
     Lt=apply(L,I-&amp;gt;(&lt;br /&gt;
	  F:=koszul(I,M);&lt;br /&gt;
	  G:=koszul(I+1,M);&lt;br /&gt;
	  FB=C**F;&lt;br /&gt;
	  GB=C**G;&lt;br /&gt;
	  CB=source FB;&lt;br /&gt;
     	  --error CB==target GB;&lt;br /&gt;
	  H=inducedchainMap(ker FB,image GB,id_CB);&lt;br /&gt;
	  --error H;&lt;br /&gt;
	  E=coker H;&lt;br /&gt;
	  E));&lt;br /&gt;
     Lt)&lt;br /&gt;
&lt;br /&gt;
--input, a link.  output, KR homology (as modules).  this is less useful than you think, just because of the difficulty of reading the output.&lt;br /&gt;
KRHom = K -&amp;gt; (&lt;br /&gt;
     if K#?KRHom then N:=K#KRHom else (&lt;br /&gt;
     	  L:=KR(K);&lt;br /&gt;
     	  M:=apply(L,homology);&lt;br /&gt;
     	  N:=apply(M,prune);&lt;br /&gt;
	  K#KRHom=N;&lt;br /&gt;
	  );&lt;br /&gt;
     stack(apply(N,net)))&lt;br /&gt;
&lt;br /&gt;
--This sends a chain complex to the list of degrees for which Macaulay2 remembers a module in it.&lt;br /&gt;
spots = C -&amp;gt; select(keys C, i -&amp;gt; class i === ZZ)&lt;br /&gt;
&lt;br /&gt;
degrees(GradedModule) := Function =&amp;gt; C -&amp;gt; (&lt;br /&gt;
     i -&amp;gt; degrees C_i)&lt;br /&gt;
&lt;br /&gt;
--input, a knot K. output ((1-t)/(1+q*t))*(the graded Hilbert &lt;br /&gt;
--polynomial of K).  THIS CURRENTLY ONLY WORKS FOR KNOTS, NOT LINKS.&lt;br /&gt;
KRpoly = K -&amp;gt; (&lt;br /&gt;
     if K#?KRpoly then return K#KRpoly;&lt;br /&gt;
     if not K#?KRHom then KRHom(K);&lt;br /&gt;
     L:=K#KRHom;&lt;br /&gt;
     R:=ring L_0;&lt;br /&gt;
     Rn:=#generators R;&lt;br /&gt;
     S:=QQ[t];&lt;br /&gt;
     f=map(S,R,apply(toList (1..Rn),i-&amp;gt;t));&lt;br /&gt;
     M:=apply(L, C -&amp;gt; f**C);&lt;br /&gt;
     N:=apply(M,degrees);&lt;br /&gt;
     K#KRdeg=N;&lt;br /&gt;
     Pring=QQ[q,s,t,Inverses=&amp;gt;true];&lt;br /&gt;
     spoM:=sort (spots M_0);&lt;br /&gt;
     P:=sum(apply(toList (0..#M-1), i-&amp;gt; (&lt;br /&gt;
		    q^i*sum(apply(spoM, j-&amp;gt; (&lt;br /&gt;
				   s^j*sum(apply(flatten N_i j, k-&amp;gt;t^k))&lt;br /&gt;
				   )&lt;br /&gt;
			 ))&lt;br /&gt;
	       )&lt;br /&gt;
	)); &lt;br /&gt;
     K#KRpoly=P;&lt;br /&gt;
     if not isSubset(ideal(q*t+1),ideal(P)) then error (ideal(q*t+1),ideal(P));&lt;br /&gt;
     P//(q*t+1))&lt;br /&gt;
     &lt;br /&gt;
KRdisp =K -&amp;gt; (&lt;br /&gt;
     if not K#?KRdeg then KRpoly K;&lt;br /&gt;
     N=K#KRdeg;&lt;br /&gt;
     spoM=spots K#KRHom_0;&lt;br /&gt;
     net P || &amp;quot;  &amp;quot; || ( &amp;quot;  &amp;quot; || stack apply(spoM, net)) | &amp;quot;  &amp;quot; | horizontalJoin between(&amp;quot;  &amp;quot;, apply(&lt;br /&gt;
	       toList (0..#M-1),i-&amp;gt; net i || stack(&lt;br /&gt;
		    apply(&lt;br /&gt;
			 spoM,j-&amp;gt;net(flatten(N_i j))&lt;br /&gt;
			 )&lt;br /&gt;
		    )&lt;br /&gt;
	       )&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=48640</id>
		<title>User:Ben/KRhomology</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=48640"/>
		<updated>2005-11-29T05:03:28Z</updated>

		<summary type="html">&lt;p&gt;Ben: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Actual calculations==&lt;br /&gt;
Here is a table of known KR homologies.  We let &amp;lt;math&amp;gt;KR_K(q,s,t)&amp;lt;/math&amp;gt; be the Hilbert series of KR homology.  Note that a factor of the Hilbert series of the unknot appears in all of them.  This will not be true of links, I believe.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, computation seems to bog down very fast.  [[6_1]] has been giving me a lot of trouble, probably because it has braid index 4.  If someone with a faster machine would run it, I would be very appreciative.&lt;br /&gt;
&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[0_1]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\frac{{q} {t}+1}{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[3_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(s^{2} t^{2}+{q} t^{2}+1)&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[4_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(t^{{-1}}+{q} {t}+{q} s^{{-1}}+{q} s^{{-{2}}} t^{{-1}}+q^{2} s^{{-{2}}} {t})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(1+s^{2} t^{2}+s^{4} t^{4}+{q} s^{2} t^{4}+{q} t^{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_2]]   &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)({q}+q^{2} s^{{-{2}}}+t^{{-{2}}}+q^{2} s^{{-{3}}} t^{{-1}}+{q} s^{{-{2}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[6_2]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)({q} {t}+q^{2} s^{{-{2}}} {t}+{q} s^{{-1}}+t^{{-1}}+2 {q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+q^{2} s^{{-{4}}} t^{{-1}}+{q}s^{{-{3}}} t^{{-{2}}}+s^{{-{2}}} t^{{-{3}}}+{q} s^{{-{4}}} t^{{-{3}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  [[6_3]]&lt;br /&gt;
| &amp;lt;math&amp;gt;{\left(\frac{{q} {t}+1}{t-1}\right)(q} {s} t^{2}+q^{2} s^{{-1}} t^{2}+{q} {t}+{s}+q^{2} s^{{-{2}}} {t}+3 {q} s^{{-1}}+t^{{-1}}+q^{2} s^{{-{3}}}+{q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+{q} s^{{-{3}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Theoretical stuff==&lt;br /&gt;
I have some ideas which I hope will be of interest to ya&#039;ll, but I&#039;d like to mull them a bit longer.  Maybe when I get back on Wednesday.&lt;br /&gt;
&lt;br /&gt;
==Macaulay2 program==&lt;br /&gt;
Save this as a file (called KR.m2), open Macaulay2 (in command line or emacs), and type &amp;lt;code&amp;gt;load &amp;quot;KR.m2&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;KRpoly&amp;lt;/code&amp;gt; is probabby the command you want (but it only works for knots at the moment). It outputs &amp;lt;math&amp;gt;\frac{t-1}{qt+1}KR_K(q,s,t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using &amp;lt;code&amp;gt;texMath&amp;lt;/code&amp;gt; puts things in format for LaTeX.  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample session:&lt;br /&gt;
&amp;lt;pre&amp;gt;Macaulay 2, version 0.9&lt;br /&gt;
--Copyright 1993-2001, D. R. Grayson and M. E. Stillman&lt;br /&gt;
--Singular-Factory 1.3b, copyright 1993-2001, G.-M. Greuel, et al.&lt;br /&gt;
--Singular-Libfac 0.3.2, copyright 1996-2001, M. Messollen&lt;br /&gt;
&lt;br /&gt;
i1 : load &amp;quot;KR.m2&amp;quot;&lt;br /&gt;
KR.m2:113:11: warning: local declaration of N shields variable with same name&lt;br /&gt;
--loaded KR.m2&lt;br /&gt;
&lt;br /&gt;
i2 : texMath KRpoly K01&lt;br /&gt;
&lt;br /&gt;
o2 = 1&lt;br /&gt;
&lt;br /&gt;
i3 : texMath KRpoly K31&lt;br /&gt;
&lt;br /&gt;
o3 = s^{2} t^{2}+{q} t^{2}+1&lt;br /&gt;
&lt;br /&gt;
i4 : &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the code for the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--KR.m2&lt;br /&gt;
--This file defines a new object for Macaulay2, called a &amp;quot;Link.&amp;quot;&lt;br /&gt;
--Like all objects in Macaulay2, a Link is just a hash table.&lt;br /&gt;
--Defining a link lets you store information about it for later use.  &lt;br /&gt;
&lt;br /&gt;
Link = new Type of MutableHashTable &lt;br /&gt;
Link.synonym = &amp;quot;link&amp;quot;&lt;br /&gt;
new Link := Link =&amp;gt; (cl) -&amp;gt; (&lt;br /&gt;
     C:=newClass(Link,new MutableHashTable);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--braidClosure is currently the only useful way of defining a link.  &lt;br /&gt;
--I think it should be clear from the examples below how to use it.&lt;br /&gt;
--(Remember to use {}, not () or [])&lt;br /&gt;
braidClosure = L -&amp;gt;(&lt;br /&gt;
     K=new Link;&lt;br /&gt;
     K#braid=L;&lt;br /&gt;
     K)&lt;br /&gt;
&lt;br /&gt;
--This defines all links of 7 or fewer crossings by a braid closure.&lt;br /&gt;
K01=braidClosure {1};&lt;br /&gt;
K31=braidClosure {1,1,1};&lt;br /&gt;
K41=braidClosure {1,-2,1,-2};&lt;br /&gt;
K51=braidClosure {1,1,1,1,1};&lt;br /&gt;
K52=braidClosure {-1,-1,-2,1,-2};&lt;br /&gt;
K61=braidClosure {1,1,2,-1,-3,2,-3};&lt;br /&gt;
K62=braidClosure {-1,-1,-1,2,-1,2};&lt;br /&gt;
K63=braidClosure {-1,-1,2,-1,2,2};&lt;br /&gt;
K71=braidClosure {-1,-1,-1,-1,-1,-1,-1}&lt;br /&gt;
K72=braidClosure {-1,-1,-1,-2,1,-2,-3,2,-3}&lt;br /&gt;
K73=braidClosure {1,1,1,1,1,2,-1,2}&lt;br /&gt;
K74=braidClosure {1,1,2,-1,2,2,3,-2,3}&lt;br /&gt;
K75=braidClosure {-1,-1,-1,-1,-2,1,-2,-2}&lt;br /&gt;
K76=braidClosure {-1,-1,2,-1,-3,2,-3}&lt;br /&gt;
K77=braidClosure {1,-2,1,-2,3,-2,3}&lt;br /&gt;
&lt;br /&gt;
--This outputs a List of complexes, one in each Hochschild degree.&lt;br /&gt;
--The homology of these complexes is actual KR homology.  Mostly this function&lt;br /&gt;
--just feeds into others.&lt;br /&gt;
KR = K -&amp;gt; (&lt;br /&gt;
     if K#?KR then return K#KR else (&lt;br /&gt;
     	  if not K#?braid then error &amp;quot;no braid representation&amp;quot; else (&lt;br /&gt;
     	       Kb=K#braid;&lt;br /&gt;
	       P=K#nbcross=#Kb;&lt;br /&gt;
     	       Ka=apply(Kb,abs);&lt;br /&gt;
     	       Kt=apply(Kb,i-&amp;gt;(i&amp;gt;0));&lt;br /&gt;
     	       Ks=sort Ka;&lt;br /&gt;
     	       --error Ks;&lt;br /&gt;
     	       bind=K#bindex=last(Ks)+1;&lt;br /&gt;
     	       R=QQ[vars(1 .. 2*P+bind)];&lt;br /&gt;
     	       Kmod = chainComplex( gradedModule(R^1));&lt;br /&gt;
     	       Cvars=new MutableList from toList (0..bind);&lt;br /&gt;
      	       --error Cvars#3;&lt;br /&gt;
     	       for I from 0 to P-1 do (&lt;br /&gt;
	  	    Kmod=Kmod**KhMods(Cvars#(Ka_I)-1,Cvars#(Ka_I+1)-1,bind+2*I,R,Kt_I);&lt;br /&gt;
	  	    Cvars#(Ka_I)=bind+2*I+1;&lt;br /&gt;
	  	    Cvars#(Ka_I+1)=bind+2*I+2;&lt;br /&gt;
	  	    );&lt;br /&gt;
               Ml=toList (1..bind);&lt;br /&gt;
     	       M=matrix {apply(Ml, I-&amp;gt; R_(Cvars#I-1)-R_(I-1))};&lt;br /&gt;
     	       K#KR=Torify(Kmod,M);&lt;br /&gt;
	       return K#KR)&lt;br /&gt;
       	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--this function just makes the modules used in the complex above.&lt;br /&gt;
KhMods = (H,I,J,S,W) -&amp;gt; (&lt;br /&gt;
          Mp=S^1/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Np=S^{-1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  Mn=S^{1}/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Nn=S^{1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  if W then C=chainComplex(map(Mp,Np,(S_J-S_I))) else C=chainComplex(map(Nn,Mn))[1];&lt;br /&gt;
	  C)&lt;br /&gt;
&lt;br /&gt;
--these extend Macaulay2&#039;s ability to take tensor products and induced maps.&lt;br /&gt;
ChainComplex ** Matrix := ChainComplexMap =&amp;gt; (C,f) -&amp;gt;(&lt;br /&gt;
     map(C ** target f,C** source f,i -&amp;gt; id_(C_i)**f))&lt;br /&gt;
&lt;br /&gt;
RingMap ** GradedModule := GradedModule =&amp;gt; (f,C) -&amp;gt; (&lt;br /&gt;
     D := new GradedModule;&lt;br /&gt;
     D#ring= target f;&lt;br /&gt;
     scan(spots C, i-&amp;gt;D#i=f**C#i);&lt;br /&gt;
     D) &lt;br /&gt;
&lt;br /&gt;
inducedchainMap = (C,D,f) -&amp;gt; (&lt;br /&gt;
     map(&lt;br /&gt;
	  C,D,i-&amp;gt;inducedMap(C_i,D_i)&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--This has input a chain complex C and output a list of the complexes&lt;br /&gt;
--Tor^i(C,coker M), provided M is a regular sequence.&lt;br /&gt;
Torify = (C,M) -&amp;gt; (&lt;br /&gt;
     J:=rank source M;&lt;br /&gt;
     L:=(0..J);&lt;br /&gt;
     Lt=apply(L,I-&amp;gt;(&lt;br /&gt;
	  F:=koszul(I,M);&lt;br /&gt;
	  G:=koszul(I+1,M);&lt;br /&gt;
	  FB=C**F;&lt;br /&gt;
	  GB=C**G;&lt;br /&gt;
	  CB=source FB;&lt;br /&gt;
     	  --error CB==target GB;&lt;br /&gt;
	  H=inducedchainMap(ker FB,image GB,id_CB);&lt;br /&gt;
	  --error H;&lt;br /&gt;
	  E=coker H;&lt;br /&gt;
	  E));&lt;br /&gt;
     Lt)&lt;br /&gt;
&lt;br /&gt;
--input, a link.  output, KR homology (as modules).  this is less useful than you think, just because of the difficulty of reading the output.&lt;br /&gt;
KRHom = K -&amp;gt; (&lt;br /&gt;
     if K#?KRHom then N:=K#KRHom else (&lt;br /&gt;
     	  L:=KR(K);&lt;br /&gt;
     	  M:=apply(L,homology);&lt;br /&gt;
     	  N:=apply(M,prune);&lt;br /&gt;
	  K#KRHom=N;&lt;br /&gt;
	  );&lt;br /&gt;
     stack(apply(N,net)))&lt;br /&gt;
&lt;br /&gt;
--This sends a chain complex to the list of degrees for which Macaulay2 remembers a module in it.&lt;br /&gt;
spots = C -&amp;gt; select(keys C, i -&amp;gt; class i === ZZ)&lt;br /&gt;
&lt;br /&gt;
degrees(GradedModule) := Function =&amp;gt; C -&amp;gt; (&lt;br /&gt;
     i -&amp;gt; degrees C_i)&lt;br /&gt;
&lt;br /&gt;
--input, a knot K. output ((1-t)/(1+q*t))*(the graded Hilbert &lt;br /&gt;
--polynomial of K).  THIS CURRENTLY ONLY WORKS FOR KNOTS, NOT LINKS.&lt;br /&gt;
KRpoly = K -&amp;gt; (&lt;br /&gt;
     if K#?KRpoly then return K#KRpoly;&lt;br /&gt;
     if not K#?KRHom then KRHom(K);&lt;br /&gt;
     L:=K#KRHom;&lt;br /&gt;
     R:=ring L_0;&lt;br /&gt;
     Rn:=#generators R;&lt;br /&gt;
     S:=QQ[t];&lt;br /&gt;
     f=map(S,R,apply(toList (1..Rn),i-&amp;gt;t));&lt;br /&gt;
     M:=apply(L, C -&amp;gt; f**C);&lt;br /&gt;
     N:=apply(M,degrees);&lt;br /&gt;
     K#KRdeg=N;&lt;br /&gt;
     Pring=QQ[q,s,t,Inverses=&amp;gt;true];&lt;br /&gt;
     spoM:=sort (spots M_0);&lt;br /&gt;
     P:=sum(apply(toList (0..#M-1), i-&amp;gt; (&lt;br /&gt;
		    q^i*sum(apply(spoM, j-&amp;gt; (&lt;br /&gt;
				   s^j*sum(apply(flatten N_i j, k-&amp;gt;t^k))&lt;br /&gt;
				   )&lt;br /&gt;
			 ))&lt;br /&gt;
	       )&lt;br /&gt;
	)); &lt;br /&gt;
     K#KRpoly=P;&lt;br /&gt;
     if not isSubset(ideal(q*t+1),ideal(P)) then error (ideal(q*t+1),ideal(P));&lt;br /&gt;
     P//(q*t+1))&lt;br /&gt;
     &lt;br /&gt;
KRdisp =K -&amp;gt; (&lt;br /&gt;
     if not K#?KRdeg then KRpoly K;&lt;br /&gt;
     N=K#KRdeg;&lt;br /&gt;
     spoM=spots K#KRHom_0;&lt;br /&gt;
     net P || &amp;quot;  &amp;quot; || ( &amp;quot;  &amp;quot; || stack apply(spoM, net)) | &amp;quot;  &amp;quot; | horizontalJoin between(&amp;quot;  &amp;quot;, apply(&lt;br /&gt;
	       toList (0..#M-1),i-&amp;gt; net i || stack(&lt;br /&gt;
		    apply(&lt;br /&gt;
			 spoM,j-&amp;gt;net(flatten(N_i j))&lt;br /&gt;
			 )&lt;br /&gt;
		    )&lt;br /&gt;
	       )&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=48639</id>
		<title>User:Ben/KRhomology</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=48639"/>
		<updated>2005-11-29T05:01:13Z</updated>

		<summary type="html">&lt;p&gt;Ben: /* Actual calculations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So, here is my KR homology stuff.&lt;br /&gt;
&lt;br /&gt;
 ==Actual calculations==&lt;br /&gt;
Here is a table of known KR homologies.  We let &amp;lt;math&amp;gt;KR_K(q,s,t)&amp;lt;/math&amp;gt; be the Hilbert series of KR homology.  Note that a factor of the Hilbert series of the unknot appears in all of them.  This will not be true of links, I believe.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, computation seems to bog down very fast.  [[6_1]] has been giving me a lot of trouble, probably because it has braid index 4.  If someone with a faster machine would run it, I would be very appreciative.&lt;br /&gt;
&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[0_1]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\frac{{q} {t}+1}{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[3_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(s^{2} t^{2}+{q} t^{2}+1)&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[4_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(t^{{-1}}+{q} {t}+{q} s^{{-1}}+{q} s^{{-{2}}} t^{{-1}}+q^{2} s^{{-{2}}} {t})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(1+s^{2} t^{2}+s^{4} t^{4}+{q} s^{2} t^{4}+{q} t^{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_2]]   &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)({q}+q^{2} s^{{-{2}}}+t^{{-{2}}}+q^{2} s^{{-{3}}} t^{{-1}}+{q} s^{{-{2}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[6_2]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)({q} {t}+q^{2} s^{{-{2}}} {t}+{q} s^{{-1}}+t^{{-1}}+2 {q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+q^{2} s^{{-{4}}} t^{{-1}}+{q}s^{{-{3}}} t^{{-{2}}}+s^{{-{2}}} t^{{-{3}}}+{q} s^{{-{4}}} t^{{-{3}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  [[6_3]]&lt;br /&gt;
| &amp;lt;math&amp;gt;{\left(\frac{{q} {t}+1}{t-1}\right)(q} {s} t^{2}+q^{2} s^{{-1}} t^{2}+{q} {t}+{s}+q^{2} s^{{-{2}}} {t}+3 {q} s^{{-1}}+t^{{-1}}+q^{2} s^{{-{3}}}+{q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+{q} s^{{-{3}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Macaulay2 program==&lt;br /&gt;
&lt;br /&gt;
Save this as a file (called KR.m2), open Macaulay2 (in command line or emacs), and type &amp;lt;code&amp;gt;load &amp;quot;KR.m2&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;KRpoly&amp;lt;/code&amp;gt; is probabby the command you want (but it only works for knots at the moment). It outputs &amp;lt;math&amp;gt;\frac{t-1}{qt+1}KR_K(q,s,t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using &amp;lt;code&amp;gt;texMath&amp;lt;/code&amp;gt; puts things in format for LaTeX.  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample session:&lt;br /&gt;
&amp;lt;pre&amp;gt;Macaulay 2, version 0.9&lt;br /&gt;
--Copyright 1993-2001, D. R. Grayson and M. E. Stillman&lt;br /&gt;
--Singular-Factory 1.3b, copyright 1993-2001, G.-M. Greuel, et al.&lt;br /&gt;
--Singular-Libfac 0.3.2, copyright 1996-2001, M. Messollen&lt;br /&gt;
&lt;br /&gt;
i1 : load &amp;quot;KR.m2&amp;quot;&lt;br /&gt;
KR.m2:113:11: warning: local declaration of N shields variable with same name&lt;br /&gt;
--loaded KR.m2&lt;br /&gt;
&lt;br /&gt;
i2 : texMath KRpoly K01&lt;br /&gt;
&lt;br /&gt;
o2 = 1&lt;br /&gt;
&lt;br /&gt;
i3 : texMath KRpoly K31&lt;br /&gt;
&lt;br /&gt;
o3 = s^{2} t^{2}+{q} t^{2}+1&lt;br /&gt;
&lt;br /&gt;
i4 : &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the code for the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--KR.m2&lt;br /&gt;
--This file defines a new object for Macaulay2, called a &amp;quot;Link.&amp;quot;&lt;br /&gt;
--Like all objects in Macaulay2, a Link is just a hash table.&lt;br /&gt;
--Defining a link lets you store information about it for later use.  &lt;br /&gt;
&lt;br /&gt;
Link = new Type of MutableHashTable &lt;br /&gt;
Link.synonym = &amp;quot;link&amp;quot;&lt;br /&gt;
new Link := Link =&amp;gt; (cl) -&amp;gt; (&lt;br /&gt;
     C:=newClass(Link,new MutableHashTable);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--braidClosure is currently the only useful way of defining a link.  &lt;br /&gt;
--I think it should be clear from the examples below how to use it.&lt;br /&gt;
--(Remember to use {}, not () or [])&lt;br /&gt;
braidClosure = L -&amp;gt;(&lt;br /&gt;
     K=new Link;&lt;br /&gt;
     K#braid=L;&lt;br /&gt;
     K)&lt;br /&gt;
&lt;br /&gt;
--This defines all links of 7 or fewer crossings by a braid closure.&lt;br /&gt;
K01=braidClosure {1};&lt;br /&gt;
K31=braidClosure {1,1,1};&lt;br /&gt;
K41=braidClosure {1,-2,1,-2};&lt;br /&gt;
K51=braidClosure {1,1,1,1,1};&lt;br /&gt;
K52=braidClosure {-1,-1,-2,1,-2};&lt;br /&gt;
K61=braidClosure {1,1,2,-1,-3,2,-3};&lt;br /&gt;
K62=braidClosure {-1,-1,-1,2,-1,2};&lt;br /&gt;
K63=braidClosure {-1,-1,2,-1,2,2};&lt;br /&gt;
K71=braidClosure {-1,-1,-1,-1,-1,-1,-1}&lt;br /&gt;
K72=braidClosure {-1,-1,-1,-2,1,-2,-3,2,-3}&lt;br /&gt;
K73=braidClosure {1,1,1,1,1,2,-1,2}&lt;br /&gt;
K74=braidClosure {1,1,2,-1,2,2,3,-2,3}&lt;br /&gt;
K75=braidClosure {-1,-1,-1,-1,-2,1,-2,-2}&lt;br /&gt;
K76=braidClosure {-1,-1,2,-1,-3,2,-3}&lt;br /&gt;
K77=braidClosure {1,-2,1,-2,3,-2,3}&lt;br /&gt;
&lt;br /&gt;
--This outputs a List of complexes, one in each Hochschild degree.&lt;br /&gt;
--The homology of these complexes is actual KR homology.  Mostly this function&lt;br /&gt;
--just feeds into others.&lt;br /&gt;
KR = K -&amp;gt; (&lt;br /&gt;
     if K#?KR then return K#KR else (&lt;br /&gt;
     	  if not K#?braid then error &amp;quot;no braid representation&amp;quot; else (&lt;br /&gt;
     	       Kb=K#braid;&lt;br /&gt;
	       P=K#nbcross=#Kb;&lt;br /&gt;
     	       Ka=apply(Kb,abs);&lt;br /&gt;
     	       Kt=apply(Kb,i-&amp;gt;(i&amp;gt;0));&lt;br /&gt;
     	       Ks=sort Ka;&lt;br /&gt;
     	       --error Ks;&lt;br /&gt;
     	       bind=K#bindex=last(Ks)+1;&lt;br /&gt;
     	       R=QQ[vars(1 .. 2*P+bind)];&lt;br /&gt;
     	       Kmod = chainComplex( gradedModule(R^1));&lt;br /&gt;
     	       Cvars=new MutableList from toList (0..bind);&lt;br /&gt;
      	       --error Cvars#3;&lt;br /&gt;
     	       for I from 0 to P-1 do (&lt;br /&gt;
	  	    Kmod=Kmod**KhMods(Cvars#(Ka_I)-1,Cvars#(Ka_I+1)-1,bind+2*I,R,Kt_I);&lt;br /&gt;
	  	    Cvars#(Ka_I)=bind+2*I+1;&lt;br /&gt;
	  	    Cvars#(Ka_I+1)=bind+2*I+2;&lt;br /&gt;
	  	    );&lt;br /&gt;
               Ml=toList (1..bind);&lt;br /&gt;
     	       M=matrix {apply(Ml, I-&amp;gt; R_(Cvars#I-1)-R_(I-1))};&lt;br /&gt;
     	       K#KR=Torify(Kmod,M);&lt;br /&gt;
	       return K#KR)&lt;br /&gt;
       	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--this function just makes the modules used in the complex above.&lt;br /&gt;
KhMods = (H,I,J,S,W) -&amp;gt; (&lt;br /&gt;
          Mp=S^1/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Np=S^{-1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  Mn=S^{1}/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Nn=S^{1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  if W then C=chainComplex(map(Mp,Np,(S_J-S_I))) else C=chainComplex(map(Nn,Mn))[1];&lt;br /&gt;
	  C)&lt;br /&gt;
&lt;br /&gt;
--these extend Macaulay2&#039;s ability to take tensor products and induced maps.&lt;br /&gt;
ChainComplex ** Matrix := ChainComplexMap =&amp;gt; (C,f) -&amp;gt;(&lt;br /&gt;
     map(C ** target f,C** source f,i -&amp;gt; id_(C_i)**f))&lt;br /&gt;
&lt;br /&gt;
RingMap ** GradedModule := GradedModule =&amp;gt; (f,C) -&amp;gt; (&lt;br /&gt;
     D := new GradedModule;&lt;br /&gt;
     D#ring= target f;&lt;br /&gt;
     scan(spots C, i-&amp;gt;D#i=f**C#i);&lt;br /&gt;
     D) &lt;br /&gt;
&lt;br /&gt;
inducedchainMap = (C,D,f) -&amp;gt; (&lt;br /&gt;
     map(&lt;br /&gt;
	  C,D,i-&amp;gt;inducedMap(C_i,D_i)&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--This has input a chain complex C and output a list of the complexes&lt;br /&gt;
--Tor^i(C,coker M), provided M is a regular sequence.&lt;br /&gt;
Torify = (C,M) -&amp;gt; (&lt;br /&gt;
     J:=rank source M;&lt;br /&gt;
     L:=(0..J);&lt;br /&gt;
     Lt=apply(L,I-&amp;gt;(&lt;br /&gt;
	  F:=koszul(I,M);&lt;br /&gt;
	  G:=koszul(I+1,M);&lt;br /&gt;
	  FB=C**F;&lt;br /&gt;
	  GB=C**G;&lt;br /&gt;
	  CB=source FB;&lt;br /&gt;
     	  --error CB==target GB;&lt;br /&gt;
	  H=inducedchainMap(ker FB,image GB,id_CB);&lt;br /&gt;
	  --error H;&lt;br /&gt;
	  E=coker H;&lt;br /&gt;
	  E));&lt;br /&gt;
     Lt)&lt;br /&gt;
&lt;br /&gt;
--input, a link.  output, KR homology (as modules).  this is less useful than you think, just because of the difficulty of reading the output.&lt;br /&gt;
KRHom = K -&amp;gt; (&lt;br /&gt;
     if K#?KRHom then N:=K#KRHom else (&lt;br /&gt;
     	  L:=KR(K);&lt;br /&gt;
     	  M:=apply(L,homology);&lt;br /&gt;
     	  N:=apply(M,prune);&lt;br /&gt;
	  K#KRHom=N;&lt;br /&gt;
	  );&lt;br /&gt;
     stack(apply(N,net)))&lt;br /&gt;
&lt;br /&gt;
--This sends a chain complex to the list of degrees for which Macaulay2 remembers a module in it.&lt;br /&gt;
spots = C -&amp;gt; select(keys C, i -&amp;gt; class i === ZZ)&lt;br /&gt;
&lt;br /&gt;
degrees(GradedModule) := Function =&amp;gt; C -&amp;gt; (&lt;br /&gt;
     i -&amp;gt; degrees C_i)&lt;br /&gt;
&lt;br /&gt;
--input, a knot K. output ((1-t)/(1+q*t))*(the graded Hilbert &lt;br /&gt;
--polynomial of K).  THIS CURRENTLY ONLY WORKS FOR KNOTS, NOT LINKS.&lt;br /&gt;
KRpoly = K -&amp;gt; (&lt;br /&gt;
     if K#?KRpoly then return K#KRpoly;&lt;br /&gt;
     if not K#?KRHom then KRHom(K);&lt;br /&gt;
     L:=K#KRHom;&lt;br /&gt;
     R:=ring L_0;&lt;br /&gt;
     Rn:=#generators R;&lt;br /&gt;
     S:=QQ[t];&lt;br /&gt;
     f=map(S,R,apply(toList (1..Rn),i-&amp;gt;t));&lt;br /&gt;
     M:=apply(L, C -&amp;gt; f**C);&lt;br /&gt;
     N:=apply(M,degrees);&lt;br /&gt;
     K#KRdeg=N;&lt;br /&gt;
     Pring=QQ[q,s,t,Inverses=&amp;gt;true];&lt;br /&gt;
     spoM:=sort (spots M_0);&lt;br /&gt;
     P:=sum(apply(toList (0..#M-1), i-&amp;gt; (&lt;br /&gt;
		    q^i*sum(apply(spoM, j-&amp;gt; (&lt;br /&gt;
				   s^j*sum(apply(flatten N_i j, k-&amp;gt;t^k))&lt;br /&gt;
				   )&lt;br /&gt;
			 ))&lt;br /&gt;
	       )&lt;br /&gt;
	)); &lt;br /&gt;
     K#KRpoly=P;&lt;br /&gt;
     if not isSubset(ideal(q*t+1),ideal(P)) then error (ideal(q*t+1),ideal(P));&lt;br /&gt;
     P//(q*t+1))&lt;br /&gt;
     &lt;br /&gt;
KRdisp =K -&amp;gt; (&lt;br /&gt;
     if not K#?KRdeg then KRpoly K;&lt;br /&gt;
     N=K#KRdeg;&lt;br /&gt;
     spoM=spots K#KRHom_0;&lt;br /&gt;
     net P || &amp;quot;  &amp;quot; || ( &amp;quot;  &amp;quot; || stack apply(spoM, net)) | &amp;quot;  &amp;quot; | horizontalJoin between(&amp;quot;  &amp;quot;, apply(&lt;br /&gt;
	       toList (0..#M-1),i-&amp;gt; net i || stack(&lt;br /&gt;
		    apply(&lt;br /&gt;
			 spoM,j-&amp;gt;net(flatten(N_i j))&lt;br /&gt;
			 )&lt;br /&gt;
		    )&lt;br /&gt;
	       )&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben&amp;diff=49237</id>
		<title>User:Ben</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben&amp;diff=49237"/>
		<updated>2005-11-29T04:56:59Z</updated>

		<summary type="html">&lt;p&gt;Ben: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://math.berkeley.edu/~bwebste My homepage]&lt;br /&gt;
&lt;br /&gt;
[[User:Ben/KRhomology|My adventures]] in KR homology.&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=Template:HelpAndAbout&amp;diff=110530</id>
		<title>Template:HelpAndAbout</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=Template:HelpAndAbout&amp;diff=110530"/>
		<updated>2005-11-29T04:42:15Z</updated>

		<summary type="html">&lt;p&gt;Ben: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=70% border=1 align=center&lt;br /&gt;
|- valign=top align=center&lt;br /&gt;
|&lt;br /&gt;
{|&lt;br /&gt;
|- align=left valign=top&lt;br /&gt;
|width=70px|&amp;lt;pre style=&amp;quot;color: blue; border: 0px; padding: 0em&amp;quot;&amp;gt;In[{{{n}}}]:=&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre style=&amp;quot;color: red; border: 0px; padding: 0em&amp;quot;&amp;gt;?{{{in}}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
|- align=left valign=top&lt;br /&gt;
|colspan=2|{{{out}}}&lt;br /&gt;
|}&lt;br /&gt;
|&lt;br /&gt;
{|&lt;br /&gt;
|- align=left valign=top&lt;br /&gt;
|width=70px|&amp;lt;pre style=&amp;quot;color: blue; border: 0px; padding: 0em&amp;quot;&amp;gt;In[{{{n1}}}]:=&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre style=&amp;quot;color: red; border: 0px; padding: 0em&amp;quot;&amp;gt;{{{in}}}::about&amp;lt;/pre&amp;gt;&lt;br /&gt;
|- align=left valign=top&lt;br /&gt;
|colspan=2|{{{about}}}&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=48635</id>
		<title>User:Ben/KRhomology</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=48635"/>
		<updated>2005-11-28T20:46:02Z</updated>

		<summary type="html">&lt;p&gt;Ben: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So, here is my KR homology stuff.&lt;br /&gt;
&lt;br /&gt;
==Actual calculations==&lt;br /&gt;
Here is a table of known KR homologies.  We let &amp;lt;math&amp;gt;KR_K(q,s,t)&amp;lt;/math&amp;gt; be the Hilbert series of KR homology.  Note that a factor of the Hilbert series of the unknot appears in all of them.  This will not be true of links, I believe.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, computation seems to bog down very fast.  [[6_1]] has been giving me a lot of trouble.  If someone with a faster machine would run it, I would be very appreciative.&lt;br /&gt;
&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[0_1]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\frac{{q} {t}+1}{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[3_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(s^{2} t^{2}+{q} t^{2}+1)&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[4_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(t^{{-1}}+{q} {t}+{q} s^{{-1}}+{q} s^{{-{2}}} t^{{-1}}+q^{2} s^{{-{2}}} {t})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(1+s^{2} t^{2}+s^{4} t^{4}+{q} s^{2} t^{4}+{q} t^{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_2]]   &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)({q}+q^{2} s^{{-{2}}}+t^{{-{2}}}+q^{2} s^{{-{3}}} t^{{-1}}+{q} s^{{-{2}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[6_2]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)({q} {t}+q^{2} s^{{-{2}}} {t}+{q} s^{{-1}}+t^{{-1}}+2 {q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+q^{2} s^{{-{4}}} t^{{-1}}+{q}s^{{-{3}}} t^{{-{2}}}+s^{{-{2}}} t^{{-{3}}}+{q} s^{{-{4}}} t^{{-{3}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Macaulay2 program==&lt;br /&gt;
&lt;br /&gt;
Save this as a file (called KR.m2), open Macaulay2 (in command line or emacs), and type &amp;lt;code&amp;gt;load &amp;quot;KR.m2&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;KRpoly&amp;lt;/code&amp;gt; is probabby the command you want (but it only works for knots at the moment). It outputs &amp;lt;math&amp;gt;\frac{t-1}{qt+1}KR_K(q,s,t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using &amp;lt;code&amp;gt;texMath&amp;lt;/code&amp;gt; puts things in format for LaTeX.  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample session:&lt;br /&gt;
&amp;lt;pre&amp;gt;Macaulay 2, version 0.9&lt;br /&gt;
--Copyright 1993-2001, D. R. Grayson and M. E. Stillman&lt;br /&gt;
--Singular-Factory 1.3b, copyright 1993-2001, G.-M. Greuel, et al.&lt;br /&gt;
--Singular-Libfac 0.3.2, copyright 1996-2001, M. Messollen&lt;br /&gt;
&lt;br /&gt;
i1 : load &amp;quot;KR.m2&amp;quot;&lt;br /&gt;
KR.m2:113:11: warning: local declaration of N shields variable with same name&lt;br /&gt;
--loaded KR.m2&lt;br /&gt;
&lt;br /&gt;
i2 : texMath KRpoly K01&lt;br /&gt;
&lt;br /&gt;
o2 = 1&lt;br /&gt;
&lt;br /&gt;
i3 : texMath KRpoly K31&lt;br /&gt;
&lt;br /&gt;
o3 = s^{2} t^{2}+{q} t^{2}+1&lt;br /&gt;
&lt;br /&gt;
i4 : &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the code for the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--KR.m2&lt;br /&gt;
--This file defines a new object for Macaulay2, called a &amp;quot;Link.&amp;quot;&lt;br /&gt;
--Like all objects in Macaulay2, a Link is just a hash table.&lt;br /&gt;
--Defining a link lets you store information about it for later use.  &lt;br /&gt;
&lt;br /&gt;
Link = new Type of MutableHashTable &lt;br /&gt;
Link.synonym = &amp;quot;link&amp;quot;&lt;br /&gt;
new Link := Link =&amp;gt; (cl) -&amp;gt; (&lt;br /&gt;
     C:=newClass(Link,new MutableHashTable);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--braidClosure is currently the only useful way of defining a link.  &lt;br /&gt;
--I think it should be clear from the examples below how to use it.&lt;br /&gt;
--(Remember to use {}, not () or [])&lt;br /&gt;
braidClosure = L -&amp;gt;(&lt;br /&gt;
     K=new Link;&lt;br /&gt;
     K#braid=L;&lt;br /&gt;
     K)&lt;br /&gt;
&lt;br /&gt;
--This defines all links of 7 or fewer crossings by a braid closure.&lt;br /&gt;
K01=braidClosure {1};&lt;br /&gt;
K31=braidClosure {1,1,1};&lt;br /&gt;
K41=braidClosure {1,-2,1,-2};&lt;br /&gt;
K51=braidClosure {1,1,1,1,1};&lt;br /&gt;
K52=braidClosure {-1,-1,-2,1,-2};&lt;br /&gt;
K61=braidClosure {1,1,2,-1,-3,2,-3};&lt;br /&gt;
K62=braidClosure {-1,-1,-1,2,-1,2};&lt;br /&gt;
K63=braidClosure {-1,-1,2,-1,2,2};&lt;br /&gt;
K71=braidClosure {-1,-1,-1,-1,-1,-1,-1}&lt;br /&gt;
K72=braidClosure {-1,-1,-1,-2,1,-2,-3,2,-3}&lt;br /&gt;
K73=braidClosure {1,1,1,1,1,2,-1,2}&lt;br /&gt;
K74=braidClosure {1,1,2,-1,2,2,3,-2,3}&lt;br /&gt;
K75=braidClosure {-1,-1,-1,-1,-2,1,-2,-2}&lt;br /&gt;
K76=braidClosure {-1,-1,2,-1,-3,2,-3}&lt;br /&gt;
K77=braidClosure {1,-2,1,-2,3,-2,3}&lt;br /&gt;
&lt;br /&gt;
--This outputs a List of complexes, one in each Hochschild degree.&lt;br /&gt;
--The homology of these complexes is actual KR homology.  Mostly this function&lt;br /&gt;
--just feeds into others.&lt;br /&gt;
KR = K -&amp;gt; (&lt;br /&gt;
     if K#?KR then return K#KR else (&lt;br /&gt;
     	  if not K#?braid then error &amp;quot;no braid representation&amp;quot; else (&lt;br /&gt;
     	       Kb=K#braid;&lt;br /&gt;
	       P=K#nbcross=#Kb;&lt;br /&gt;
     	       Ka=apply(Kb,abs);&lt;br /&gt;
     	       Kt=apply(Kb,i-&amp;gt;(i&amp;gt;0));&lt;br /&gt;
     	       Ks=sort Ka;&lt;br /&gt;
     	       --error Ks;&lt;br /&gt;
     	       bind=K#bindex=last(Ks)+1;&lt;br /&gt;
     	       R=QQ[vars(1 .. 2*P+bind)];&lt;br /&gt;
     	       Kmod = chainComplex( gradedModule(R^1));&lt;br /&gt;
     	       Cvars=new MutableList from toList (0..bind);&lt;br /&gt;
      	       --error Cvars#3;&lt;br /&gt;
     	       for I from 0 to P-1 do (&lt;br /&gt;
	  	    Kmod=Kmod**KhMods(Cvars#(Ka_I)-1,Cvars#(Ka_I+1)-1,bind+2*I,R,Kt_I);&lt;br /&gt;
	  	    Cvars#(Ka_I)=bind+2*I+1;&lt;br /&gt;
	  	    Cvars#(Ka_I+1)=bind+2*I+2;&lt;br /&gt;
	  	    );&lt;br /&gt;
               Ml=toList (1..bind);&lt;br /&gt;
     	       M=matrix {apply(Ml, I-&amp;gt; R_(Cvars#I-1)-R_(I-1))};&lt;br /&gt;
     	       K#KR=Torify(Kmod,M);&lt;br /&gt;
	       return K#KR)&lt;br /&gt;
       	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--this function just makes the modules used in the complex above.&lt;br /&gt;
KhMods = (H,I,J,S,W) -&amp;gt; (&lt;br /&gt;
          Mp=S^1/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Np=S^{-1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  Mn=S^{1}/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Nn=S^{1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  if W then C=chainComplex(map(Mp,Np,(S_J-S_I))) else C=chainComplex(map(Nn,Mn))[1];&lt;br /&gt;
	  C)&lt;br /&gt;
&lt;br /&gt;
--these extend Macaulay2&#039;s ability to take tensor products and induced maps.&lt;br /&gt;
ChainComplex ** Matrix := ChainComplexMap =&amp;gt; (C,f) -&amp;gt;(&lt;br /&gt;
     map(C ** target f,C** source f,i -&amp;gt; id_(C_i)**f))&lt;br /&gt;
&lt;br /&gt;
RingMap ** GradedModule := GradedModule =&amp;gt; (f,C) -&amp;gt; (&lt;br /&gt;
     D := new GradedModule;&lt;br /&gt;
     D#ring= target f;&lt;br /&gt;
     scan(spots C, i-&amp;gt;D#i=f**C#i);&lt;br /&gt;
     D) &lt;br /&gt;
&lt;br /&gt;
inducedchainMap = (C,D,f) -&amp;gt; (&lt;br /&gt;
     map(&lt;br /&gt;
	  C,D,i-&amp;gt;inducedMap(C_i,D_i)&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--This has input a chain complex C and output a list of the complexes&lt;br /&gt;
--Tor^i(C,coker M), provided M is a regular sequence.&lt;br /&gt;
Torify = (C,M) -&amp;gt; (&lt;br /&gt;
     J:=rank source M;&lt;br /&gt;
     L:=(0..J);&lt;br /&gt;
     Lt=apply(L,I-&amp;gt;(&lt;br /&gt;
	  F:=koszul(I,M);&lt;br /&gt;
	  G:=koszul(I+1,M);&lt;br /&gt;
	  FB=C**F;&lt;br /&gt;
	  GB=C**G;&lt;br /&gt;
	  CB=source FB;&lt;br /&gt;
     	  --error CB==target GB;&lt;br /&gt;
	  H=inducedchainMap(ker FB,image GB,id_CB);&lt;br /&gt;
	  --error H;&lt;br /&gt;
	  E=coker H;&lt;br /&gt;
	  E));&lt;br /&gt;
     Lt)&lt;br /&gt;
&lt;br /&gt;
--input, a link.  output, KR homology (as modules).  this is less useful than you think, just because of the difficulty of reading the output.&lt;br /&gt;
KRHom = K -&amp;gt; (&lt;br /&gt;
     if K#?KRHom then N:=K#KRHom else (&lt;br /&gt;
     	  L:=KR(K);&lt;br /&gt;
     	  M:=apply(L,homology);&lt;br /&gt;
     	  N:=apply(M,prune);&lt;br /&gt;
	  K#KRHom=N;&lt;br /&gt;
	  );&lt;br /&gt;
     stack(apply(N,net)))&lt;br /&gt;
&lt;br /&gt;
--This sends a chain complex to the list of degrees for which Macaulay2 remembers a module in it.&lt;br /&gt;
spots = C -&amp;gt; select(keys C, i -&amp;gt; class i === ZZ)&lt;br /&gt;
&lt;br /&gt;
degrees(GradedModule) := Function =&amp;gt; C -&amp;gt; (&lt;br /&gt;
     i -&amp;gt; degrees C_i)&lt;br /&gt;
&lt;br /&gt;
--input, a knot K. output ((1-t)/(1+q*t))*(the graded Hilbert &lt;br /&gt;
--polynomial of K).  THIS CURRENTLY ONLY WORKS FOR KNOTS, NOT LINKS.&lt;br /&gt;
KRpoly = K -&amp;gt; (&lt;br /&gt;
     if K#?KRpoly then return K#KRpoly;&lt;br /&gt;
     if not K#?KRHom then KRHom(K);&lt;br /&gt;
     L:=K#KRHom;&lt;br /&gt;
     R:=ring L_0;&lt;br /&gt;
     Rn:=#generators R;&lt;br /&gt;
     S:=QQ[t];&lt;br /&gt;
     f=map(S,R,apply(toList (1..Rn),i-&amp;gt;t));&lt;br /&gt;
     M:=apply(L, C -&amp;gt; f**C);&lt;br /&gt;
     N:=apply(M,degrees);&lt;br /&gt;
     K#KRdeg=N;&lt;br /&gt;
     Pring=QQ[q,s,t,Inverses=&amp;gt;true];&lt;br /&gt;
     spoM:=sort (spots M_0);&lt;br /&gt;
     P:=sum(apply(toList (0..#M-1), i-&amp;gt; (&lt;br /&gt;
		    q^i*sum(apply(spoM, j-&amp;gt; (&lt;br /&gt;
				   s^j*sum(apply(flatten N_i j, k-&amp;gt;t^k))&lt;br /&gt;
				   )&lt;br /&gt;
			 ))&lt;br /&gt;
	       )&lt;br /&gt;
	)); &lt;br /&gt;
     K#KRpoly=P;&lt;br /&gt;
     if not isSubset(ideal(P),ideal(q*t+1)) then error (ideal(q*t+1),ideal(P));&lt;br /&gt;
     P//(q*t+1))&lt;br /&gt;
     &lt;br /&gt;
KRdisp =K -&amp;gt; (&lt;br /&gt;
     if not K#?KRdeg then KRpoly K;&lt;br /&gt;
     N=K#KRdeg;&lt;br /&gt;
     spoM=spots K#KRHom_0;&lt;br /&gt;
     net P || &amp;quot;  &amp;quot; || ( &amp;quot;  &amp;quot; || stack apply(spoM, net)) | &amp;quot;  &amp;quot; | horizontalJoin between(&amp;quot;  &amp;quot;, apply(&lt;br /&gt;
	       toList (0..#M-1),i-&amp;gt; net i || stack(&lt;br /&gt;
		    apply(&lt;br /&gt;
			 spoM,j-&amp;gt;net(flatten(N_i j))&lt;br /&gt;
			 )&lt;br /&gt;
		    )&lt;br /&gt;
	       )&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=48632</id>
		<title>User:Ben/KRhomology</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben/KRhomology&amp;diff=48632"/>
		<updated>2005-11-28T20:43:44Z</updated>

		<summary type="html">&lt;p&gt;Ben: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So, here is my KR homology stuff.&lt;br /&gt;
&lt;br /&gt;
==Actual calculations==&lt;br /&gt;
Here is a table of known KR homologies.  We let &amp;lt;math&amp;gt;KR_K(q,s,t)&amp;lt;/math&amp;gt; be the Hilbert series of KR homology.  Note that a factor of the Hilbert series of the unknot appears in all of them.  This will not be true of links, I believe.&lt;br /&gt;
&lt;br /&gt;
{|align=center border=1&lt;br /&gt;
|- &lt;br /&gt;
| [[0_1]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\frac{{q} {t}+1}{t-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[3_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(s^{2} t^{2}+{q} t^{2}+1)&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| [[4_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(t^{{-1}}+{q} {t}+{q} s^{{-1}}+{q} s^{{-{2}}} t^{{-1}}+q^{2} s^{{-{2}}} {t})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_1]]  &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)(1+s^{2} t^{2}+s^{4} t^{4}+{q} s^{2} t^{4}+{q} t^{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[5_2]]   &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)({q}+q^{2} s^{{-{2}}}+t^{{-{2}}}+q^{2} s^{{-{3}}} t^{{-1}}+{q} s^{{-{2}}} t^{{-{2}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
|  [[6_2]] &lt;br /&gt;
| &amp;lt;math&amp;gt;\left(\frac{{q} {t}+1}{t-1}\right)({q} {t}+q^{2} s^{{-{2}}} {t}+{q} s^{{-1}}+t^{{-1}}+2 {q} s^{{-{2}}} t^{{-1}}+s^{{-1}} t^{{-{2}}}+q^{2} s^{{-{4}}} t^{{-1}}+{q}s^{{-{3}}} t^{{-{2}}}+s^{{-{2}}} t^{{-{3}}}+{q} s^{{-{4}}} t^{{-{3}}})&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Macaulay2 program==&lt;br /&gt;
&lt;br /&gt;
Save this as a file (called KR.m2), open Macaulay2 (in command line or emacs), and type &amp;lt;code&amp;gt;load &amp;quot;KR.m2&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;KRpoly&amp;lt;/code&amp;gt; is probabby the command you want (but it only works for knots at the moment). It outputs &amp;lt;math&amp;gt;\frac{t-1}{qt+1}KR_K(q,s,t)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using &amp;lt;code&amp;gt;texMath&amp;lt;/code&amp;gt; puts things in format for LaTeX.  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Here&#039;s a sample session:&lt;br /&gt;
&amp;lt;pre&amp;gt;Macaulay 2, version 0.9&lt;br /&gt;
--Copyright 1993-2001, D. R. Grayson and M. E. Stillman&lt;br /&gt;
--Singular-Factory 1.3b, copyright 1993-2001, G.-M. Greuel, et al.&lt;br /&gt;
--Singular-Libfac 0.3.2, copyright 1996-2001, M. Messollen&lt;br /&gt;
&lt;br /&gt;
i1 : load &amp;quot;KR.m2&amp;quot;&lt;br /&gt;
KR.m2:113:11: warning: local declaration of N shields variable with same name&lt;br /&gt;
--loaded KR.m2&lt;br /&gt;
&lt;br /&gt;
i2 : texMath KRpoly K01&lt;br /&gt;
&lt;br /&gt;
o2 = 1&lt;br /&gt;
&lt;br /&gt;
i3 : texMath KRpoly K31&lt;br /&gt;
&lt;br /&gt;
o3 = s^{2} t^{2}+{q} t^{2}+1&lt;br /&gt;
&lt;br /&gt;
i4 : &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the code for the program.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--KR.m2&lt;br /&gt;
--This file defines a new object for Macaulay2, called a &amp;quot;Link.&amp;quot;&lt;br /&gt;
--Like all objects in Macaulay2, a Link is just a hash table.&lt;br /&gt;
--Defining a link lets you store information about it for later use.  &lt;br /&gt;
&lt;br /&gt;
Link = new Type of MutableHashTable &lt;br /&gt;
Link.synonym = &amp;quot;link&amp;quot;&lt;br /&gt;
new Link := Link =&amp;gt; (cl) -&amp;gt; (&lt;br /&gt;
     C:=newClass(Link,new MutableHashTable);&lt;br /&gt;
     C)&lt;br /&gt;
&lt;br /&gt;
--braidClosure is currently the only useful way of defining a link.  &lt;br /&gt;
--I think it should be clear from the examples below how to use it.&lt;br /&gt;
--(Remember to use {}, not () or [])&lt;br /&gt;
braidClosure = L -&amp;gt;(&lt;br /&gt;
     K=new Link;&lt;br /&gt;
     K#braid=L;&lt;br /&gt;
     K)&lt;br /&gt;
&lt;br /&gt;
--This defines all links of 7 or fewer crossings by a braid closure.&lt;br /&gt;
K01=braidClosure {1};&lt;br /&gt;
K31=braidClosure {1,1,1};&lt;br /&gt;
K41=braidClosure {1,-2,1,-2};&lt;br /&gt;
K51=braidClosure {1,1,1,1,1};&lt;br /&gt;
K52=braidClosure {-1,-1,-2,1,-2};&lt;br /&gt;
K61=braidClosure {1,1,2,-1,-3,2,-3};&lt;br /&gt;
K62=braidClosure {-1,-1,-1,2,-1,2};&lt;br /&gt;
K63=braidClosure {-1,-1,2,-1,2,2};&lt;br /&gt;
K71=braidClosure {-1,-1,-1,-1,-1,-1,-1}&lt;br /&gt;
K72=braidClosure {-1,-1,-1,-2,1,-2,-3,2,-3}&lt;br /&gt;
K73=braidClosure {1,1,1,1,1,2,-1,2}&lt;br /&gt;
K74=braidClosure {1,1,2,-1,2,2,3,-2,3}&lt;br /&gt;
K75=braidClosure {-1,-1,-1,-1,-2,1,-2,-2}&lt;br /&gt;
K76=braidClosure {-1,-1,2,-1,-3,2,-3}&lt;br /&gt;
K77=braidClosure {1,-2,1,-2,3,-2,3}&lt;br /&gt;
&lt;br /&gt;
--This outputs a List of complexes, one in each Hochschild degree.&lt;br /&gt;
--The homology of these complexes is actual KR homology.  Mostly this function&lt;br /&gt;
--just feeds into others.&lt;br /&gt;
KR = K -&amp;gt; (&lt;br /&gt;
     if K#?KR then return K#KR else (&lt;br /&gt;
     	  if not K#?braid then error &amp;quot;no braid representation&amp;quot; else (&lt;br /&gt;
     	       Kb=K#braid;&lt;br /&gt;
	       P=K#nbcross=#Kb;&lt;br /&gt;
     	       Ka=apply(Kb,abs);&lt;br /&gt;
     	       Kt=apply(Kb,i-&amp;gt;(i&amp;gt;0));&lt;br /&gt;
     	       Ks=sort Ka;&lt;br /&gt;
     	       --error Ks;&lt;br /&gt;
     	       bind=K#bindex=last(Ks)+1;&lt;br /&gt;
     	       R=QQ[vars(1 .. 2*P+bind)];&lt;br /&gt;
     	       Kmod = chainComplex( gradedModule(R^1));&lt;br /&gt;
     	       Cvars=new MutableList from toList (0..bind);&lt;br /&gt;
      	       --error Cvars#3;&lt;br /&gt;
     	       for I from 0 to P-1 do (&lt;br /&gt;
	  	    Kmod=Kmod**KhMods(Cvars#(Ka_I)-1,Cvars#(Ka_I+1)-1,bind+2*I,R,Kt_I);&lt;br /&gt;
	  	    Cvars#(Ka_I)=bind+2*I+1;&lt;br /&gt;
	  	    Cvars#(Ka_I+1)=bind+2*I+2;&lt;br /&gt;
	  	    );&lt;br /&gt;
               Ml=toList (1..bind);&lt;br /&gt;
     	       M=matrix {apply(Ml, I-&amp;gt; R_(Cvars#I-1)-R_(I-1))};&lt;br /&gt;
     	       K#KR=Torify(Kmod,M);&lt;br /&gt;
	       return K#KR)&lt;br /&gt;
       	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--this function just makes the modules used in the complex above.&lt;br /&gt;
KhMods = (H,I,J,S,W) -&amp;gt; (&lt;br /&gt;
          Mp=S^1/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Np=S^{-1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  Mn=S^{1}/ideal(S_H+S_I-S_J-S_(J+1),S_H*S_I-S_J*S_(J+1));&lt;br /&gt;
	  Nn=S^{1}/ideal(S_H-S_J,S_I-S_(J+1));&lt;br /&gt;
	  if W then C=chainComplex(map(Mp,Np,(S_J-S_I))) else C=chainComplex(map(Nn,Mn))[1];&lt;br /&gt;
	  C)&lt;br /&gt;
&lt;br /&gt;
--these extend Macaulay2&#039;s ability to take tensor products and induced maps.&lt;br /&gt;
ChainComplex ** Matrix := ChainComplexMap =&amp;gt; (C,f) -&amp;gt;(&lt;br /&gt;
     map(C ** target f,C** source f,i -&amp;gt; id_(C_i)**f))&lt;br /&gt;
&lt;br /&gt;
RingMap ** GradedModule := GradedModule =&amp;gt; (f,C) -&amp;gt; (&lt;br /&gt;
     D := new GradedModule;&lt;br /&gt;
     D#ring= target f;&lt;br /&gt;
     scan(spots C, i-&amp;gt;D#i=f**C#i);&lt;br /&gt;
     D) &lt;br /&gt;
&lt;br /&gt;
inducedchainMap = (C,D,f) -&amp;gt; (&lt;br /&gt;
     map(&lt;br /&gt;
	  C,D,i-&amp;gt;inducedMap(C_i,D_i)&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&lt;br /&gt;
--This has input a chain complex C and output a list of the complexes&lt;br /&gt;
--Tor^i(C,coker M), provided M is a regular sequence.&lt;br /&gt;
Torify = (C,M) -&amp;gt; (&lt;br /&gt;
     J:=rank source M;&lt;br /&gt;
     L:=(0..J);&lt;br /&gt;
     Lt=apply(L,I-&amp;gt;(&lt;br /&gt;
	  F:=koszul(I,M);&lt;br /&gt;
	  G:=koszul(I+1,M);&lt;br /&gt;
	  FB=C**F;&lt;br /&gt;
	  GB=C**G;&lt;br /&gt;
	  CB=source FB;&lt;br /&gt;
     	  --error CB==target GB;&lt;br /&gt;
	  H=inducedchainMap(ker FB,image GB,id_CB);&lt;br /&gt;
	  --error H;&lt;br /&gt;
	  E=coker H;&lt;br /&gt;
	  E));&lt;br /&gt;
     Lt)&lt;br /&gt;
&lt;br /&gt;
--input, a link.  output, KR homology (as modules).  this is less useful than you think, just because of the difficulty of reading the output.&lt;br /&gt;
KRHom = K -&amp;gt; (&lt;br /&gt;
     if K#?KRHom then N:=K#KRHom else (&lt;br /&gt;
     	  L:=KR(K);&lt;br /&gt;
     	  M:=apply(L,homology);&lt;br /&gt;
     	  N:=apply(M,prune);&lt;br /&gt;
	  K#KRHom=N;&lt;br /&gt;
	  );&lt;br /&gt;
     stack(apply(N,net)))&lt;br /&gt;
&lt;br /&gt;
--This sends a chain complex to the list of degrees for which Macaulay2 remembers a module in it.&lt;br /&gt;
spots = C -&amp;gt; select(keys C, i -&amp;gt; class i === ZZ)&lt;br /&gt;
&lt;br /&gt;
degrees(GradedModule) := Function =&amp;gt; C -&amp;gt; (&lt;br /&gt;
     i -&amp;gt; degrees C_i)&lt;br /&gt;
&lt;br /&gt;
--input, a knot K. output ((1-t)/(1+q*t))*(the graded Hilbert &lt;br /&gt;
--polynomial of K).  THIS CURRENTLY ONLY WORKS FOR KNOTS, NOT LINKS.&lt;br /&gt;
KRpoly = K -&amp;gt; (&lt;br /&gt;
     if K#?KRpoly then return K#KRpoly;&lt;br /&gt;
     if not K#?KRHom then KRHom(K);&lt;br /&gt;
     L:=K#KRHom;&lt;br /&gt;
     R:=ring L_0;&lt;br /&gt;
     Rn:=#generators R;&lt;br /&gt;
     S:=QQ[t];&lt;br /&gt;
     f=map(S,R,apply(toList (1..Rn),i-&amp;gt;t));&lt;br /&gt;
     M:=apply(L, C -&amp;gt; f**C);&lt;br /&gt;
     N:=apply(M,degrees);&lt;br /&gt;
     K#KRdeg=N;&lt;br /&gt;
     Pring=QQ[q,s,t,Inverses=&amp;gt;true];&lt;br /&gt;
     spoM:=sort (spots M_0);&lt;br /&gt;
     P:=sum(apply(toList (0..#M-1), i-&amp;gt; (&lt;br /&gt;
		    q^i*sum(apply(spoM, j-&amp;gt; (&lt;br /&gt;
				   s^j*sum(apply(flatten N_i j, k-&amp;gt;t^k))&lt;br /&gt;
				   )&lt;br /&gt;
			 ))&lt;br /&gt;
	       )&lt;br /&gt;
	)); &lt;br /&gt;
     K#KRpoly=P;&lt;br /&gt;
     if not isSubset(ideal(P),ideal(q*t+1)) then error (ideal(q*t+1),ideal(P));&lt;br /&gt;
     P//(q*t+1))&lt;br /&gt;
     &lt;br /&gt;
KRdisp =K -&amp;gt; (&lt;br /&gt;
     if not K#?KRdeg then KRpoly K;&lt;br /&gt;
     N=K#KRdeg;&lt;br /&gt;
     spoM=spots K#KRHom_0;&lt;br /&gt;
     net P || &amp;quot;  &amp;quot; || ( &amp;quot;  &amp;quot; || stack apply(spoM, net)) | &amp;quot;  &amp;quot; | horizontalJoin between(&amp;quot;  &amp;quot;, apply(&lt;br /&gt;
	       toList (0..#M-1),i-&amp;gt; net i || stack(&lt;br /&gt;
		    apply(&lt;br /&gt;
			 spoM,j-&amp;gt;net(flatten(N_i j))&lt;br /&gt;
			 )&lt;br /&gt;
		    )&lt;br /&gt;
	       )&lt;br /&gt;
	  )&lt;br /&gt;
     )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben&amp;diff=48637</id>
		<title>User:Ben</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben&amp;diff=48637"/>
		<updated>2005-11-28T20:09:28Z</updated>

		<summary type="html">&lt;p&gt;Ben: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://math.berkeley.edu/~bwebste My homepage]&lt;br /&gt;
&lt;br /&gt;
[[User:Ben/KRhomology]]&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=User:Ben&amp;diff=48631</id>
		<title>User:Ben</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=User:Ben&amp;diff=48631"/>
		<updated>2005-11-28T20:04:51Z</updated>

		<summary type="html">&lt;p&gt;Ben: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://math.berkeley.edu/~bwebste My homepage]&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
	<entry>
		<id>https://katlas.org/index.php?title=To_Do&amp;diff=48623</id>
		<title>To Do</title>
		<link rel="alternate" type="text/html" href="https://katlas.org/index.php?title=To_Do&amp;diff=48623"/>
		<updated>2005-11-21T22:47:01Z</updated>

		<summary type="html">&lt;p&gt;Ben: /* Knot Atlas issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Update this To Do list.&lt;br /&gt;
&lt;br /&gt;
* Set up a backup routine.&lt;br /&gt;
** Make sure we&#039;re backing up all the right things. In particular, httpd.conf should probably be backed up.&lt;br /&gt;
* Systematic updates of the executable programs (KnotTheory`, WikiLink.m, splicers). See [[:Category:Software]].&lt;br /&gt;
&lt;br /&gt;
== Knot Atlas issues ==&lt;br /&gt;
* Link to us from relevant pages on wikipedia and elsewhere.&lt;br /&gt;
* Add &amp;quot;comment&amp;quot; hooks near each of the sections on the knot pages.&lt;br /&gt;
** Eliminate the need for &amp;quot;&amp;amp;action=purge&amp;quot; after editing a comments section.&lt;br /&gt;
* Learn some MySQL and figure how to do &amp;quot;bulk additions from a file&amp;quot; to the database. This is a &#039;Dror and Scott only&#039; technique, because it requires direct database access, and in most cases we&#039;d be better off thinking in terms of uploading via WikiLink; either command line java, or a mathematica notebook. But direct SQL may be the only way to go for loading data for, say, all 16 crossing knots.&lt;br /&gt;
* The right floating tables of contents in the manual don&#039;t layout properly in safari. I don&#039;t have access to safari, so can&#039;t do any testing. --[[User:Scott|Scott]] 05:08, 25 Sep 2005 (EDT)&lt;br /&gt;
**You seem to forget that both your officemates have iBooks they bring to school regularly. (as a Safari user, I can attest that this is still a problem a lot of places). [[User:Ben|Ben]] 17:47, 21 Nov 2005 (EST)&lt;br /&gt;
* The &amp;quot;Quantum Invariants&amp;quot; pages have no link back to the &amp;quot;parent&amp;quot; knot page&amp;quot;. What&#039;s worse, they are not generated in a way that allows to add such &amp;quot;link back&amp;quot; in an easy way! See e.g. [[3_1_Quantum_Invariants]].&lt;br /&gt;
&lt;br /&gt;
=== Pages to write ===&lt;br /&gt;
# Further edit [[How you can contribute]].&lt;br /&gt;
# Finish [[Extending/Modifying KnotTheory`]].&lt;br /&gt;
# Prepare [[List of Modules in KnotTheory`]].&lt;br /&gt;
# Document &amp;quot;The A2 invariant&amp;quot;, &amp;quot;The G2 invariant&amp;quot; and &amp;quot;other quantum invariants&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== More complicated projects ===&lt;br /&gt;
# Identify torus knots.&lt;br /&gt;
## should we have an &#039;identify this knot&#039; function in [[KnotTheory`]]? How to implement it?&lt;br /&gt;
# Clarify orientation issues, especially for links.&lt;br /&gt;
# Extend tables beyond 11 crossings.&lt;br /&gt;
# work out a sensible way to show quantum knot invariants.&lt;br /&gt;
# Add pages on rational knots and other classes of &amp;quot;special&amp;quot; knots.&lt;br /&gt;
# Add a page for &amp;quot;sporadic&amp;quot; special knots.&lt;br /&gt;
&lt;br /&gt;
=== Data to include ===&lt;br /&gt;
# Add Tristram-Levine signatures.&lt;br /&gt;
# Chiral? Invertible?&lt;br /&gt;
# Indicate which knots are the components of given links.&lt;br /&gt;
# Add something about hyperbolic invariants.&lt;br /&gt;
# &amp;quot;Similar Links&amp;quot; using [[The Multivariable Alexander Polynomial]]; add the The Multivariable Alexander Polynomial to the simulated Mathematica sessions.&lt;br /&gt;
&lt;br /&gt;
==Things to calculate==&lt;br /&gt;
# Compute &#039;&#039;HOMFLYPT&#039;&#039; for torus knots.&lt;br /&gt;
# compute Reshetikhin-Turaev invariants for everything in sight.&lt;br /&gt;
&lt;br /&gt;
==KnotTheory`==&lt;br /&gt;
# Unite &amp;lt;code&amp;gt;DrawPD&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;BraidPlot&amp;lt;/code&amp;gt; under Draw.&lt;br /&gt;
# Remove &amp;lt;code&amp;gt;Simplify&amp;lt;/code&amp;gt; from ColouredJones.&lt;br /&gt;
# Custom knot drawings! Output in ps, TeX, etc.&lt;br /&gt;
# Browsable source code for &amp;lt;code&amp;gt;KnotTheory`&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==katlas software==&lt;br /&gt;
* Find out if it&#039;s possible to eliminate the need for &amp;amp;action=purge when transcluded pages change?&lt;br /&gt;
* Tell people about the modifications to [[ImagePage.php]]&lt;br /&gt;
* Fix/improve the &amp;quot;disappearing transclusion&amp;quot; tag &amp;lt;nowiki&amp;gt;&amp;lt;ifpageexists&amp;gt;&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
* Replace the &amp;quot;bracket&amp;quot; splicing model by a &amp;quot;templated&amp;quot; one.&lt;br /&gt;
&lt;br /&gt;
===texvc===&lt;br /&gt;
# can texvc use dvi2bitmap instead of convert? might be much faster? [http://heim.ifi.uio.no/~simek/document/document.ps]&lt;br /&gt;
## alternatively see [http://meta.wikimedia.org/wiki/Problems_with_texvc]&lt;br /&gt;
## what about a cron job to randomly delete entries from mw_math, and the corresponding png&#039;s?&lt;br /&gt;
# Apply patches to texvc, for making transparent, font-sizes png in math mode. [http://meta.wikimedia.org/wiki/Help_talk:Formula]&lt;br /&gt;
&lt;br /&gt;
==Other things==&lt;br /&gt;
# Add the Universal Vassiliev Invariant.&lt;br /&gt;
# Something about knot colouring.&lt;br /&gt;
# Add Ozsvath-Szabo stuff.&lt;br /&gt;
# Make all sources public.&lt;br /&gt;
# Add Dowker codes for links.&lt;br /&gt;
&lt;br /&gt;
==Papers to consider extracting data from==&lt;br /&gt;
# Extract data from Stanford&#039;s paper [http://www.maths.warwick.ac.uk/gt/GTMon4/paper23.abs.html].&lt;br /&gt;
# Extract data from Livingston&#039;s paper [http://www.maths.warwick.ac.uk/agt/AGTVol4/agt-4-1.abs.html].&lt;br /&gt;
# Extract data from Rasmussen&#039;s paper, {{arXiv|math.GT/0402131}}.&lt;br /&gt;
# Extract data from Hikami&#039;s paper, {{arXiv|math.GT/0403224}}.&lt;br /&gt;
# Extract data from Stoimenow&#039;s paper, {{arXiv|math.GT/0405076}}.&lt;br /&gt;
# Extract data from De Wit and Links, {{arXiv|math.GT/0501224}}, and from De Wit, Ishii and Links, {{arXiv|math.GT/0405403}}.&lt;br /&gt;
# Extract data from Cha-Livingston&#039;s paper, {{arXiv|math.GT/0503125}}.&lt;br /&gt;
# Extract data from Hirasawa-Teragaito&#039;s paper, {{arXiv|math.GT/0504446}}.&lt;br /&gt;
# Extract data from Cimasoni-Florens&#039; paper, {{arXiv|math.GT/0505185}}.&lt;br /&gt;
# Extract data from Hoste-Shanahan&#039;s paper, {{arXiv|math.GT/0505442}}.&lt;br /&gt;
# Extract data from Ashton-Cantarella-Piatek-Rawdon&#039;s paper, {{arXiv|math.DG/0508248}}.&lt;br /&gt;
# Extract A-polynomial data from Cooper-Culler-Gillet-Long-Shalen.&lt;br /&gt;
&lt;br /&gt;
[[Special:Whatlinkshere&amp;amp;target=Template:Todo-later|Pages with the &#039;todo-later&#039; template]]&lt;br /&gt;
[[Special:Whatlinkshere&amp;amp;target=Template:Todo|Pages with the &#039;todo&#039; template]]&lt;/div&gt;</summary>
		<author><name>Ben</name></author>
	</entry>
</feed>