# cocyclicodd.py -- centrally regular subgroups of the symmetry group of a real Hadamard matrix of order N=4p, with p # an odd prime (N=12,20), from aut.npy (autgroup.py). The quotient K=R/ acts regularly on the columns; its Sylow # 2-subgroup has order 4 and is conjugate into a fixed Sylow 2-subgroup of the image of Aut(H) in S_N, and K is # generated by it and by any element of order p of K. So we run over the semiregular subgroups of order 4 of that # Sylow subgroup, and over all the semiregular elements of order p, and we keep the regular subgroups generated. import numpy as np, sys, time, itertools from collections import Counter t0=time.time() H=np.loadtxt(sys.argv[1]).astype(int); N=len(H); p=N//4 Qs=np.load(sys.argv[2] if len(sys.argv)>2 else 'aut.npy'); M=len(Qs) c=np.argmax(np.abs(Qs),axis=1); s=np.take_along_axis(Qs,c[:,None,:],axis=1)[:,0,:] P32=np.zeros((M,2*N),np.int16); P32[:,:N]=c+N*(s<0); P32[:,N:]=c+N*(s>0) bars=[tuple(int(x) for x in r) for r in c] Abar=sorted(set(bars)); print(f"|Aut| = {M}, image in S_{N}: {len(Abar)}, kernel: {M//len(Abar)}",flush=True) assert M==2*len(Abar) def pmul(a,b): return tuple(a[x] for x in b) e=tuple(range(N)) def closure(gens,limit): G={e}; fr=[e] while fr: new=[] for x in fr: for g in gens: y=pmul(g,x) if y not in G: G.add(y); new.append(y) if len(G)>limit: return None fr=new return frozenset(G) def order(x): k=1;y=x while y!=e: y=pmul(x,y); k+=1 return k def semiregular(x): o=order(x); y=x for k in range(1,o): if any(y[i]==i for i in range(N)): return False y=pmul(x,y) return True # a Sylow 2-subgroup of Abar, grown inside the normalizers Aset=set(Abar); S=frozenset([e]); target=1 while len(Abar)%(2*target)==0: target*=2 while len(S)3 else 'cocyclic_R.npy',np.array([np.array(v) for v in examples.values()])) print("centrally regular examples saved:",list(examples.keys())) print(f"done in {time.time()-t0:.0f}s")