1 | initial version |
I decided to finally write this myself! Posting here as an answer for anyone that is interested. I decided to use the built-in SemistandardSkewTableaux class instead of the SkewTableaux class as it seems that the latter does not have a ''.list()'' method. It would also be easy to modify this code to make it work on more general skew SSYT.
def des(T):
out = []
for i in range(1,T.size()):
if T.cells_containing(i)[0][0]<T.cells_containing(i+1)[0][0]:
out += [i]
return out
def maj(T):
return sum(des(T))
def majpol(lmbda,mu):
var('q')
out = 0
for T in SemistandardSkewTableaux([lmbda,mu],[1]*(sum(lmbda)-sum(mu))):
out += q**maj(T)
return out
So one can write for example
lmbda = [3,2]
mu = [1]
majpol(lmbda,mu)
which outputs
q^4 + q^3 + 2*q^2 + q