[1]:
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

Class: MonomialPolynomial

Now we turn our attention to the Monomial Symmetric Polynomials. In terms of implementation, they are defined via inheritance of the Hall-Littlewood defined below, but since they are more fundamental than the Hall-Littlewood polynomials, let us treat them here.

In terms of construction, we follow the logic of the previous classes.

[2]:
# We first define the partition and the Young diagram
part = (3,2)
yg = sy.YoungDiagram(part)
[3]:
# Then we call the class from the Young Diagram
mp = sy.MonomialPolynomial(yg)
[4]:
# Next we build the x coordinates
n = 2
x = ut.create_x_coord(n)
x
[4]:
(x1, x2)
[5]:
# The explicit expression is (factor and expand are sympy methods
mp.explicit(x).factor().expand()
[5]:
$\displaystyle x_{1}^{3} x_{2}^{2} + x_{1}^{2} x_{2}^{3}$
[6]:
# The explicit expression is (factor and expand are sympy methods
mp.explicit(x, True)
[6]:
$\displaystyle \operatorname{Poly}{\left( x_{1}^{3}x_{2}^{2} + x_{1}^{2}x_{2}^{3}, x_{1}, x_{2}, domain=\mathbb{Q} \right)}$
[7]:
# Next we build the x coordinates with n < len(part)
n = 1
x = ut.create_x_coord(n)
x
[7]:
(x1,)
[8]:
mp.explicit(x)
[8]:
0
[9]:
# Next we build the x coordinates with n > len(part)
n = 3
x = ut.create_x_coord(n)
x
[9]:
(x1, x2, x3)
[10]:
mp.explicit(x)
[10]:
$\displaystyle x_{1}^{3} x_{2}^{2} + x_{1}^{3} x_{3}^{2} + x_{1}^{2} x_{2}^{3} + x_{1}^{2} x_{3}^{3} + x_{2}^{3} x_{3}^{2} + x_{2}^{2} x_{3}^{3}$

We also have a getter for the partition associated to a given Monomial Symmetric Polynomial.

[11]:
mp.partition
[11]:
(3, 2)
[ ]: