# axioms.py # The categorical rules. A family of linear maps pi -> T(pi), indexed by the partitions # pi between k upper points and l lower points belonging to a category of partitions, # is subject to the following 3 rules, where eps = 1 or -1 is the parity: # (1) T(pi) x T(sigma) = T(pi sigma), horizontal concatenation, # (2) T(sigma) T(pi) = (eps N)^c T(pi over sigma), vertical concatenation, with c being # the number of closed blocks which appear in the middle, # (3) T(pi)* = eps^b T(pi*), with pi* being pi turned upside-down, and with b being the # number of blocks of pi which are contained in the upper row, or in the lower row. # We check these rules for the 4 families of maps T^{q,eps} of the paper: # (a) q = 1, eps = 1: the usual maps T_pi, for all the partitions, # (b) q = -1, eps = 1: the Schur-Weyl twists of these maps, for the partitions with # even blocks, # (c) q = 1, eps = -1: the symplectic maps, for the pairings. These are obtained by # putting the matrix J on the strings joining 2 points of the same row, and the # identity on the other strings, with a sign: one factor -1 for each crossing, and # one factor -1 for each string joining 2 upper points, # (d) q = -1, eps = -1: the twists of the symplectic maps, obtained by multiplying the # entries by (-1)^(n(i)+n(j)), where n(i) is the number of pairs of positions r < s # such that the pair of i_r is smaller than the pair of i_s, the indices being # grouped into the pairs {1,2}, {3,4}, and so on. # We also check that in (d) the sign with respect to (c) is the parity of the number of # crossings between strings of pi carrying indices from different pairs, and we check the # values on the identity and duality partitions. import itertools import numpy as np from partitions import set_partitions, kernel, blocks, is_even, is_pairing, T, number from twist import T_twisted def normal(labels): return kernel(labels) def tensor(pi, k, sigma, k2): l, l2 = len(pi) - k, len(sigma) - k2 s = [x + 100 for x in sigma] return normal(list(pi[:k]) + s[:k2] + list(pi[k:]) + s[k2:]), k + k2 def adjoint(pi, k): return normal(list(pi[k:]) + list(pi[:k])), len(pi) - k def compose(pi, k, sigma, l): # pi has k upper points and l lower points, sigma has l upper points and m lower points m = len(sigma) - l assert len(pi) - k == l nodes = [('a', x) for x in range(k)] + [('b', x) for x in range(l)] + [('c', x) for x in range(m)] parent = {x: x for x in nodes} def find(x): while parent[x] != x: x = parent[x] return x def union(x, y): parent[find(x)] = find(y) for blk in blocks(pi): pts = [('a', x) if x < k else ('b', x - k) for x in blk] for p in pts[1:]: union(pts[0], p) for blk in blocks(sigma): pts = [('b', x) if x < l else ('c', x - l) for x in blk] for p in pts[1:]: union(pts[0], p) outer = [find(('a', x)) for x in range(k)] + [find(('c', x)) for x in range(m)] middle = {find(('b', x)) for x in range(l)} loops = len(middle - set(outer)) return normal(outer), loops def row_blocks(pi, k): return sum(1 for blk in blocks(pi) if all(x < k for x in blk) or all(x >= k for x in blk)) 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 T_symplectic(pi, k, N): l = len(pi) - k J = J_matrix(N) pairs = [tuple(b) for b in blocks(pi)] # position on the circle: upper row from left to right, then lower row from right to left pos = lambda x: x if x < k else k + (k + l - 1 - x) cr = 0 for (a, b), (c, d) in itertools.combinations(pairs, 2): a, b = sorted((pos(a), pos(b))) c, d = sorted((pos(c), pos(d))) if a < c < b < d or c < a < d < b: cr += 1 upper = sum(1 for (a, b) in pairs if b < k) M = np.zeros((N ** l, N ** k)) for idx in itertools.product(range(N), repeat=k + l): c = 1 for (a, b) in pairs: if b < k or a >= k: c *= J[idx[b], idx[a]] else: c *= 1 if idx[a] == idx[b] else 0 if c == 0: break if c != 0: M[number(idx[k:], N), number(idx[:k], N)] = c return (-1) ** (cr + upper) * M def string_data(pi, k): l = len(pi) - k pairs = [tuple(b) for b in blocks(pi)] pos = lambda x: x if x < k else k + (k + l - 1 - x) return pairs, pos def pair_sign(word): c = sum(1 for r in range(len(word)) for s in range(r + 1, len(word)) if word[r] // 2 < word[s] // 2) return (-1) ** c def T_symplectic_twisted(pi, k, N): l = len(pi) - k M = T_symplectic(pi, k, N).copy() for idx in itertools.product(range(N), repeat=k + l): i, j = idx[:k], idx[k:] M[number(j, N), number(i, N)] *= pair_sign(i) * pair_sign(j) return M def crossing_rule(pi, k, N): # the twisted symplectic maps, computed with one factor -1 for each crossing between # strings carrying indices from different pairs l = len(pi) - k pairs, pos = string_data(pi, k) M = T_symplectic(pi, k, N).copy() for idx in itertools.product(range(N), repeat=k + l): c = 0 for (a, b), (x, y) in itertools.combinations(pairs, 2): a2, b2 = sorted((pos(a), pos(b))) x2, y2 = sorted((pos(x), pos(y))) if (a2 < x2 < b2 < y2 or x2 < a2 < y2 < b2) and idx[a] // 2 != idx[x] // 2: c += 1 M[number(idx[k:], N), number(idx[:k], N)] *= (-1) ** c return M def check(name, maps, family, N, eps, sizes): # family(n) lists the partitions of n points which are allowed good = True cache = {} def get(pi, k): if (pi, k) not in cache: cache[(pi, k)] = maps(pi, k, N) return cache[(pi, k)] count = 0 for k, l in sizes: for pi in family(k + l): A = get(pi, k) ps, ks = adjoint(pi, k) good = good and np.array_equal(A.T, eps ** row_blocks(pi, k) * get(ps, ks)) count += 1 for k2, l2 in sizes: if k + k2 + l + l2 <= 6: for sigma in family(k2 + l2): pt, kt = tensor(pi, k, sigma, k2) good = good and np.array_equal(np.kron(A, get(sigma, k2)), get(pt, kt)) count += 1 for l2, m in sizes: if l2 == l: for sigma in family(l + m): pc, c = compose(pi, k, sigma, l) good = good and np.array_equal(get(sigma, l) @ A, (eps * N) ** c * get(pc, k)) count += 1 print('%-32s N = %d , parity %2d , identities checked %6d : %s' % (name, N, eps, count, good)) return good def main(): good = True small = [(k, l) for k in range(4) for l in range(4) if k + l <= 4] every = lambda n: list(set_partitions(n)) even = lambda n: [p for p in set_partitions(n) if is_even(p)] pairings = lambda n: [p for p in set_partitions(n) if is_pairing(p)] good = check('usual maps, all partitions', T, every, 2, 1, small) and good good = check('usual maps, all partitions', T, every, 3, 1, small) and good good = check('Schur-Weyl twists, even blocks', T_twisted, even, 2, 1, small) and good good = check('Schur-Weyl twists, even blocks', T_twisted, even, 3, 1, small) and good medium = [(k, l) for k in range(5) for l in range(5) if k + l <= 6 and (k + l) % 2 == 0] good = check('symplectic maps, pairings', T_symplectic, pairings, 2, -1, medium) and good good = check('symplectic maps, pairings', T_symplectic, pairings, 4, -1, medium) and good good = check('twisted symplectic maps', T_symplectic_twisted, pairings, 4, -1, medium) and good rule = all(np.array_equal(T_symplectic_twisted(p, k, 4), crossing_rule(p, k, 4)) for (k, l) in medium for p in pairings(k + l)) print('twisted symplectic maps follow the crossing rule:', rule) good = good and rule # identity and duality partitions I, R = np.eye(4), np.eye(4).reshape(16, 1) J = J_matrix(4) omega = np.kron(np.eye(4), J) @ R flip = np.array([[1 if (a, b) == (d, c) else 0 for a in range(4) for b in range(4)] for c in range(4) for d in range(4)]) for name, maps in (('symplectic', T_symplectic), ('twisted symplectic', T_symplectic_twisted)): ok = np.array_equal(maps((0, 0), 1, 4), I) and np.array_equal(maps((0, 0), 0, 4), omega) and np.array_equal(maps((0, 0), 2, 4), -omega.T) print('%s maps on the identity, the cup and the cap: %s' % (name, ok)) good = good and ok X = T_symplectic_twisted((0, 1, 1, 0), 2, 4) beta = np.array([[1 if a // 2 == b // 2 else -1 for b in range(4)] for a in range(4)]) expected = -flip * np.array([[beta[a, b] for a in range(4) for b in range(4)] for c in range(16)]) ok = np.array_equal(X, expected) print('twisted symplectic crossing is - beta(a,b) times the flip:', ok) good = good and ok print('all checks passed' if good else 'some checks failed') if __name__ == '__main__': main()