# Search for a Hadamard difference set # Read("AfterC9xC2xC2xC2xC2.txt"); # Ken Smith # June 23, 2007 Read("ShiftProcedures_2007.txt"); ############################################################ # We write out the initial solutions: ############################################################ v := 9; Zero1 := [0,0,0, 0,0,0, 0,0,0]; # Here are the C_9 solutions # We add [ 4,0,0, 4,0,0, 4,0,0], # to shifts of +- [8,0,0, -4,0,0, -4,0,0]. A1 := [ [12,0,0, 0,0,0, 0,0,0], [-4,0,0, 8,0,0, 8,0,0], [ 4,8,0, 4,-4,0, 4,-4,0], [ 4,-8,0, 4,4,0, 4,4,0], [ 4,0,8, 4,0,-4, 4,0,-4], [ 4,0,-8, 4,0,4, 4,0,4] ]; # A1 := [[12,0,0, 0,0,0, 0,0,0],[ 4,-8,0, 4,4,0, 4,4,0],[ 4,0,8, 4,0,-4, 4,0,-4]]; # Just one thing to try as part of a toy run. ############################################################ # We work on the C_9 x C_2 solutions: ############################################################ B1 := ShallowCopy(A1); A2_temp := [ ]; for b1 in B1 do for shift in [1..v] do b1_s := ShiftLeft( b1, shift ); for a1 in A1 do plus_mod2 :=(a1 + b1_s) mod 4; if plus_mod2 = Zero1 then x := [ (a1 + b1_s)/2, (a1 - b1_s)/2 ]; Add( A2_temp, x ); fi; od; od; od; Print("\nSize of A2 is ", Size(A2_temp), "\n"); # Let us check the coset bound cosetbound := 8; A2 := [ ]; for x in A2_temp do x_max1 := Maximum(x[1]); x_max2 := Maximum(x[2]); x_max := Maximum(x_max1, x_max2); x_min1 := Minimum(x[1]); x_min2 := Minimum(x[2]); x_min:= Minimum(x_min1, x_min2); if x_max <= cosetbound and x_min >= -cosetbound then Add( A2, x ); fi; od; Print("Size of A2 after coset bound check is ", Size( A2 ), "\n"); # I get 311 of 324 trials, in less than a second. ############################################################ # We work on the C9 x C2 x C2 solutions. ############################################################ # The coset bound here is 4. B2 := ShallowCopy(A2); A3_temp := [ ]; for b2 in B2 do for shift in [1..v] do b2_s := ShiftLeft_2D( b2, shift ); for a2 in A2 do plus_mod2 := (a2 + b2_s) mod 4; if plus_mod2 = [Zero1, Zero1] then x := [ (a2 + b2_s)/2, (a2 - b2_s)/2 ]; Add( A3_temp, x ); fi; od; od; od; Print("\nSize of A3 is ", Size(A3_temp), "\n"); # Let us check the coset bound cosetbound := 4; A3 := [ ]; for x in A3_temp do x_max11 := Maximum(x[1][1]); x_max12 := Maximum(x[1][2]); x_max21 := Maximum(x[2][1]); x_max22 := Maximum(x[2][2]); x_max := Maximum(x_max11, x_max12, x_max21, x_max22 ); if x_max <= cosetbound then x_min11 := Minimum(x[1][1]); x_min12 := Minimum(x[1][2]); x_min21 := Minimum(x[2][1]); x_min22 := Minimum(x[2][2]); x_min := Minimum(x_min11, x_min12, x_min21, x_min22 ); if x_min >= -cosetbound then Add( A3, x ); fi; fi; od; Print("Size after coset bound check for A3 is ", Size( A3 ), "\n"); # On my Mac I get 3586 solutions (A3) out of 7057 trials (A3_temp), in about 20 seconds. # The final run takes a dozen hours or more. ############################################################ # We work on the C9 x C2 x C2 x C2 solutions. # The coset bound here is 2. B3 := ShallowCopy(A3); A4_temp := [ ]; for b3 in B3 do for shift in [1..v] do b3_s := ShiftLeft_3D( b3, shift ); for a3 in A3 do plus_mod2 := (a3+b3_s) mod 4; if plus_mod2 = [[Zero1, Zero1],[Zero1, Zero1]] then x := [ (a3 + b3_s)/2, (a3 - b3_s)/2 ]; Add( A4_temp, x ); fi; od; od; od; Print("\nSize of A4 is ", Size(A4_temp), "\n"); # Let us check the coset bound cosetbound := 2; A4 := [ ]; for x in A4_temp do x_max111 := Maximum(x[1][1][1]); x_max112 := Maximum(x[1][1][2]); x_max121 := Maximum(x[1][2][1]); x_max122 := Maximum(x[1][2][2]); x_max211 := Maximum(x[2][1][1]); x_max212 := Maximum(x[2][1][2]); x_max221 := Maximum(x[2][2][1]); x_max222 := Maximum(x[2][2][2]); x_max := Maximum(x_max111, x_max112, x_max121, x_max122, x_max211, x_max212, x_max221, x_max222 ); if x_max <= cosetbound then x_min111 := Minimum(x[1][1][1]); x_min112 := Minimum(x[1][1][2]); x_min121 := Minimum(x[1][2][1]); x_min122 := Minimum(x[1][2][2]); x_min211 := Minimum(x[2][1][1]); x_min212 := Minimum(x[2][1][2]); x_min221 := Minimum(x[2][2][1]); x_min222 := Minimum(x[2][2][2]); x_min := Minimum(x_min111, x_min112, x_min121, x_min122, x_min211, x_min212, x_min221, x_min222 ); if x_min >= -cosetbound then Add( A4, x ); fi; fi; od; Print("Size after coset bound check for A4 is ", Size( A4 ), "\n");