# specialization.py -- checks the ingredients of the proof that the generic Karlsson matrices are wild. The Karlsson matrices # are written as in the paper, with 2x2 blocks X_i Omega^{ij} Y_j, Omega = -1/2 + i sqrt(3)/2 Lambda, Lambda the reflection # with first row (cos t, e^{i f} sin t), z_1 = e^{i s}, z_3^2 = M_A(z_1^2), z_4^2 = M_B(z_1^2), and z_2^2 = M_A^{-1}(z_4^2) # or M_B^{-1}(z_3^2). We check that both formulas give Hadamard matrices, that the Dita family through the Haagerup # matrix, in the form A(z) used by Bisch and Nicoara, decomposes into Hadamard 2x2 blocks, and is the curve t=arccos(1/sqrt3), # f=pi/4, with all the Haagerup invariants being 4th roots of unity at s=0, that the family is continuous at this point, # and we compute c_2, c_3, c_4 there, and at random parameters, as multiplicities of the eigenvalue 1 of T_2, T_3, T_4. import numpy as np, itertools from scipy.optimize import minimize_scalar I=1j; F2=np.array([[1,1],[1,-1]],complex) def mob(X,s): a,b=X[0,1]**2,X[0,0]**2; return (a*s-b)/(np.conj(b)*s-np.conj(a)) def mobinv(X,t): a,b=X[0,1]**2,X[0,0]**2; return (np.conj(a)*t-b)/(np.conj(b)*t-a) def karlsson(t,f,s,use=None): L=np.array([[np.cos(t),np.exp(I*f)*np.sin(t)],[np.exp(-I*f)*np.sin(t),-np.cos(t)]]) Om=-0.5*np.eye(2)+I*np.sqrt(3)/2*L; A=F2@Om; B=-F2-A s1=np.exp(2*I*s); s3=mob(A,s1); s4=mob(B,s1) if use is None: use='A' if abs(abs(A[0,0])-abs(A[0,1]))>abs(abs(B[0,0])-abs(B[0,1])) else 'B' s2=mobinv(A,s4) if use=='A' else mobinv(B,s3) z=[1,np.exp(I*s)]+[np.sqrt(x) for x in (s2,s3,s4)]; D=lambda u: np.diag([1,u]) X=[np.eye(2),0.5*F2@D(z[3])@F2,0.5*F2@D(z[4])@F2]; Y=[F2,D(z[1])@F2,D(z[2])@F2] return np.block([[X[i]@np.linalg.matrix_power(Om,(i*j)%3)@Y[j] for j in range(3)] for i in range(3)]) def A(z): return np.array([[1,1,1,1,1,1],[1,-1,I,I,-I,-I],[1,I,-1,-I,z,-z],[1,I,-I,-1,-z,z],[1,-I,1/z,-1/z,I,-1],[1,-I,-1/z,1/z,-1,I]]) def err(H): return max(abs(abs(H)-1).max(),abs(H@H.conj().T-6*np.eye(6)).max()) def pairings(s): if not s: yield []; return for b in s[1:]: for p in pairings([x for x in s if x not in (s[0],b)]): yield [(s[0],b)]+p def blockpairings(H): return sum(all(abs(H[i,a]*np.conj(H[j,a])+H[i,b]*np.conj(H[j,b]))<1e-9 for (i,j) in P for (a,b) in Q) for P in pairings(list(range(6))) for Q in pairings(list(range(6)))) def haag(H,M=12): v=np.einsum('ij,kj,kl,il->ijkl',H,H.conj(),H,H.conj()).ravel(); return np.array([np.mean(v**m) for m in range(1,M+1)]) def c(H,k): W=np.array(list(itertools.product(range(6),repeat=k))); M=np.ones((6**k,6**k),complex) for j in range(k): M*=np.conj(H[W[:,j][:,None],W[:,j][None,:]])*H[W[:,(j+1)%k][:,None],W[:,j][None,:]] T=M@M.conj().T/6**(k+1); return int((np.linalg.eigvalsh((T+T.conj().T)/2)>1-1e-8).sum()) rng=np.random.default_rng(1) e=max(max(err(karlsson(*p,use='A')),err(karlsson(*p,use='B'))) for p in rng.uniform(0,np.pi,(2000,3))) print("2000 random parameters, both formulas: Hadamard up to %.1e"%e) for z in (1,np.exp(0.7j),np.exp(2.1j)): print("A(z) at z = %s: Hadamard up to %.1e, %d decompositions into Hadamard 2x2 blocks"%(np.round(z,4),err(A(z)),blockpairings(A(z)))) ts=np.arccos(1/np.sqrt(3)) for s in np.linspace(0,np.pi/2,4): H=karlsson(ts,np.pi/4,s); v=np.einsum('ij,kj,kl,il->ijkl',H,H.conj(),H,H.conj()).ravel() g=lambda u: abs(haag(A(np.exp(I*u)))-haag(H)).max() u0=min(np.linspace(0,2*np.pi,4001),key=g); r=minimize_scalar(g,bounds=(u0-2e-3,u0+2e-3),method='bounded',options={'xatol':1e-13}) d=(r.fun,r.x) print("curve at s = %.4f: Hadamard up to %.1e, distance of the Haagerup invariants to the 4th roots %.1e, closest A(e^{iu}) at u = %.4f, moment distance %.1e"%(s,err(H),np.abs(v[:,None]-np.array([1,I,-1,-I])[None,:]).min(1).max(),d[1],d[0])) H0=karlsson(ts,np.pi/4,0,use='B'); h0=haag(H0) for r in (1e-2,1e-3,1e-4): print("radius %.0e around the BH(6,4) point: Haagerup moments move by %.1e"%(r,max(abs(haag(karlsson(*(np.array([ts,np.pi/4,0])+r*rng.standard_normal(3)),use='B'))-h0).max() for _ in range(20)))) print("BH(6,4) point: c_2, c_3, c_4 =",c(H0,2),c(H0,3),c(H0,4)) for _ in range(2): p=rng.uniform(0,np.pi,3); print("random parameters (%.3f, %.3f, %.3f): c_2, c_3, c_4 ="%tuple(p),c(karlsson(*p),2),c(karlsson(*p),3),c(karlsson(*p),4))