From dd06bbec217a272c911a972d6830aa152917a226 Mon Sep 17 00:00:00 2001 From: Yu Cong Date: Sun, 19 Oct 2025 23:48:01 +0800 Subject: [PATCH] fix bug --- projection.sage | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/projection.sage b/projection.sage index 8f5ba2e..e6eb77e 100644 --- a/projection.sage +++ b/projection.sage @@ -30,13 +30,14 @@ def cogirthip(bases, integral=true): cnt=0 # actual number of instances tested f = lambda g: g.is_connected() -for n in range(4,20): - for g in filter(f, graphs(n)): +for N in range(8,20): + for g in filter(f, graphs(N)): A=g.incidence_matrix() n,m = A.dimensions() # enumerate all vectors in F_2^n with even number of 1s - V = VectorSpace(GF(2), n) + V = VectorSpace(GF(2), N) for v in filter(lambda v: v.hamming_weight() % 2 == 0 and v!=0, V): + cnt=cnt+1 v_col=matrix(v).transpose() A_t=A.augment(v_col) # print(A_t) @@ -46,9 +47,9 @@ for n in range(4,20): strength=cogirthip(bases,integral=false) cogirth =cogirthip(bases,integral=true) gap = cogirth/strength - if gap > 2.01: + if gap > 3.01: print(f"bad example! gap={gap}") - with open("projection.out", "a") as f: - f.write(str(gap)+"\n"+str(A_t)+"\n") - else: - print(f"n={n},m={m},gap={gap}") \ No newline at end of file + with open("projection.out", "a") as file: + file.write(str(gap)+"\n"+str(A_t)+"\n") + if cnt%100==0: + print(f"#{cnt},n={n},m={m}") \ No newline at end of file