# twist16.py -- bistochastic forms of had16.3 obtained by twisting its D16 cocycle along the subgroups of index 2. # For G0 of index 2 in G, with psi trivial over T on G0, choose phi : G0 -> mu_16 with psi = d(phi) on G0, extend it # to G by phi(xt) = psi(x,t) phi(x), so that psi(x,h) = phi(x)phi(h)/phi(xh) for x in G0, and put S0, S1 = sums of # conj(phi) over G0 and over G - G0. When |S0 + w S1|^2 = 16 has a solution w in T, the column multipliers # conj(phi) * (1 on G0, w on G - G0) give a bistochastic form. We find all of them, and sort them into the # 10 classes of bistochastic forms of had16.3 (had163reps.txt), by the invariants of formclasses.py, for the first # cocyclic structure in cocycle163.json. import numpy as np, json, itertools from collections import Counter, defaultdict H=np.loadtxt('had163.txt'); N=16 C=json.load(open('cocycle163.json'))[0] rl,cl,mult,psi=C['rows'],C['cols'],np.array(C['mult']),np.array(C['psi'],float) Mx=H[np.ix_(rl,cl)]; rs=Mx[:,0]*Mx[0,0]; cs=Mx[0,:] # psi = diag(rs) Mx diag(cs) assert np.allclose(rs[:,None]*Mx*cs[None,:],psi) inv=[int(np.nonzero(mult[a]==0)[0][0]) for a in range(N)] def gen(S): S=set(S)|{0} while True: T=S|{int(mult[a][b]) for a in S for b in S} if T==S: return frozenset(S) S=T subs=sorted({gen([a,b]) for a in range(N) for b in range(N) if len(gen([a,b]))==8},key=sorted) def order(a): k=1;x=a while x!=0: x=mult[a][x]; k+=1 return k def key(b): s=H@b; a=np.conj(s/abs(s)); B=a[:,None]*H*b[None,:]; B2=B*B; B3=B2*B return tuple(np.round(np.concatenate([np.sort(abs(B2.sum(1))),np.sort(abs(B2.sum(0))),np.sort(abs(B3.sum(1))),np.sort(abs(B3.sum(0)))]),4)) reps=np.loadtxt('had163reps.txt') classkey={key(np.exp(2j*np.pi*r)):k for k,r in enumerate(reps)} z16=np.exp(2j*np.pi/16) for G0 in subs: G0=sorted(G0); G1=[h for h in range(N) if h not in G0]; t=G1[0] kind="Z8" if any(order(a)==8 for a in G0) else "D8" # generators of G0, and all phi0 : G0 -> mu_16 with psi = d(phi0) on G0, propagated along words in the generators gens=[a for a in G0 if a!=0] gens=min((list(c) for r in (1,2) for c in itertools.combinations(gens,r) if gen(c)==frozenset(G0)),key=len) sols=[] for vals in itertools.product(range(16),repeat=len(gens)): phi={0:1+0j}; fr=[0] while fr: new=[] for x in fr: for g,v in zip(gens,vals): y=int(mult[x][g]); val=phi[x]*z16**v/psi[x,g] if y not in phi: phi[y]=val; new.append(y) fr=new if all(abs(psi[x,y]-phi[x]*phi[y]/phi[int(mult[x][y])])<1e-9 for x in G0 for y in G0): sols.append(phi) print(f"\nG0 = {kind} {G0}: {len(sols)} trivializations phi0 with values in mu_16", "(psi is not trivial on G0)" if not sols else "") found=Counter(); data=defaultdict(set) for phi0 in sols: phi=dict(phi0) for x in G0: phi[int(mult[x][t])]=psi[x,t]*phi0[x] # phi(t) = 1 assert all(abs(psi[x,h]-phi[x]*phi[h]/phi[int(mult[x][h])])<1e-9 for x in G0 for h in range(N)) f=np.array([np.conj(phi[h]) for h in range(N)]) S0=f[G0].sum(); S1=f[G1].sum() A=abs(S0)**2+abs(S1)**2; Bm=2*abs(S0*S1) if abs(N-A)>Bm+1e-9: found['no solution']+=1; continue # |S0 + w S1|^2 = A + 2 Re(w S1 conj(S0)) = N theta=np.angle(S1*np.conj(S0)); c=np.arccos(np.clip((N-A)/Bm,-1,1)) for w in (np.exp(1j*(c-theta)),np.exp(1j*(-c-theta))): cvec=np.where(np.isin(np.arange(N),G0),1,w) beta=f*cvec assert np.allclose(abs(psi@beta),4) b=np.zeros(N,complex); b[cl]=cs*beta # back to the columns of had16.3 assert np.allclose(abs(H@b),4) k=classkey.get(key(b),'new') found[k]+=1; data[k].add((round(abs(S0)**2,6),round(abs(S1)**2,6))) print(" forms found, by class:",dict(found)) for k,v in data.items(): print(f" class {k}: (|S0|^2,|S1|^2) in",sorted(v))