# d8form.py -- the cocyclic form of had16.3 over the dihedral group D8 = of # order 16, in the ordering 1, r, ..., r^7, s, rs, ..., r^7 s, from the first cocyclic structure in cocycle163.json. # Also: the extension group (element orders, which identify the generalized quaternion group Q32), a trivialization # phi0 of the cocycle on with values in mu_16, and the coset sums S0, S1 of the twisted forms, for all the # 8 trivializations, with |S0|^2 + |S1|^2 = 16 and |S0 S1|^2 = 48 +- 8 sqrt 2. import numpy as np, json from collections import Counter C=json.load(open('cocycle163.json'))[0] mult=C['mult']; psi=np.array(C['psi']); N=16 def order(a): k=1;x=a while x!=0: x=mult[a][x]; k+=1 return k r=next(a for a in range(N) if order(a)==8) powers=[0] for _ in range(7): powers.append(mult[powers[-1]][r]) inv=lambda a:next(b for b in range(N) if mult[a][b]==0) s=next(a for a in range(N) if order(a)==2 and a not in powers and mult[mult[a][r]][a]==inv(r)) order_=powers+[mult[p][s] for p in powers] # r^a, then r^a s P=psi[np.ix_(order_,order_)] assert (P@P.T==16*np.eye(16)).all() and (P[0]==1).all() and (P[:,0]==1).all() print("cocyclic form psi(g,h) of had16.3 over D8, rows and columns 1, r, ..., r^7, s, rs, ..., r^7 s:") for row in P: print(" "+"".join('+' if x>0 else '-' for x in row)) print("TeX rows:") print("\\\\\n".join("&".join('+' if x>0 else '-' for x in row) for row in P)) E=[(e,g) for e in range(2) for g in range(N)] emul=lambda x,y:((x[0]+y[0]+(psi[x[1],y[1]]<0))%2,mult[x[1]][y[1]]) def eorder(x): k=1;y=x while y!=(0,0): y=emul(x,y); k+=1 return k print("extension group: element orders",sorted(Counter(eorder(x) for x in E).items()),"(those of Q32)") # trivializations of psi on , values in mu_16: phi0(r^(a+1)) = phi0(r^a) phi0(r) / psi(r^a, r) z=np.exp(2j*np.pi/16) for m in range(16): phi=[1+0j] for a in range(7): phi.append(phi[-1]*z**m/psi[powers[a],r]) if abs(phi[-1]*z**m/psi[powers[7],r]-1)>1e-9: continue ok=all(abs(psi[powers[a],powers[b]]-phi[a]*phi[b]/phi[(a+b)%8])<1e-9 for a in range(8) for b in range(8)) assert ok phid={powers[a]:phi[a] for a in range(8)} t=s for a in range(8): phid[mult[powers[a]][t]]=psi[powers[a],t]*phi[a] f=np.array([np.conj(phid[h]) for h in range(N)]) S0=sum(f[powers]); S1=sum(f[[mult[p][s] for p in powers]]) ex=[round(np.angle(x)/(2*np.pi)*16)%16 for x in phi] print(f"phi0(r)=zeta^{m}: phi0(r^a) = zeta^{ex}, |S0|^2 = {abs(S0)**2:.6f}, |S1|^2 = {abs(S1)**2:.6f}, " f"|S0 S1|^2 = {abs(S0*S1)**2:.6f} (48+8sqrt2 = {48+8*np.sqrt(2):.6f}, 48-8sqrt2 = {48-8*np.sqrt(2):.6f})")