Bases: sage.combinat.sf.classical.SymmetricFunctionAlgebra_classical
A class for methods related to monomial symmetric functions
INPUT:
TESTS:
sage: m = SymmetricFunctions(QQ).m()
sage: m == loads(dumps(m))
True
sage: TestSuite(m).run(skip=['_test_associativity', '_test_distributivity', '_test_prod'])
sage: TestSuite(m).run(elements = [m[1,1]+m[2], m[1]+2*m[1,1]])
Bases: sage.combinat.sf.classical.SymmetricFunctionAlgebra_classical.Element
Create a combinatorial module element. This should never be called directly, but only through the parent combinatorial free module’s __call__() method.
TESTS:
sage: F = CombinatorialFreeModule(QQ, ['a','b','c'])
sage: B = F.basis()
sage: f = B['a'] + 3*B['c']; f
B['a'] + 3*B['c']
sage: f == loads(dumps(f))
True
Expands the symmetric function as a symmetric polynomial in variables.
INPUT:
OUTPUT: a monomial expansion of an instance of self in variables
EXAMPLES:
sage: m = SymmetricFunctions(QQ).m()
sage: m([2,1]).expand(3)
x0^2*x1 + x0*x1^2 + x0^2*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2
sage: m([1,1,1]).expand(2)
0
sage: m([2,1]).expand(3,alphabet='z')
z0^2*z1 + z0*z1^2 + z0^2*z2 + z1^2*z2 + z0*z2^2 + z1*z2^2
sage: m([2,1]).expand(3,alphabet='x,y,z')
x^2*y + x*y^2 + x^2*z + y^2*z + x*z^2 + y*z^2
Returns the symmetric function in the monomial basis corresponding to the polynomial f.
INPUT:
OUTPUT:
EXAMPLES:
sage: m = SymmetricFunctions(QQ).m()
sage: P = PolynomialRing(QQ, 'x', 3)
sage: x = P.gens()
sage: f = x[0] + x[1] + x[2]
sage: m.from_polynomial(f)
m[1]
sage: f = x[0]**2+x[1]**2+x[2]**2
sage: m.from_polynomial(f)
m[2]
sage: f=x[0]^2+x[1]
sage: m.from_polynomial(f)
Traceback (most recent call last):
...
ValueError: x0^2 + x1 is not a symmetric polynomial
sage: f = (m[2,1]+m[1,1]).expand(3)
sage: m.from_polynomial(f)
m[1, 1] + m[2, 1]
sage: f = (2*m[2,1]+m[1,1]+3*m[3]).expand(3)
sage: m.from_polynomial(f)
m[1, 1] + 2*m[2, 1] + 3*m[3]
Conversion from polynomial in exponential notation
INPUT:
OUTPUT:
EXAMPLES:
sage: m = SymmetricFunctions(QQ).m()
sage: P = PolynomialRing(QQ,'x',5)
sage: x = P.gens()
The exponential notation of the partition is:
sage: Partition([5,5,5,3,1,1]).to_exp()
[2, 0, 1, 0, 3]
Therefore, the monomial:
sage: f = x[0]^2 * x[2] * x[4]^3
is mapped to:
sage: m.from_polynomial_exp(f)
m[5, 5, 5, 3, 1, 1]
Furthermore, this function is linear:
sage: f = 3 * x[3] + 2 * x[0]^2 * x[2] * x[4]^3
sage: m.from_polynomial_exp(f)
3*m[4] + 2*m[5, 5, 5, 3, 1, 1]
..SEEALSO:: Partition(), Partition.to_exp()