""" freelatitude.py - companion to "No-go theorems for non-Kac quantum groups". The even moments of a coordinate u_ij of the free orthogonal quantum group O_N^+ (equivalently, of a coordinate of the free real sphere), computed in 2 ways: 1. Purely Kac: Weingarten integration over O_N^+. With all indices equal, h(u_11^{2k}) = sum over pi, sigma in NC_2(2k) of (G_N^{-1})_{pi,sigma}, where G_N(pi,sigma) = N^{number of loops of pi and sigma superimposed}. 2. The closed formula of Banica, Collins and Zinn-Justin, with q + 1/q = -N, -1 < q < 0, and W = sqrt(N+2) u_11: h(W^{2k}) = sum_{j=-k..k} binom(2k, k+j) F_j, F_j = (-1)^j q^{j-1} (1+q)^2 / ((1+q^{j-1})(1+q^{j+1})). This formula was obtained in their paper by modeling over SU_q(2), and recovered by purely Kac means in "The magic of free spheres". The 2 computations agree, as the output shows. Run: python3 freelatitude.py """ from fractions import Fraction from math import comb, sqrt import numpy as np def noncrossing_pairings(n): """All noncrossing pairings of {0,...,n-1}, as lists of pairs.""" if n == 0: return [[]] out = [] for m in range(1, n, 2): for inner in noncrossing_pairings(m - 1): for outer in noncrossing_pairings(n - m - 1): pairs = [(0, m)] pairs += [(a + 1, b + 1) for a, b in inner] pairs += [(a + m + 1, b + m + 1) for a, b in outer] out.append(pairs) return out def loops(p, s, n): """Number of blocks of the join of 2 pairings of n points.""" parent = list(range(n)) def find(x): while parent[x] != x: parent[x] = parent[parent[x]] x = parent[x] return x for a, b in p + s: ra, rb = find(a), find(b) if ra != rb: parent[ra] = rb return len({find(x) for x in range(n)}) def weingarten_moment(N, k): """h(u_11^{2k}) on O_N^+, exactly, as a Fraction.""" P = noncrossing_pairings(2 * k) m = len(P) G = [[Fraction(N) ** loops(P[a], P[b], 2 * k) for b in range(m)] for a in range(m)] # solve G x = 1 exactly (Gauss elimination over the rationals) A = [row[:] + [Fraction(1)] for row in G] for c in range(m): piv = next(r for r in range(c, m) if A[r][c] != 0) A[c], A[piv] = A[piv], A[c] for r in range(m): if r != c and A[r][c] != 0: f = A[r][c] / A[c][c] A[r] = [x - f * y for x, y in zip(A[r], A[c])] x = [A[r][m] / A[r][r] for r in range(m)] return sum(x) def bcz_moment(N, k): """h(u_11^{2k}) on O_N^+ from the closed formula, in floating point.""" q = (-N + sqrt(N * N - 4)) / 2 # q + 1/q = -N, -1 < q < 0 def F(j): return (-1) ** j * q ** (j - 1) * (1 + q) ** 2 / ((1 + q ** (j - 1)) * (1 + q ** (j + 1))) w = sum(comb(2 * k, k + j) * F(j) for j in range(-k, k + 1)) return w / (N + 2) ** k if __name__ == "__main__": print("Even moments h(u_11^{2k}) on O_N^+: Weingarten (exact) vs closed formula") for N in (3, 4, 5): print("N = %d" % N) for k in range(1, 6): exact = weingarten_moment(N, k) print(" k = %d %-28s = %.12f formula: %.12f" % (k, str(exact), float(exact), bcz_moment(N, k)))