Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Some computer codes used in the paper "The Jacobian of Sixth-Root-of-Unity Matroid" by Matt Baker, Changxin Ding, and Xu Zhuang.

20 views
License: OTHER
unlisted
ubuntu2204
#This worksheet should be viewed as a part of the paper "The Jacobian of Sixth-Root-of-Unity Matroid" by Matt Baker, Changxin Ding, and Xu Zhuang. So they shara the same licence.
#Part I: Some basic settings
w = QQbar(-1)^(1/3) R=ZZ[w] #R is the ring of Eisenstein integers. def smith(A): #input a matroid A, print SNF(AA*) B=A*A.conjugate_transpose() D, U, V =B.smith_form() print(D) def checkHmatrix(A): #check whether a matrix is H-matrix r=A.nrows() n=A.ncols() for k in range(2,r): I=Combinations(range(r),k) J=Combinations(range(n),k) for i in I: for j in J: d=(A.matrix_from_rows_and_columns(i, j)).det() if (d!=0) & (d!=1) & (d!=-1) & (d!=w) & (d!=-w) & (d!=w-1) & (d!=1-w) : print(i,j,d) return False return True
#Part II: Jacobian is not well-defined
M0= matrix(R, [[1,0,0,0,-w^2,w^2,1],[0,1,0,0,w^2,-w^2,0],[0,0,1,0,1,-1,1],[0,0,0,1,-w^2,w,0]]);M0 #I don't know why it prints the letter a instead of w. If someone is willing to help, send email to [email protected]
[ 1 0 0 0 -a + 1 a - 1 1] [ 0 1 0 0 a - 1 -a + 1 0] [ 0 0 1 0 1 -1 1] [ 0 0 0 1 -a + 1 a 0]
checkHmatrix(M0) # If M_0 is an H-matrix, it is easy to see M_1 and M_8 are H-matrices.
True
M1= matrix(R, [[1,0,0,0,-w^2,w^2,1,1],[0,1,0,0,w^2,-w^2,0,0],[0,0,1,0,1,-1,1,1],[0,0,0,1,-w^2,w,0,0]]);M1
[ 1 0 0 0 -a + 1 a - 1 1 1] [ 0 1 0 0 a - 1 -a + 1 0 0] [ 0 0 1 0 1 -1 1 1] [ 0 0 0 1 -a + 1 a 0 0]
M8= matrix(R, [[1,0,0,0,-w^2,w^2,1,1,1,1,1,1,1,1,1],[0,1,0,0,w^2,-w^2,0,0,0,0,0,0,0,0,0],[0,0,1,0,1,-1,1,1,1,1,1,1,1,1,1],[0,0,0,1,-w^2,w,0,0,0,0,0,0,0,0,0]]);M8
[ 1 0 0 0 -a + 1 a - 1 1 1 1 1 1 1 1 1 1] [ 0 1 0 0 a - 1 -a + 1 0 0 0 0 0 0 0 0 0] [ 0 0 1 0 1 -1 1 1 1 1 1 1 1 1 1] [ 0 0 0 1 -a + 1 a 0 0 0 0 0 0 0 0 0]
M1.swap_rows(0,3);M1 #It is a middle step to construct the 2-sum of M_1 and M_8.
[ 0 0 0 1 -a + 1 a 0 0] [ 0 1 0 0 a - 1 -a + 1 0 0] [ 0 0 1 0 1 -1 1 1] [ 1 0 0 0 -a + 1 a - 1 1 1]
nonexample1 = matrix(R,7,21) nonexample1[range(4),range(7)]=M1[range(4),range(1,8)] nonexample1[range(3,7),range(7,21)]=M8[range(4),range(1,15)] #2-sum of M_1 and M_8 nonexample2 = matrix(R,7,21) nonexample2[range(4),range(7)]=M1[range(4),range(1,8)] nonexample2[range(3,7),range(7,21)]=(M8[range(4),range(1,15)]).conjugate() #2-sum of M_1 and the conjugate of M_8
print(nonexample1) smith(nonexample1) print(nonexample2) smith(nonexample2)
[ 0 0 1 -a + 1 a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [ 1 0 0 a - 1 -a + 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [ 0 1 0 1 -1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [ 0 0 0 -a + 1 a - 1 1 1 0 0 0 -a + 1 a - 1 1 1 1 1 1 1 1 1 1] [ 0 0 0 0 0 0 0 1 0 0 a - 1 -a + 1 0 0 0 0 0 0 0 0 0] [ 0 0 0 0 0 0 0 0 1 0 1 -1 1 1 1 1 1 1 1 1 1] [ 0 0 0 0 0 0 0 0 0 1 -a + 1 a 0 0 0 0 0 0 0 0 0] [ 1 0 0 0 0 0 0] [ 0 1 0 0 0 0 0] [ 0 0 1 0 0 0 0] [ 0 0 0 1 0 0 0] [ 0 0 0 0 1 0 0] [ 0 0 0 0 0 21 0] [ 0 0 0 0 0 0 147] [ 0 0 1 -a + 1 a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [ 1 0 0 a - 1 -a + 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [ 0 1 0 1 -1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [ 0 0 0 -a + 1 a - 1 1 1 0 0 0 a -a 1 1 1 1 1 1 1 1 1] [ 0 0 0 0 0 0 0 1 0 0 -a a 0 0 0 0 0 0 0 0 0] [ 0 0 0 0 0 0 0 0 1 0 1 -1 1 1 1 1 1 1 1 1 1] [ 0 0 0 0 0 0 0 0 0 1 a -a + 1 0 0 0 0 0 0 0 0 0] [ 1 0 0 0 0 0 0] [ 0 1 0 0 0 0 0] [ 0 0 1 0 0 0 0] [ 0 0 0 1 0 0 0] [ 0 0 0 0 1 0 0] [ 0 0 0 0 0 3 0] [ 0 0 0 0 0 0 1029]
#Part III: some examples
#AG(2,3) and AG(2,3) minus one edge
AG23=matrix(R,[[1 , 0 , 0 , 1 , 0 , 1 , 1 , 1, 1],[0 , 1 , 0 , 1 , 1 , 0 , 1-w , 1 , 1-w],[0 , 0 , 1 , 0 , 1 , -w , -w , 1-w , 1-w]]); AG23 #AG23 in whittle paper
[ 1 0 0 1 0 1 1 1 1] [ 0 1 0 1 1 0 -a + 1 1 -a + 1] [ 0 0 1 0 1 -a -a -a + 1 -a + 1]
#a is w.
checkHmatrix(AG23) Matroid(AG23).is_3connected() AG23*AG23.conjugate_transpose()
True True [ 6 2*a + 2 4*a - 2] [-2*a + 4 6 2*a + 2] [-4*a + 2 -2*a + 4 6]
smith(AG23)
[ 2*a + 2 0 0] [ 0 2*a + 2 0] [ 0 0 -6*a + 6]
AG23minus=AG23.delete_columns([0]);AG23minus
[ 0 0 1 0 1 1 1 1] [ 1 0 1 1 0 -a + 1 1 -a + 1] [ 0 1 0 1 -a -a -a + 1 -a + 1]
Matroid(AG23minus).is_3connected() smith(AG23minus)
True [ 1 0 0] [ 0 2*a + 2 0] [ 0 0 -8*a + 16]
#Matroid Q10
Matroid_Q10 = matroids.named_matroids.Q10() Matroid_Q10.is_3connected() Matroid_Q10.bases_count()
True 181
#The whirl
def whirl(r): #input r>=1,output an H-representation of the whirl A = matrix(R,r,2*r) A[0,0]=1 A[0,r]=1 if r%2==0: A[0,2*r-1]=w else: A[0,2*r-1]=w^2 for t in range(1,r): A[t,t]=1 A[t,t+r]=1 A[t,t+r-1]=1 return A
for r in range(3,10): A=whirl(r) print(r) smith(A)
3 [ 1 0 0] [ 0 1 0] [ 0 0 17] 4 [ 1 0 0 0] [ 0 1 0 0] [ 0 0 1 0] [ 0 0 0 46] 5 [ 1 0 0 0 0] [ 0 1 0 0 0] [ 0 0 1 0 0] [ 0 0 0 1 0] [ 0 0 0 0 122] 6 [ 1 0 0 0 0 0] [ 0 1 0 0 0 0] [ 0 0 1 0 0 0] [ 0 0 0 1 0 0] [ 0 0 0 0 a + 1 0] [ 0 0 0 0 0 -107*a + 214] 7 [ 1 0 0 0 0 0 0] [ 0 1 0 0 0 0 0] [ 0 0 1 0 0 0 0] [ 0 0 0 1 0 0 0] [ 0 0 0 0 1 0 0] [ 0 0 0 0 0 1 0] [ 0 0 0 0 0 0 842] 8 [ 1 0 0 0 0 0 0 0] [ 0 1 0 0 0 0 0 0] [ 0 0 1 0 0 0 0 0] [ 0 0 0 1 0 0 0 0] [ 0 0 0 0 1 0 0 0] [ 0 0 0 0 0 1 0 0] [ 0 0 0 0 0 0 1 0] [ 0 0 0 0 0 0 0 2206] 9 [ 1 0 0 0 0 0 0 0 0] [ 0 1 0 0 0 0 0 0 0] [ 0 0 1 0 0 0 0 0 0] [ 0 0 0 1 0 0 0 0 0] [ 0 0 0 0 1 0 0 0 0] [ 0 0 0 0 0 1 0 0 0] [ 0 0 0 0 0 0 1 0 0] [ 0 0 0 0 0 0 0 1 0] [ 0 0 0 0 0 0 0 0 5777]
︠cd8fdfb1-1a49-44ca-a3ec-0efaee00d33b︠