def test_skew_semistandard_setvalued(): n = 2 mu = (2, ) nu = (1, ) tabs = Tableau.semistandard_setvalued(n, mu, nu) print(sorted(tabs)) assert tabs == { Tableau({(1, 2): 1}), Tableau({(1, 2): 2}), Tableau({(1, 2): (1, 2)}) } n = 2 mu = (1, 1) nu = (1, ) tabs = Tableau.semistandard_setvalued(n, mu, nu) print(sorted(tabs)) assert tabs == { Tableau({(2, 1): 1}), Tableau({(2, 1): 2}), Tableau({(2, 1): (1, 2)}) }
def test_tableaux(): # generate tableaux and reverse plane partitions from tableaux import Tableau mu = (4, 2, 1) a = Tableau.semistandard(3, mu) b = Tableau.semistandard_setvalued(3, mu) c = Tableau.semistandard_shifted(3, mu, diagonal_primes=True) d = Tableau.semistandard_shifted_setvalued(4, mu, diagonal_primes=False) e = Tableau.semistandard_rpp(3, mu) f = Tableau.semistandard_shifted_rpp(3, mu, diagonal_nonprimes=False) # serialize to change a Tableau into a dictionary s = [t.serialize() for t in c]
def test_semistandard_setvalued(): mu = () assert Tableau.semistandard_setvalued(0, mu) == {Tableau()} assert Tableau.semistandard_setvalued(1, mu) == {Tableau()} assert Tableau.semistandard_setvalued(2, mu) == {Tableau()} mu = (1, ) assert Tableau.semistandard_setvalued(1, mu) == {Tableau({(1, 1): 1})} assert Tableau.semistandard_setvalued(2, mu) == { Tableau({(1, 1): 1}), Tableau({(1, 1): 2}), Tableau({(1, 1): (1, 2)}) } mu = (1, 1) assert Tableau.semistandard_setvalued( 2, mu) == {Tableau({ (1, 1): 1, (2, 1): 2 })} mu = (2, ) assert Tableau.semistandard_setvalued(2, mu) == { Tableau({ (1, 1): 1, (1, 2): 1 }), Tableau({ (1, 1): 1, (1, 2): 2 }), Tableau({ (1, 1): 2, (1, 2): 2 }), Tableau({ (1, 1): 1, (1, 2): (1, 2) }), Tableau({ (1, 1): (1, 2), (1, 2): 2 }), }
def _slow_stable_grothendieck(cls, num_variables, mu, nu=()): return BETA**(sum(nu) - sum(mu)) * cls._slow_vectorize( num_variables, Tableau.semistandard_setvalued( num_variables, mu, nu), BETA)