# \\ EXAMPLE IN DIMENSION 3: DEBUGLEVEL = 4; Q = matrix(3,3,i,j,random(10^10));printp(Q=Q+Q~);Qfsolve(Q) \\ EXAMPLE IN DIMENSION 4: THE MINIMIZATION IS NOT ENOUGH \\ BECAUSE WE CAN ONLY REMOVE SQUARES DEBUGLEVEL = 1; Q = matrix(4,4,i,j,random(10^10));printp(Q=Q+Q~);Qfsolve4(Q) \\ AN EASY EXAMPLE IN DIMENSION 8: WE CAN REMOVE ALL SQUARES DEBUGLEVEL=0; Q=[149628, 87872, 63723, 154291, 168999, 46218, 92946, 22412; 87872, 11204, 39583, 169471, 146953, 182939, 131682, 75089; 63723, 39583, 41978, 52541, 137040, 91604, 72641, 40292; 154291, 169471, 52541, 11138, 88713, 54314, 96376, 137857; 168999, 146953, 137040, 88713, 56110, 143900, 77426, 102034; 46218, 182939, 91604, 54314, 143900, 138344, 79785, 70519; 92946, 131682, 72641, 96376, 77426, 79785, 17266, 158685; 22412, 75089, 40292, 137857, 102034, 70519, 158685, 86452] qfsign(Q); print("detQ=",factor(matdet(Q))); printp("invQ=",invQ=Qflisteinvariants(Q)); dd=matdet(Q); dd%4 clgp1=class2(dd); inv1=Mat(Qflisteinvariants(clgp1[2])) matinverseimage(Mod(vecextract(inv1,"3..8","1..5"),2),vecextract(invQ[,2],"3..8")) clgp2=class2(-4*dd); inv2=Mat(Qflisteinvariants(clgp2[2])) lift(matinverseimage(Mod(vecextract(inv2,"3..8","1..6"),2),vecextract(invQ[,2],"3..8"))) Q3=mymat(qfbcompraw(clgp2[2][3],clgp2[2][5])); min4=Qfminim(Q4=matdiagonalblock([Q,-Q3])); matdet(Q5=min4[1]) DEBUGLEVEL =4; res=LLLgoon2(Q5); res[1] solQ5=vecextract(res[2],"1..4"); solQ5~*Q5*solQ5 solQ4 = min4[2]*solQ5; solQ4~*Q4*solQ4 solQ = matintersect(solQ4,vecextract(matid(10),"1..8")); solQ/=content(solQ); length(solQ) solQ = vecextract(solQ,"1..8","1..2"); solQ~*Q*solQ \\ A DIFFICULT EXAMPLE IN DIMENSION 8: WE CAN NOT REMOVE ALL SQUARES. DEBUGLEVEL=0; Q=[187180, 194849, 39028, 62323, 87279, 94943, 150381, 123774; 194849, 8390, 25327, 120218, 79721, 55940, 137090, 71497; 39028, 25327, 68768, 85444, 102863, 100662, 38812, 97113; 62323, 120218, 85444, 180, 84566, 77189, 133438, 92894; 87279, 79721, 102863, 84566, 164350, 46194, 79530, 167049; 94943, 55940, 100662, 77189, 46194, 58500, 131210, 108443; 150381, 137090, 38812, 133438, 79530, 131210, 21886, 90421; 123774, 71497, 97113, 92894, 167049, 108443, 90421, 74918]; qfsign(Q) print("detQ=",factor(matdet(Q))); print("minim=",factor(matdet(Qfminim(Q)[1]))); Q2=matdiagonalblock([Q,Mat([+5])]); min2=Qfminim(Q2); print("invQ2=",Qflisteinvariants(Q2)); dd=matdet(Q)/5; dd%4 clgp1=class2(dd); Qflisteinvariants(clgp1[2]) clgp2=class2(-4*dd); Qflisteinvariants(clgp2[2]) Q3=mymat(qfbcompraw(clgp2[2][1],clgp2[2][2])) min4=Qfminim(Q4=matdiagonalblock([Q2,-Q3])); matdet(Q5=min4[1]) DEBUGLEVEL =3; res=LLLgoon2(Q5); res[1] solQ5=vecextract(res[2],"1..5"); solQ5~*Q5*solQ5 solQ4 = min4[2]*solQ5; solQ4~*Q4*solQ4 solQ = matintersect(solQ4,vecextract(matid(11),"1..8")); solQ/=content(solQ); length(solQ) solQ = vecextract(solQ,"1..8","1..2"); solQ~*Q*solQ