# wreath.py # The group SU_2 wr S_m, with N = 2m, which is the classical version of the twisted # symplectic group. A decorated partition of k points is a pair (pi, nu), with pi being a # partition with even blocks, and nu being a pairing whose strings are contained in the # blocks of pi, and which is noncrossing inside each block. The associated vector has # coefficients (-1)^c(nu) prod J(i_y, i_x), over the strings {x < y} of nu, on the # multi-indices i whose pairs are constant on the blocks of pi, and 0 elsewhere, with # c(nu) being the number of crossings of nu. We check that: # (1) these vectors are fixed by SU_2 wr S_m, and their rank is the number of decorated # partitions having at most m blocks, which is the dimension of the fixed space, # (2) their Gram matrix is (-1)^(k/2) m^|pi v pi'| (-2)^|nu v nu'|, # (3) the determinant of this matrix is the product, over the partitions pi with even # blocks, of m(m-1)...(m-|pi|+1) to the power d = prod Catalan(|b|/2), times the # meander determinants at 2 of the blocks b, to the powers d / Catalan(|b|/2), # (4) the number of decorated partitions with at most m blocks is the k-th moment of the # main character, computed exactly, as the moment of a sum of independent semicircular # variables, indexed by the fixed points of a uniform permutation of m points, # (5) for m large this is the moment of a compound Poisson law with semicircular jumps, # whose cumulants are the Catalan numbers: the moments are 1, 5, 50, 819, 19467, ... # in even orders. # (6) each decorated partition contributes to the determinant with m(m-1)...(m-|pi|+1), # times the product of (d+1)/d over the strings of nu, d being the depth of the # string inside its block, and the product of these contributions is the determinant, # (7) the first coefficients of the recurrence x P_n = P_{n+1} + b_n P_{n-1} for the # orthogonal polynomials of the limiting law are 1, 4, 25/4, 1151/100, to be compared # with 1, 2, 3, 4 for the Gaussian law, and with 1, 3, 5, 8 for the Bessel law. import itertools from fractions import Fraction from math import comb, factorial import numpy as np from partitions import set_partitions, is_even, is_pairing, is_noncrossing, blocks, number from gram import loops, determinant, meander_formula, depths from classical import block_group def catalan(j): return comb(2 * j, j) // (j + 1) def decorated(k): # all pairs (pi, nu), as tuples of labels out = [] for pi in set_partitions(k): if not is_even(pi): continue choices = [] for b in blocks(pi): local = [q for q in set_partitions(len(b)) if is_pairing(q) and is_noncrossing(q)] choices.append([[(b[x], b[y]) for (x, y) in (tuple(s) for s in blocks(q))] for q in local]) for combo in itertools.product(*choices): nu = [0] * k for n, (x, y) in enumerate(s for part in combo for s in part): nu[x] = nu[y] = n out.append((pi, tuple(nu))) return out def crossings(nu): pairs = [tuple(b) for b in blocks(nu)] return sum(1 for (a, b), (x, y) in itertools.combinations(pairs, 2) if a < x < b < y or x < a < y < b) def vector(pi, nu, m): N, k = 2 * m, len(pi) J = np.zeros((N, N)) for a in range(0, N, 2): J[a + 1, a], J[a, a + 1] = 1, -1 pairs = [tuple(b) for b in blocks(nu)] sign = (-1) ** crossings(nu) v = np.zeros(N ** k) for labels in itertools.product(range(m), repeat=len(blocks(pi))): # indices: for each point, pair label of its block, and position 0 or 1 inside the pair lab = [labels[pi[x]] for x in range(k)] for pos in itertools.product(range(2), repeat=k): idx = [2 * lab[x] + pos[x] for x in range(k)] c = sign for (x, y) in pairs: c *= J[idx[y], idx[x]] if c == 0: break if c != 0: v[number(idx, N)] += c return v def character_moment(k, m): # exact k-th moment of the sum of f independent semicircular variables, with f being # the number of fixed points of a uniform permutation of m points def moment_of_sum(f): # moments of a sum of f independent variables with even moments Catalan mom = [Fraction(1)] + [Fraction(0)] * k for _ in range(f): new = [Fraction(0)] * (k + 1) for a in range(k + 1): for b in range(0, k + 1 - a, 2): new[a + b] += comb(a + b, b) * mom[a] * catalan(b // 2) mom = new return mom[k] derangements = [1, 0] for n in range(2, m + 1): derangements.append((n - 1) * (derangements[n - 1] + derangements[n - 2])) return sum(Fraction(comb(m, f) * derangements[m - f], factorial(m)) * moment_of_sum(f) for f in range(m + 1)) def determinant_formula(k, m): d = Fraction(1) for pi in set_partitions(k): if is_even(pi): B = blocks(pi) mult = 1 for b in B: mult *= catalan(len(b) // 2) falling = 1 for j in range(len(B)): falling *= (m - j) d *= Fraction(falling) ** mult for b in B: d *= meander_formula(len(b) // 2, 2) ** (mult // catalan(len(b) // 2)) return d def contribution(pi, nu, m): c = Fraction(1) B = blocks(pi) for j in range(len(B)): c *= m - j for b in B: position = {x: t for t, x in enumerate(b)} arches = [(position[x], position[y]) for (x, y) in [tuple(s) for s in blocks(nu)] if x in position] for d in depths(arches): c *= Fraction(d + 1, d) return c def moments(order, cumulant): # moments from the classical cumulants m = [Fraction(1)] for n in range(1, order + 1): m.append(sum(comb(n - 1, j - 1) * cumulant(j) * m[n - j] for j in range(1, n + 1))) return m def recurrence(m, length): # coefficients b_1, b_2, ... of the orthogonal polynomials of a symmetric law, # from its moments, by the Chebycheff algorithm old, cur, b = [Fraction(0)] * (2 * length + 2), list(m[:2 * length + 1]), [m[0]] for k in range(1, length + 1): new = [Fraction(0)] * (2 * length + 2) for l in range(k, 2 * length - k + 1): new[l] = cur[l + 1] - b[k - 1] * old[l] b.append(new[k] / cur[k - 1]) old, cur = cur, new return b[1:] def main(): rng = np.random.default_rng(1) good = True for k, m in ((2, 2), (4, 2), (4, 3), (6, 2), (6, 3)): D = decorated(k) V = np.array([vector(pi, nu, m) for (pi, nu) in D]) gens = block_group(2 * m, rng) fixed = True for g in gens: W = V.astype(complex).reshape((len(D),) + (2 * m,) * k) for axis in range(1, k + 1): W = np.moveaxis(np.tensordot(W, g, axes=([axis], [1])), -1, axis) fixed = fixed and np.allclose(W.reshape(len(D), -1), V) gram = np.rint(V @ V.T).astype(int) formula = np.array([[(-1) ** (k // 2) * m ** loops(p, p2) * (-2) ** loops(n, n2) for (p2, n2) in D] for (p, n) in D]) ok_gram = np.array_equal(gram, formula) rank = np.linalg.matrix_rank(V) count = sum(1 for (pi, nu) in D if len(blocks(pi)) <= m) ok_moment = character_moment(k, m) == count print('k = %d , m = %d , decorated partitions %2d , fixed %s , Gram formula %s , rank %2d , with at most m blocks %2d , exact moment %s' % (k, m, len(D), fixed, ok_gram, rank, count, ok_moment)) good = good and fixed and ok_gram and rank == count and ok_moment for k in (2, 4, 6): D = decorated(k) ok = True for m in range(k // 2, k // 2 + 4): G = [[(-1) ** (k // 2) * m ** loops(p, p2) * (-2) ** loops(n, n2) for (p2, n2) in D] for (p, n) in D] ok = ok and determinant(G) == determinant_formula(k, m) print('k = %d , determinant formula: %s' % (k, ok)) good = good and ok for k in (2, 4, 6): D = decorated(k) ok = True for m in range(k // 2, k // 2 + 3): product = Fraction(1) for (pi, nu) in D: product *= contribution(pi, nu, m) ok = ok and product == determinant_formula(k, m) print('k = %d , contributions: %s' % (k, ok)) good = good and ok limit = [] for k in (2, 4, 6, 8, 10): c = sum(np.prod([catalan(len(b) // 2) for b in blocks(pi)]) for pi in set_partitions(k) if is_even(pi)) limit.append(int(c)) good = good and character_moment(k, k // 2 + 1) == c print('moments of the limiting law, in even orders:', limit) poisson = moments(10, lambda j: Fraction(catalan(j // 2)) if j % 2 == 0 else Fraction(0)) good = good and [int(x) for x in poisson[2::2]] == limit b = recurrence(poisson, 4) print('recurrence coefficients of the limiting law:', ', '.join(str(x) for x in b)) good = good and b == [1, 4, Fraction(25, 4), Fraction(1151, 100)] gauss = recurrence(moments(10, lambda j: Fraction(1) if j == 2 else Fraction(0)), 4) bessel = recurrence(moments(10, lambda j: Fraction(1) if j % 2 == 0 else Fraction(0)), 4) print('Gaussian law:', ', '.join(str(x) for x in gauss), '; Bessel law:', ', '.join(str(x) for x in bessel)) good = good and gauss == [1, 2, 3, 4] and bessel == [1, 3, 5, 8] print('all checks passed' if good else 'some checks failed') if __name__ == '__main__': main()