[2]:
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
import sympy as sp
import numpy as np
import itertools as it
import pysymmpol as sy
import pysymmpol.utils as ut
from IPython.display import display, Latex
Characters (utils)
One useful function defined in the utils module is the character(young: YoungDiagram , conjugacy: ConjugacyClass), that as the name suggests, gives the character
\[\chi_{\lambda}(\vec{k})\]
of the symmetric group \(\mathfrak{S}_N\) in the representation \(\lambda\) and conjugacy class \(C(\vec{k})\). The nice point about the State class is that we can build the character table for any given integer.
[3]:
# Let's define the function character_table:
def character_table(n):
'''
Gives the table of characters for the level n.
'''
chi = sp.Symbol(f'chi')
states = sy.State(n)
partitions = states.partition_states()
conjugacy = states.conjugacy_states()
for a in partitions:
yg = sy.YoungDiagram(a)
display(Latex(r'$\chi$'), yg.partition)
for b in conjugacy:
cj = sy.ConjugacyClass(b)
if ut.character(yg, cj) >= 0:
print(f"{4*' '}{b}: {' '}{ut.character(yg, cj)}")
else:
print(f"{4*' '}{b}: {ut.character(yg, cj)}")
[6]:
n = 2
character_table(n)
$\chi$
(1, 1)
{1: 2, 2: 0}: 1
{1: 0, 2: 1}: -1
$\chi$
(2, 0)
{1: 2, 2: 0}: 1
{1: 0, 2: 1}: 1
[ ]: