# reduce16.py -- the bistochastic forms of had16.3 coming from the reduction to coset sums (reduce.py), for the normal # subgroups G0 of D8 on which the cocycle is a coboundary over T (first structure in cocycle163.json): for each of them # we solve the k x k problem U c # unimodular, k = [D8:G0], by the alternating iteration from random starts, and we sort the resulting forms of # had16.3 into its 10 orbits of bistochastic forms (had163reps.txt), by the invariants of formclasses.py. import numpy as np, json, itertools from collections import Counter 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)]; cs=Mx[0,:] inv=[int(np.nonzero(mult[a]==0)[0][0]) for a in range(N)] 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)} 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={gen(c) for r in (1,2) for c in itertools.combinations(range(N),r)} normal=[K for K in subs if 1