# symplectic.py # The symplectic groups, with the signs coming from the odd vectors. # For N even we take the map J(e_1) = e_2, J(e_2) = -e_1, and so on, and for a pairing pi # of k points we let xi_pi be the tensor product of copies of omega = sum_i e_i x J(e_i), # positioned on the strings of pi, multiplied by (-1)^c, with c being the number of crossings. # We check that: # (1) these vectors are fixed by the k-th tensor power of a random element of Sp_N, # (2) their Gram matrix is (-1)^(k/2) (-N)^loops, with loops being the number of blocks of # the supremum of the 2 pairings, as in the work of Collins and Sniady, # (3) the product over the 3 pairings of 4 points is negative, so that no # choice of signs can produce the Gram matrix N^loops of the orthogonal group, # (4) for N = 2 the 3 pairings of 4 points span a space of dimension 2, # (5) a noncrossing pairing joins odd points to even points, so it defines a permutation # of k/2 points, and with the signature of this permutation as sign, the Gram matrix # of the vectors coming from the noncrossing pairings becomes N^loops. import itertools import numpy as np from partitions import set_partitions, is_pairing, is_noncrossing, blocks def J_matrix(N): J = np.zeros((N, N)) for a in range(0, N, 2): J[a + 1, a] = 1 J[a, a + 1] = -1 return J def crossings(pairs): c = 0 for (a, b), (x, y) in itertools.combinations(pairs, 2): if a < x < b < y or x < a < y < b: c += 1 return c def xi(p, N, J): k = len(p) pairs = [tuple(b) for b in blocks(p)] v = np.zeros((N,) * k) for idx in itertools.product(range(N), repeat=k): c = 1 for (a, b) in pairs: c *= J[idx[b], idx[a]] # coefficient of e_i x e_j in omega v[idx] = c return (-1) ** crossings(pairs) * v.reshape(-1) def loops(p, q): # number of blocks of the supremum of 2 partitions parent = list(range(len(p))) def find(x): while parent[x] != x: x = parent[x] return x for part in (p, q): for b in blocks(part): for x in b[1:]: parent[find(x)] = find(b[0]) return len({find(x) for x in range(len(p))}) def permutation_sign(p): # the points are 0,...,k-1, and a noncrossing pairing joins the points of different parity image = {} for (a, b) in [tuple(b) for b in blocks(p)]: assert (a + b) % 2 == 1 even, odd = (a, b) if a % 2 == 0 else (b, a) image[even // 2] = odd // 2 s, seen = 1, set() for x in image: length = 0 while x not in seen: seen.add(x) x = image[x] length += 1 if length > 0 and length % 2 == 0: s = -s return s def random_symplectic(N, J, rng): Y = rng.normal(size=(N, N)) + 1j * rng.normal(size=(N, N)) Y = Y - Y.conj().T X = Y + J @ Y.conj() @ J.T w, V = np.linalg.eigh(-1j * X) U = V @ np.diag(np.exp(1j * w)) @ V.conj().T assert np.allclose(U, J @ U.conj() @ J.T) and np.allclose(U @ U.conj().T, np.eye(N)) return U def main(): rng = np.random.default_rng(1) good = True for N, k in ((2, 2), (2, 4), (2, 6), (4, 2), (4, 4), (4, 6)): J = J_matrix(N) P = [p for p in set_partitions(k) if is_pairing(p)] V = [xi(p, N, J) for p in P] U = random_symplectic(N, J, rng) Uk = np.array([[1]], dtype=complex) for _ in range(k): Uk = np.kron(Uk, U) fixed = all(np.allclose(Uk @ v, v) for v in V) gram = np.array([[np.dot(v, w) for w in V] for v in V]) formula = np.array([[(-1) ** (k // 2) * (-N) ** loops(p, q) for q in P] for p in P]) ok = fixed and np.allclose(gram, formula) print('N = %d , k = %d , pairings %2d , fixed vectors %s , Gram matrix (-1)^(k/2) (-N)^loops %s , rank %d' % (N, k, len(P), fixed, np.allclose(gram, formula), np.linalg.matrix_rank(gram))) good = good and ok NC = [n for n, p in enumerate(P) if is_noncrossing(p)] s = [permutation_sign(P[n]) for n in NC] free = all(s[x] * s[y] * gram[NC[x], NC[y]] == N ** loops(P[NC[x]], P[NC[y]]) for x in range(len(NC)) for y in range(len(NC))) print(' noncrossing pairings %2d , Gram matrix N^loops after the sign change %s' % (len(NC), free)) good = good and free if k == 4: t = gram[0, 1] * gram[1, 2] * gram[2, 0] print(' product of the 3 scalar products of the pairings of 4 points: %d' % t) good = good and t < 0 if N == 2: good = good and np.linalg.matrix_rank(gram) == 2 print('all checks passed' if good else 'some checks failed') main()