# classify.py -- reruns the screening of screen.py on the files of the catalogue having matrices with an affine profile, # and classifies these matrices by the smallest order of roots of unity over which they are defined, and, for the sign # reductions at an odd prime, by whether the reduction is equivalent to J-2I. For the 2 matrices of BH(9,10) and # BH(10,6) found in this way we also compute dim P_2 and dim P_3, as the multiplicities of the eigenvalue 1 of T_2, T_3. import numpy as np, sys, itertools from math import gcd import screen def minimal_q(E,q): D=(E-E[0:1,:]-E[:,0:1]+E[0,0])%q; g=q for x in D.flatten(): g=gcd(g,int(x)) return q//g, D def is_JminusI(M): N=len(M) for j0 in range(N): v=M[0].copy(); v[j0]=-v[j0]; A=M*v[None,:]; pos=[]; ok=True for a in range(N): nneg=(A[a]<0).sum(); npos=(A[a]>0).sum() if nneg==1: pos.append(int(np.where(A[a]<0)[0][0])) elif npos==1: pos.append(int(np.where(A[a]>0)[0][0])) else: ok=False; break if ok and len(set(pos))==N: return True return False def Tdims(H,n): q=len(H); W=np.array(list(itertools.product(range(q),repeat=n))) A=np.ones((q**n,q**n),complex) for j in range(n): A*=np.conj(H[W[:,j][:,None],W[:,j][None,:]])*H[W[:,(j+1)%n][:,None],W[:,j][None,:]] T=A@A.conj().T/q**(n+1); return int((np.linalg.eigvalsh((T+T.conj().T)/2)>1-1e-8).sum()) files=["BH-6-3","BH-6-4","BH-6-6","BH-6-8","BH-6-9","BH-6-12","BH-6-15","BH-6-16","BH-7-6","BH-7-12","BH-9-10","BH-10-4","BH-10-6","BH-10-8","BH-10-12","BH-10-16","BH-12-2","BH-12-3","BH-12-4","BH-12-6","BH-12-8","BH-12-9","BH-12-10","BH-14-4","BH-20-2","BH-21-3"] for f in files: mats=screen.parse('butson/matrices/'+f+'.txt'); q,E0=mats[0]; N=len(E0); screen.prepare(N) ps=sorted(set(p for p in screen.primes_upto(max(N,q)) if N%p==0 or q%p==0)) cache={p:(screen.vp(N,p),)+screen.setup(q,p,None,screen.vp(N,p)) for p in ps} summary={} for k,(q,E) in enumerate(mats): found=None for M in (E,E.T.copy()): for p in ps: v,R,F,roots=cache[p] for x in screen.screen_matrix(M,q,p,v,R,F,roots,N): if x is not None and found is None: found=(p,x) if found: break if not found: continue mq,D=minimal_q(E,q); p,(r,vals)=found X=screen.addone(screen.field_val(cache[p][2],vals[0],p),p); Y=screen.addone(screen.field_val(cache[p][2],vals[1],p),p) kind=f"q={mq}, p={p}, X={X}, Y={Y}" qq=mq while qq%p==0: qq//=p if p%2==1 and qq==2 and N%p!=0: kind+=", J-2I" if is_JminusI(np.where((D//(q//mq))%2==0,1,-1)) else ", other sign pattern" summary.setdefault(kind,[]).append(k+1) print(f, {k:(len(v),v[:6]) for k,v in summary.items()}, flush=True) for f,k in [("BH-9-10",1),("BH-10-6",28)]: q,E=screen.parse('butson/matrices/'+f+'.txt')[k-1]; H=np.exp(2j*np.pi*E/q) print(f,"#",k,": dim P_2 =",Tdims(H,2),", dim P_3 =",Tdims(H,3))