# berezin.py -- the defect as an eigenvalue multiplicity, and the flux harmonics. For a complex Hadamard matrix H of # order N, the Berezin matrix of Karabegov is the N^2 x N^2 matrix L_{ij,kl} = H_ij conj(H_kj) H_kl conj(H_il) / N, # indexed by the pairs (row, column), whose entries are the flux phases of the rectangles. We check that L is unitary # and symmetric, that the defect of Tadej and Zyczkowski is dim ker(L-1) - (2N-1), as found by Tadej, and that the power # traces Tr(L^r) are the partition functions of the necklaces of r rectangles, divided by N^r. We then compute the flux # harmonics R_k(H) = ||H^k (H^k)^*||_2^2, with H^k the entrywise power, which are the closed diagrams separating the # Fourier matrices in the work of Brannan, Gromada, Hernandez Palomares and Priebe, checking R_k(F_n) = n^3 gcd(k,n), # the multiplicativity under tensor products, and the formula R_2 = 192 + 64 cos(2t) for F_2 (x)_q F_2, q = e^{it}. # We also check that F_2 (x)_q F_2 is equivalent to its versions with q replaced by conj(q) and -q, so that the classes in # order 4 are parametrized by q = e^{it} with t in [0,pi/2], and separated by R_2. Finally, we check that the defect # and dim P_2 are invariant under the Galois conjugation of the Butson matrices, while R_2, and so the moment E|Omega|^8 # of the complex glow, is not, on the example q = e^{i pi/5}, q^3. import numpy as np, glob, itertools from math import gcd def defect(H): H=np.asarray(H,complex); N=len(H); rows=[] for i in range(N): for j in range(i+1,N): v=H[i]*np.conj(H[j]); r=np.zeros((N,N),complex); r[i,:]+=v; r[j,:]-=v; rows.append(r.ravel()) L=np.array(rows); M=np.vstack([L.real,L.imag]); s=np.linalg.svd(M,compute_uv=False) return N*N-int(np.sum(s>1e-8*s[0]))-(2*N-1) def berezin(H): H=np.asarray(H,complex); N=len(H) L=np.einsum('ij,kj,kl,il->ijkl',H,H.conj(),H,H.conj())/N return L.reshape(N*N,N*N) def mult1(L,tol=1e-7): ev=np.linalg.eigvals(L); return int(np.sum(abs(ev-1)|^2 / N def R(H,k): K=np.asarray(H,complex)**k; G=K@K.conj().T; return float(np.sum(abs(G)**2)) def fourier(N): return np.exp(2j*np.pi*np.outer(np.arange(N),np.arange(N))/N) i=1j; w=np.exp(2j*np.pi/3) Haag=np.array([[1,1,1,1,1,1],[1,-1,i,i,-i,-i],[1,i,-1,-i,i,-i],[1,i,-i,-1,-i,i],[1,-i,i,-i,-1,i],[1,-i,-i,i,i,-1]]) Tao=np.array([[1,1,1,1,1,1],[1,1,w,w,w**2,w**2],[1,w,1,w**2,w**2,w],[1,w,w**2,1,w,w**2],[1,w**2,w**2,w,1,w],[1,w**2,w,w**2,w,1]]) def F4q(q): return np.array([[1,1,1,1],[1,-1,1,-1],[1,q,-1,-q],[1,-q,-1,q]]) def dita6(t): F2=fourier(2); F3=fourier(3); q=np.exp(1j*t); Q=np.array([[1,1],[1,q],[1,q**2]]); H=np.zeros((6,6),complex) for a in range(3): for b in range(2): for c in range(3): for d in range(2): H[2*a+b,2*c+d]=Q[a,d]*F3[a,c]*F2[b,d] return H ex=[("F_2 (x)_q F_2, q=e^(0.7i)",F4q(np.exp(0.7j))),("F_2 (x)_q F_2, q=i",F4q(1j))]+[(f"F_{n}",fourier(n)) for n in range(4,13)] ex+=[("F_3 (x)_Q F_2, t=0.4",dita6(0.4)),("Haagerup",Haag),("Tao",Tao)] ex+=[(f.split('/')[-1][:-4],np.loadtxt(f)) for f in sorted(glob.glob('matrices/*.txt'))] print("(1) the Berezin matrix L: unitarity, symmetry, and the defect as dim ker(L-1) - (2N-1)") for name,H in ex: N=len(H); L=berezin(H); un=np.abs(L@L.conj().T-np.eye(N*N)).max(); sy=np.abs(L-L.T).max() d1=defect(H); d2=mult1(L)-(2*N-1) print(f" {name:26s} N={N:2d} |LL*-1| = {un:.1e} |L-L^t| = {sy:.1e} defect = {d1:3d} dim ker(L-1)-(2N-1) = {d2:3d} {'ok' if d1==d2 else 'FAIL'}",flush=True) print("(2) Tr(L^r) = N^-r times the necklace of r rectangles, r = 1,2,3") for name,H in [("F_4",fourier(4)),("Haagerup",Haag),("Tao",Tao),("F_2 (x)_q F_2, q=e^(0.7i)",F4q(np.exp(0.7j)))]: N=len(H); L=berezin(H); out=[] for r in (1,2,3): a=np.trace(np.linalg.matrix_power(L,r)); b=necklace(H,r)/N**r; out.append(f"r={r}: {a.real:+.6f}{a.imag:+.6f}i vs {b.real:+.6f}{b.imag:+.6f}i") print(f" {name:26s} "+" ".join(out),flush=True) print("(3) flux harmonics: R_k(F_n) = n^3 gcd(k,n), multiplicativity, and R_2 of F_2 (x)_q F_2") bad=0 for n in range(2,13): for k in range(1,7): if abs(R(fourier(n),k)-n**3*gcd(k,n))>1e-6*n**4: bad+=1 print(f" R_k(F_n) = n^3 gcd(k,n) for n <= 12, k <= 6: {'ok' if bad==0 else 'FAIL'}") for m,p in [(2,2),(3,2),(2,3)]: n=m*p*p; A=R(fourier(n),p); B=R(np.kron(fourier(m*p),fourier(p)),p) print(f" n={n:2d}: R_{p}(F_{n}) = {A:.0f} = n^3 {A/n**3:.0f}, R_{p}(F_{m*p} (x) F_{p}) = {B:.0f} = n^3 {B/n**3:.0f}") for t in (0.3,0.7,1.1): print(f" F_2 (x)_q F_2, q=e^({t}i): R_2 = {R(F4q(np.exp(1j*t)),2):.6f}, 192+64cos(2t) = {192+64*np.cos(2*t):.6f}") for name,H in [("F_6",fourier(6)),("F_3 (x)_Q F_2, t=0.4",dita6(0.4)),("Haagerup",Haag),("Tao",Tao)]: print(f" {name:26s} R_2 = {R(H,2):.3f} R_3 = {R(H,3):.3f}") def deph(M): M=M/M[:,[0]]; return M/M[[0],:] def equivalent(A,B): DB=deph(B); n=len(A) for p in itertools.permutations(range(n)): for r in itertools.permutations(range(n)): if np.allclose(deph(A[list(p)][:,list(r)]),DB,atol=1e-9): return True return False for t in (0.3,0.7,1.1,1.4): q=np.exp(1j*t); A=F4q(q) print(f" q=e^({t}i): equivalent to the version with conj(q): {equivalent(A,F4q(np.conj(q)))}, with -q: {equivalent(A,F4q(-q))}") print("(4) Galois conjugation: q = e^(i pi/5) and its conjugate q^3, in F_2 (x)_q F_2") for e in (1,3): H=F4q(np.exp(1j*np.pi*e/5)); ev=np.linalg.eigvalsh(T2(H)) print(f" q = e^({e} i pi/5): defect = {defect(H)}, dim ker(L-1)-7 = {mult1(berezin(H))-7}, dim P_2 = {int(np.sum(abs(ev-1)<1e-8))}, R_2 = {R(H,2):.6f}")