Ejemplo n.º 1
0
def test_slow_dual_stable_grothendieck_pq():
    n = 3
    mu = (1, )
    g = SymmetricPolynomial._slow_dual_stable_grothendieck_p(n, mu)
    h = SymmetricPolynomial._slow_dual_stable_grothendieck_q(n, mu)
    print(g)
    print(h)
    print()
    assert g == SymmetricMonomial(n, (1, ))
    assert h == 2 * SymmetricMonomial(n, (1, ))

    n = 3
    mu = (2, )
    for t in Tableau.semistandard_marked_rpp(3, mu, diagonal_nonprimes=False):
        print(t)
    g = SymmetricPolynomial._slow_dual_stable_grothendieck_p(n, mu)
    print(g)
    assert g == \
        SymmetricPolynomial._slow_dual_stable_grothendieck(n, (1, 1)) + \
        SymmetricPolynomial._slow_dual_stable_grothendieck(n, (2,))

    n = 3
    mu = (2, 1)
    for t in Tableau.semistandard_marked_rpp(n, mu):
        print(t)
    g = SymmetricPolynomial._slow_dual_stable_grothendieck_p(n, mu)
    h = SymmetricPolynomial._slow_dual_stable_grothendieck_q(n, mu)
    print(g)
    print(h)
    print()
    assert g == -BETA * SymmetricMonomial(
        n,
        (1, 1)) + -BETA * SymmetricMonomial(n, (2, )) + 2 * SymmetricMonomial(
            n, (1, 1, 1)) + SymmetricMonomial(n, (2, 1))

    n = 5
    mu = (3, 2)
    g = SymmetricPolynomial._slow_dual_stable_grothendieck_p(n, mu)
    h = SymmetricPolynomial._slow_dual_stable_grothendieck_q(n, mu)

    n = 6
    mu = (3, 2, 1)
    assert SymmetricPolynomial._slow_dual_stable_grothendieck_p(n, mu) == \
        SymmetricPolynomial._slow_dual_stable_grothendieck(n, mu)
Ejemplo n.º 2
0
def test_slow_dual_stable_grothendieck():
    n = 3
    mu = (1, )
    g = SymmetricPolynomial._slow_dual_stable_grothendieck(n, mu)
    print(g)
    assert g == SymmetricMonomial(n, (1, ))

    n = 3
    mu = (2, )
    g = SymmetricPolynomial._slow_dual_stable_grothendieck(n, mu)
    print(g)
    assert g == SymmetricMonomial(n, (1, 1)) + SymmetricMonomial(n, (2, ))

    n = 3
    mu = (2, 1)
    for t in Tableau.semistandard_rpp(n, mu):
        print(t)
    g = SymmetricPolynomial._slow_dual_stable_grothendieck(n, mu)
    print(g)
    assert g == -BETA * SymmetricMonomial(
        n,
        (1, 1)) - BETA * SymmetricMonomial(n, (2, )) + 2 * SymmetricMonomial(
            n, (1, 1, 1)) + SymmetricMonomial(n, (2, 1))
Ejemplo n.º 3
0
def test_symmetric_functions():
    nn = 6
    for mu in Partition.all(nn):
        for nu in Partition.all(nn, strict=True):
            for n in range(nn):
                print(n, mu, nu)
                print()

                f = SymmetricPolynomial.schur(n, mu, nu)
                g = SymmetricPolynomial.stable_grothendieck(n, mu, nu)
                h = SymmetricPolynomial.dual_stable_grothendieck(n, mu, nu)

                fs = SymmetricPolynomial._slow_schur(n, mu, nu)
                gs = SymmetricPolynomial._slow_stable_grothendieck(n, mu, nu)
                hs = SymmetricPolynomial._slow_dual_stable_grothendieck(
                    n, mu, nu)

                if f != fs:
                    print(f)
                    print(fs)
                    print()
                if g != gs:
                    print(g)
                    print(gs)
                    print()
                if h != hs:
                    print(h)
                    print(hs)
                    print()
                    print()

                assert f == fs
                assert g == gs
                assert h == hs

                hh = SymmetricPolynomial.schur_s(n, mu, nu)
                kk = SymmetricPolynomial.stable_grothendieck_s(n, mu, nu)

                if mu == nu:
                    assert f == 1
                    assert g == 1
                    assert h == 1
                    assert fs == 1
                    assert gs == 1
                    assert hs == 1
                    assert hh == 1
                    assert kk == 1

                if not Partition.contains(mu, nu):
                    assert f == 0
                    assert g == 0
                    assert h == 0
                    assert fs == 0
                    assert gs == 0
                    assert hs == 0
                    assert hh == 0
                    assert kk == 0

                print(f)
                print(g)
                print()
                print(hh)
                print(kk)
                print()
                assert g.lowest_degree_terms() == f
                assert kk.lowest_degree_terms() == hh