<jupyter_start><jupyter_text>$\varphi_1,\dots$ are the irreps. Let $\rho$ be $\varphi_k$ input $\dim G$<jupyter_code>dim_G = 24<jupyter_output><empty_output><jupyter_text>input the character table M: first row ($i=0$) lists the numbers of elements in the conjugacy class $j$.The next rows give are the characters of the congugacy class $j$.So the first colunm is the characters of $1_G$ and therefore give us the dimension if the representation.<jupyter_code>M = Matrix([ [1, 6, 3, 8, 6], [1, 1, 1, 1, 1], [1, -1, 1, 1, -1],
             [2, 0, 2, -1, 0], [3, -1, -1, 0, 1], [3, 1, -1, 0, -1]])
M<jupyter_output><empty_output><jupyter_text>$\sum_{j\in\text{ conjugasy classes of }G} \mid \chi_\rho (j) \mid^2 \chi_{\varphi_i}(j)$ where $\rho=\varphi_k$<jupyter_code>def sum_in_lmbda(M, k, i):
    n = 0
    for j in range(0, M.cols):
        n += M[0, j] * M[i, j] * Abs(M[k, j]) **2
    return n<jupyter_output><empty_output><jupyter_text>$\lambda_{\varphi_i}^\rho = \frac{1}{\mid G \mid d_{\varphi_i}}\sum_{j\in\text{ conjugasy classes of }G} \mid \chi_\rho (j) \mid^2 \chi_{\varphi_i}(j)$ where $\rho=\varphi_k$<jupyter_code>def lmbda(M, k, i, dim_G):
    return sum_in_lmbda(M, k, i) / (dim_G * M[i, 0])<jupyter_output><empty_output><jupyter_text>$L^\rho = \{ \lambda_{\varphi_i}^\rho \}_i$ and $\rho = \varphi_k$ not including $i=1$ i.e. without $\lambda^\rho_{\varphi_1}$<jupyter_code>def L_rho(M, k, dim_G):
    l = [lmbda(M, k, i, dim_G) for i in range(2, M.rows)]
    print('L_rho:', [simplify(x) for x in l])
    return l<jupyter_output><empty_output><jupyter_text>$\gamma^{\varphi_k} = gap(\rho=\varphi_k) = 1 - \max_i\{L^{\rho}\}$<jupyter_code>def gamma_k(M, k, dim_G):
    return 1 - max(L_rho(M, k, dim_G))<jupyter_output><empty_output><jupyter_text>$\gamma = (\dots, \gamma^{\varphi_k} ,\dots)$<jupyter_code>def gamma(M, dim_G):
    return Matrix(M.rows - 1, 1, lambda k, _: gamma_k(M, k + 1, dim_G))
g = gamma(M, dim_G)
g
simplify(g)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19807983830217282, 'fraction_numerical': 0.025770591207680646, 'mean_word_length': 4.409836065573771, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '373132', 'license': 'MIT', 'n_tokens_mistral': 890, 'n_tokens_neox': 851, 'n_words': 209, 'path': 'Calculating gap from the character table - for example the group S_4.ipynb', 'repo_name': 'vika999/spectral_gap', 'size': '1979'}