# crystal.py -- checks that for the generic Dita deformations of F_2 x F_3 and F_2 x F_4, the dimensions c_k = dim P_k are # half the numbers of closed walks of length k on the kagome lattice, respectively pyrochlore lattice, with 2 loops added at # each vertex. The lattices are built in real space, as line graphs of patches of the honeycomb and diamond lattices, the # walks are counted from a central vertex, and the result is compared with the Bloch integral of Tr((Z^*Z)^k) over the # dephased torus, from the blowup theorem, and with c_k computed directly, as multiplicity of the eigenvalue 1 of T_k. import numpy as np, itertools from scipy.sparse import lil_matrix, identity rng=np.random.default_rng(0) def dita(Q,M,N): return np.array([[np.exp(2j*np.pi*(i*j/M+a*b/N))*Q[i,b] for j in range(M) for b in range(N)] for i in range(M) for a in range(N)]) def c(H,k): n=len(H); W=np.array(list(itertools.product(range(n),repeat=k))); A=np.ones((n**k,n**k),complex) for j in range(k): A*=np.conj(H[W[:,j][:,None],W[:,j][None,:]])*H[W[:,(j+1)%k][:,None],W[:,j][None,:]] T=A@A.conj().T/n**(k+1); return int((np.linalg.eigvalsh((T+T.conj().T)/2)>1-1e-8).sum()) def linegraph_walks(d,R,K): # bipartite lattice with A-sites at Z^d and B-sites at Z^d, A(n) joined to B(n) and to B(n-e_i), i=1..d cells=list(itertools.product(range(-R,R+1),repeat=d)); edges=[] for n in cells: for i in range(d+1): m=n if i==0 else tuple(n[t]-(t==i-1) for t in range(d)); edges.append((('A',n),('B',m))) idx={e:t for t,e in enumerate(edges)}; at={} for e in edges: for v in e: at.setdefault(v,[]).append(idx[e]) L=lil_matrix((len(edges),len(edges))) for es in at.values(): for x in es: for y in es: if x!=y: L[x,y]+=1 L=(L+2*identity(len(edges))).tocsr(); v=np.zeros(len(edges)); v[idx[(('A',(0,)*d),('B',(0,)*d))]]=1; out=[] w=v.copy() for k in range(1,K+1): w=L@w; out.append(int(round(w@v))) return out def bloch(N,K,steps): g=np.linspace(0,2*np.pi,steps,endpoint=False); mom=np.zeros(K) for t in itertools.product(g,repeat=N-1): Z=np.array([[1]*N,[1]+[np.exp(1j*x) for x in t]]); ev=np.linalg.eigvalsh(Z.conj().T@Z) mom+=np.array([np.sum(ev**m) for m in range(1,K+1)]) return mom/steps**(N-1)/N for N,K,R,steps,kd in [(3,9,6,120,4),(4,7,5,24,3)]: name={3:"kagome",4:"pyrochlore"}[N] walks=linegraph_walks(N-1,R,K) print("%s, closed walks with 2 loops per vertex, k=1..%d:"%(name,K),walks) print(" half of them:",[w/2 for w in walks]) print(" Bloch integral of Tr((Z^*Z)^k)/N, halved:",[round(float(x),6) for x in bloch(N,K,steps)/2]) H=dita(np.exp(2j*np.pi*rng.random((2,N))),2,N) print(" direct c_k for a random generic F_2 x_Q F_%d, k=1..%d:"%(N,kd),[c(H,k) for k in range(1,kd+1)])