AUTHORS:
sage: s = SymmetricFunctionAlgebra(QQ, basis='schur')
sage: e = SymmetricFunctionAlgebra(QQ, basis='elementary')
sage: f1 = s([2,1]); f1
s[2, 1]
sage: f2 = e(f1); f2
e[2, 1] - e[3]
sage: f1 == f2
True
sage: f1.expand(3, alphabet=['x','y','z'])
x^2*y + x*y^2 + x^2*z + 2*x*y*z + y^2*z + x*z^2 + y*z^2
sage: f2.expand(3, alphabet=['x','y','z'])
x^2*y + x*y^2 + x^2*z + 2*x*y*z + y^2*z + x*z^2 + y*z^2
sage: m = SFAMonomial(QQ)
sage: m([3,1])
m[3, 1]
sage: m(4)
4*m[]
sage: m([4])
m[4]
sage: 3*m([3,1])-1/2*m([4])
3*m[3, 1] - 1/2*m[4]
Code needs to be added to coerce symmetric polynomials into symmetric functions.
sage: p = SFAPower(QQ)
sage: m = p(3)
sage: m
3*p[]
sage: m.parent()
Symmetric Function Algebra over Rational Field, Power symmetric functions as basis
sage: m + p([3,2])
3*p[] + p[3, 2]
sage: s = SFASchur(QQ)
sage: h = SFAHomogeneous(QQ)
sage: P = SFAPower(QQ)
sage: e = SFAElementary(QQ)
sage: m = SFAMonomial(QQ)
sage: a = s([3,1])
sage: s(a)
s[3, 1]
sage: h(a)
h[3, 1] - h[4]
sage: p(a)
1/8*p[1, 1, 1, 1] + 1/4*p[2, 1, 1] - 1/8*p[2, 2] - 1/4*p[4]
sage: e(a)
e[2, 1, 1] - e[2, 2] - e[3, 1] + e[4]
sage: m(a)
3*m[1, 1, 1, 1] + 2*m[2, 1, 1] + m[2, 2] + m[3, 1]
sage: a.expand(4)
x0^3*x1 + x0^2*x1^2 + x0*x1^3 + x0^3*x2 + 2*x0^2*x1*x2 + 2*x0*x1^2*x2 + x1^3*x2 + x0^2*x2^2 + 2*x0*x1*x2^2 + x1^2*x2^2 + x0*x2^3 + x1*x2^3 + x0^3*x3 + 2*x0^2*x1*x3 + 2*x0*x1^2*x3 + x1^3*x3 + 2*x0^2*x2*x3 + 3*x0*x1*x2*x3 + 2*x1^2*x2*x3 + 2*x0*x2^2*x3 + 2*x1*x2^2*x3 + x2^3*x3 + x0^2*x3^2 + 2*x0*x1*x3^2 + x1^2*x3^2 + 2*x0*x2*x3^2 + 2*x1*x2*x3^2 + x2^2*x3^2 + x0*x3^3 + x1*x3^3 + x2*x3^3
sage: h(m([1]))
h[1]
sage: h( m([2]) +m([1,1]) )
h[2]
sage: h( m([3]) + m([2,1]) + m([1,1,1]) )
h[3]
sage: h( m([4]) + m([3,1]) + m([2,2]) + m([2,1,1]) + m([1,1,1,1]) )
h[4]
sage: k = 5
sage: h( sum([ m(part) for part in Partitions(k)]) )
h[5]
sage: k = 10
sage: h( sum([ m(part) for part in Partitions(k)]) )
h[10]
sage: P3 = Partitions(3)
sage: P3.list()
[[3], [2, 1], [1, 1, 1]]
sage: m = SFAMonomial(QQ)
sage: f = sum([m(p) for p in P3])
sage: m.get_print_style()
'lex'
sage: f
m[1, 1, 1] + m[2, 1] + m[3]
sage: m.set_print_style('length')
sage: f
m[3] + m[2, 1] + m[1, 1, 1]
sage: m.set_print_style('maximal_part')
sage: f
m[1, 1, 1] + m[2, 1] + m[3]
sage: m.set_print_style('lex')
sage: s = SFASchur(QQ)
sage: m = SFAMonomial(QQ)
sage: m([3])*s([2,1])
2*m[3, 1, 1, 1] + m[3, 2, 1] + 2*m[4, 1, 1] + m[4, 2] + m[5, 1]
sage: s(m([3])*s([2,1]))
s[2, 1, 1, 1, 1] - s[2, 2, 2] - s[3, 3] + s[5, 1]
sage: s(s([2,1])*m([3]))
s[2, 1, 1, 1, 1] - s[2, 2, 2] - s[3, 3] + s[5, 1]
sage: e = SFAElementary(QQ)
sage: e([4])*e([3])*e([1])
e[4, 3, 1]
sage: s = SFASchur(QQ)
sage: z = s([2,1]) + s([1,1,1])
sage: z.coefficient([2,1])
1
sage: z.length()
2
sage: z.support()
[[1, 1, 1], [2, 1]]
sage: z.degree()
3
Returns the symmetric function algebra over R with the elementary symmetric functions as the basis.
EXAMPLES:
sage: SFAElementary(QQ)
Symmetric Function Algebra over Rational Field, Elementary symmetric functions as basis
Returns the symmetric function algebra over R with the Homogeneous symmetric functions as the basis.
EXAMPLES:
sage: SFAHomogeneous(QQ)
Symmetric Function Algebra over Rational Field, Homogeneous symmetric functions as basis
Returns the symmetric function algebra over R with the monomial symmetric functions as the basis.
EXAMPLES:
sage: SFAMonomial(QQ)
Symmetric Function Algebra over Rational Field, Monomial symmetric functions as basis
Returns the symmetric function algebra over R with the power-sum symmetric functions as the basis.
EXAMPLES:
sage: SFAPower(QQ)
Symmetric Function Algebra over Rational Field, Power symmetric functions as basis
Returns the symmetric function algebra over R with the Schur symmetric functions as the basis.
EXAMPLES:
sage: SFASchur(QQ)
Symmetric Function Algebra over Rational Field, Schur symmetric functions as basis
Return the free algebra over the ring on
generators with given names.
INPUT:
OUTPUT: A SymmetricFunctionAlgebra
EXAMPLES:
sage: SymmetricFunctionAlgebra(QQ)
Symmetric Function Algebra over Rational Field, Schur symmetric functions as basis
sage: SymmetricFunctionAlgebra(QQ, basis='m')
Symmetric Function Algebra over Rational Field, Monomial symmetric functions as basis
sage: SymmetricFunctionAlgebra(QQ, basis='power')
Symmetric Function Algebra over Rational Field, Power symmetric functions as basis
Returns the outer plethysm of self with x.
By default, the degree one elements are the generators for the self’s base ring.
INPUT:
EXAMPLES:
sage: s = SFASchur(QQ)
sage: h = SFAHomogeneous(QQ)
sage: s ( h([3])( h([2]) ) )
s[2, 2, 2] + s[4, 2] + s[6]
sage: p = SFAPower(QQ)
sage: p([3])( s([2,1]) )
1/3*p[3, 3, 3] - 1/3*p[9]
sage: e = SFAElementary(QQ)
sage: e([3])( e([2]) )
e[3, 3] + e[4, 1, 1] - 2*e[4, 2] - e[5, 1] + e[6]
sage: R.<t> = QQ[]
sage: s = SFASchur(R);
sage: a = s([3])
sage: f = t*s([2])
sage: a(f)
t^3*s[2, 2, 2] + t^3*s[4, 2] + t^3*s[6]
sage: f(a)
t*s[4, 2] + t*s[6]
EXAMPLES:
sage: m = SFAMonomial(QQ)
sage: f = sum([m(p) for p in Partitions(3)])
sage: m.get_print_style()
'lex'
sage: f
m[1, 1, 1] + m[2, 1] + m[3]
sage: m.set_print_style('length')
sage: f
m[3] + m[2, 1] + m[1, 1, 1]
sage: m.set_print_style('maximal_part')
sage: f
m[1, 1, 1] + m[2, 1] + m[3]
sage: m.set_print_style('lex')
Expands the symmetric function as a symmetric polynomial in n variables.
EXAMPLES:
sage: p = SFAPower(QQ)
sage: a = p([2])+p([3])
sage: a._expand(lambda part: False, 3)
x0^3 + x1^3 + x2^3 + x0^2 + x1^2 + x2^2
sage: a._expand(lambda part: max(part)>2, 3)
x0^2 + x1^2 + x2^2
Returns the inner plethysm between and
.
INPUT:
EXAMPLES:
sage: p = SFAPower(QQ)
sage: _inner_plethysm_pk_g = p(0)._inner_plethysm_pk_g
sage: _inner_plethysm_pk_g(2, p([1,1,1]), {})
p[1, 1, 1] + 3*p[2, 1]
sage: _inner_plethysm_pk_g(5, p([2,2,1,1,1]), {})
p[2, 2, 1, 1, 1]
Returns the inner plethysm of p(nu) with another symmetric function p_x in the power-sum basis.
Note that the order of the arguments is somewhat strange in order to facilitate partial function application.
EXAMPLES:
sage: p = SFAPower(QQ)
sage: s = SFASchur(QQ)
sage: _inner_plethysm_pnu_g = p(0)._inner_plethysm_pnu_g
sage: _inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([2,1]))
6*p[1, 1, 1]
sage: _inner_plethysm_pnu_g( p([1,1,1]), {}, Partition([]))
1/6*p[1, 1, 1] + 1/2*p[2, 1] + 1/3*p[3]
sage: s(_)
s[3]
Returns True if and only if self has nonnegative coefficients in the basis s.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: a = s([2,1]) + s([3])
sage: a._is_positive(s)
True
sage: a = s([2,1]) - s([3])
sage: a._is_positive(s)
False
Returns a string representing the LaTeX version of self.
EXAMPLES:
sage: m = SFAMonomial(QQ)
sage: f = sum([m(p) for p in Partitions(3)])
sage: m.get_print_style()
'lex'
sage: latex(f) #indirect doctest
m_{1,1,1} + m_{2,1} + m_{3}
sage: m.set_print_style('length')
sage: latex(f)
m_{3} + m_{2,1} + m_{1,1,1}
sage: m.set_print_style('maximal_part')
sage: latex(f)
m_{1,1,1} + m_{2,1} + m_{3}
EXAMPLES:
sage: s = SFASchur(QQ)
sage: z = s([4]) + s([2,1]) + s([1,1,1]) + s([1]) + 3
sage: z.degree()
4
Returns the symmetric function obtained by taking the derivative of self with respect to the power-sum symmetric function p([1]) when the expansion of self in the power-sum basis is considered as a polynomial in p([1])’s.
EXAMPLES:
sage: p = SFAPower(QQ)
sage: a = p([1,1,1])
sage: a.derivative_with_respect_to_p1()
3*p[1, 1]
sage: a.derivative_with_respect_to_p1(1)
3*p[1, 1]
sage: a.derivative_with_respect_to_p1(2)
6*p[1]
sage: a.derivative_with_respect_to_p1(3)
6*p[]
sage: s = SFASchur(QQ)
sage: s([3]).derivative_with_respect_to_p1()
s[2]
sage: s([2,1]).derivative_with_respect_to_p1()
s[1, 1] + s[2]
sage: s([1,1,1]).derivative_with_respect_to_p1()
s[1, 1]
Expands the symmetric function as a symmetric polynomial in n variables.
EXAMPLES:
sage: J =JackPolynomialsJ(QQ, t=2)
sage: J([2,1]).expand(3)
4*x0^2*x1 + 4*x0*x1^2 + 4*x0^2*x2 + 6*x0*x1*x2 + 4*x1^2*x2 + 4*x0*x2^2 + 4*x1*x2^2
This is the vertex operator that generalizes Jing’s operator It is from: Hall-Littlewood Vertex Operators and Kostka Polynomials, Shimizono-Zabrocki, Proposition 5 It is a linear operator that raises the degree by sum(nu) This creation operator is a t-analogue of multiplication by s(nu)
INPUT:
EXAMPLES:
sage: s = SFASchur(QQ['t'])
sage: s([2]).hl_creation_operator([3,2])
s[3, 2, 2] + t*s[3, 3, 1] + t*s[4, 2, 1] + t^2*s[4, 3] + t^2*s[5, 2]
sage: HLQp = HallLittlewoodQp(QQ)
sage: HLQp(s([2]).hl_creation_operator([2]).hl_creation_operator([3]))
Qp[3, 2, 2]
sage: s([2,2]).hl_creation_operator([2,1])
t*s[2, 2, 2, 1] + t^2*s[3, 2, 1, 1] + t^2*s[3, 2, 2] + t^3*s[3, 3, 1] + t^3*s[4, 2, 1] + t^4*s[4, 3]
sage: s(1).hl_creation_operator([2,1,1])
s[2, 1, 1]
sage: s(0).hl_creation_operator([2,1,1])
0
sage: s([3,2]).hl_creation_operator([2,1,1])
(t^2-t)*s[2, 2, 2, 2, 1] + t^3*s[3, 2, 2, 1, 1] + (t^3-t^2)*s[3, 2, 2, 2] + t^3*s[3, 3, 1, 1, 1] + t^4*s[3, 3, 2, 1] + t^3*s[4, 2, 1, 1, 1] + t^4*s[4, 2, 2, 1] + 2*t^4*s[4, 3, 1, 1] + t^5*s[4, 3, 2] + t^5*s[4, 4, 1] + t^4*s[5, 2, 1, 1] + t^5*s[5, 3, 1]
Returns the inner plethysm of self with x.
The result of f.inner_plethysm(g) is linear in f and linear in
‘homogeneous pieces’ of g. So, to describe this function, we assume
without loss that f is some Schur function s(la) and g is a
homogeneous symmetric function of degree n. The function g can be
thought of as the character of an irreducible representation, rho,
of the symmetric group . Let N be the dimension of
this representation. If the number of parts of la is greater then
N, then f.inner_plethysm(g) = 0 by definition. Otherwise, we can
interpret f as the character of an irreducible
representation, call it
. Now
is an
representation
and, by definition, the character of this representation is
f.inner_plethysm(g).
REFERENCES:
EXAMPLES:
sage: s = SFASchur(QQ)
sage: p = SFAPower(QQ)
sage: h = SFAHomogeneous(QQ)
sage: s([2,1]).inner_plethysm(s([1,1,1]))
0
sage: h([2]).inner_plethysm(s([2,1]))
h[2, 1]
sage: s(_)
s[2, 1] + s[3]
sage: f = s([2,1]) + 2*s([3,1])
sage: f.itensor(f)
s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4]
sage: s( h([1,1]).inner_plethysm(f) )
s[1, 1, 1] + s[2, 1] + 4*s[2, 1, 1] + 4*s[2, 2] + s[3] + 4*s[3, 1] + 4*s[4]
sage: s([]).inner_plethysm(s([1,1]) + 2*s([2,1])+s([3]))
s[2] + s[3]
sage: [s([]).inner_plethysm(s(p)) for p in Partitions(4)]
[s[4], s[4], s[4], s[4], s[4]]
Returns the inner tensor product of self and x in the basis of self.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: a = s([2,1])
sage: b = s([3])
sage: a.itensor(b)
s[2, 1]
sage: c = s([3,2,1])
sage: c.itensor(c)
s[1, 1, 1, 1, 1, 1] + 2*s[2, 1, 1, 1, 1] + 3*s[2, 2, 1, 1] + 2*s[2, 2, 2] + 4*s[3, 1, 1, 1] + 5*s[3, 2, 1] + 2*s[3, 3] + 4*s[4, 1, 1] + 3*s[4, 2] + 2*s[5, 1] + s[6]
TESTS:
sage: s = SFASchur(QQ)
sage: a = s([8,8])
sage: a.itensor(a) #long
s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16]
Returns the inner tensor product of self and x in the basis of self.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: a = s([2,1])
sage: b = s([3])
sage: a.itensor(b)
s[2, 1]
sage: c = s([3,2,1])
sage: c.itensor(c)
s[1, 1, 1, 1, 1, 1] + 2*s[2, 1, 1, 1, 1] + 3*s[2, 2, 1, 1] + 2*s[2, 2, 2] + 4*s[3, 1, 1, 1] + 5*s[3, 2, 1] + 2*s[3, 3] + 4*s[4, 1, 1] + 3*s[4, 2] + 2*s[5, 1] + s[6]
TESTS:
sage: s = SFASchur(QQ)
sage: a = s([8,8])
sage: a.itensor(a) #long
s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16]
Returns True if and only if self is Schur positive. If s is the space of Schur functions over self’s base ring, then this is the same as self._is_positive(s).
EXAMPLES:
sage: s = SFASchur(QQ)
sage: a = s([2,1]) + s([3])
sage: a.is_schur_positive()
True
sage: a = s([2,1]) - s([3])
sage: a.is_schur_positive()
False
sage: QQx = QQ['x']
sage: s = SFASchur(QQx)
sage: x = QQx.gen()
sage: a = (1+x)*s([2,1])
sage: a.is_schur_positive()
True
sage: a = (1-x)*s([2,1])
sage: a.is_schur_positive()
False
Returns the inner tensor product of self and x in the basis of self.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: a = s([2,1])
sage: b = s([3])
sage: a.itensor(b)
s[2, 1]
sage: c = s([3,2,1])
sage: c.itensor(c)
s[1, 1, 1, 1, 1, 1] + 2*s[2, 1, 1, 1, 1] + 3*s[2, 2, 1, 1] + 2*s[2, 2, 2] + 4*s[3, 1, 1, 1] + 5*s[3, 2, 1] + 2*s[3, 3] + 4*s[4, 1, 1] + 3*s[4, 2] + 2*s[5, 1] + s[6]
TESTS:
sage: s = SFASchur(QQ)
sage: a = s([8,8])
sage: a.itensor(a) #long
s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16]
Returns the inner tensor product of self and x in the basis of self.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: a = s([2,1])
sage: b = s([3])
sage: a.itensor(b)
s[2, 1]
sage: c = s([3,2,1])
sage: c.itensor(c)
s[1, 1, 1, 1, 1, 1] + 2*s[2, 1, 1, 1, 1] + 3*s[2, 2, 1, 1] + 2*s[2, 2, 2] + 4*s[3, 1, 1, 1] + 5*s[3, 2, 1] + 2*s[3, 3] + 4*s[4, 1, 1] + 3*s[4, 2] + 2*s[5, 1] + s[6]
TESTS:
sage: s = SFASchur(QQ)
sage: a = s([8,8])
sage: a.itensor(a) #long
s[4, 4, 4, 4] + s[5, 5, 3, 3] + s[5, 5, 5, 1] + s[6, 4, 4, 2] + s[6, 6, 2, 2] + s[6, 6, 4] + s[7, 3, 3, 3] + s[7, 5, 3, 1] + s[7, 7, 1, 1] + s[8, 4, 2, 2] + s[8, 4, 4] + s[8, 6, 2] + s[8, 8] + s[9, 3, 3, 1] + s[9, 5, 1, 1] + s[10, 2, 2, 2] + s[10, 4, 2] + s[10, 6] + s[11, 3, 1, 1] + s[12, 2, 2] + s[12, 4] + s[13, 1, 1, 1] + s[14, 2] + s[16]
Returns the image of self under the Frobenius / omega automorphism. The default implementation converts to the Schurs performs the automorphism and changes back.
EXAMPLES:
sage: J = JackPolynomialsP(QQ,1)
sage: a = J([2,1]) + J([1,1,1])
sage: a.omega()
JackP[2, 1] + JackP[3]
Returns the outer plethysm of self with x.
By default, the degree one elements are the generators for the self’s base ring.
INPUT:
EXAMPLES:
sage: s = SFASchur(QQ)
sage: h = SFAHomogeneous(QQ)
sage: s ( h([3])( h([2]) ) )
s[2, 2, 2] + s[4, 2] + s[6]
sage: p = SFAPower(QQ)
sage: p([3])( s([2,1]) )
1/3*p[3, 3, 3] - 1/3*p[9]
sage: e = SFAElementary(QQ)
sage: e([3])( e([2]) )
e[3, 3] + e[4, 1, 1] - 2*e[4, 2] - e[5, 1] + e[6]
sage: R.<t> = QQ[]
sage: s = SFASchur(R);
sage: a = s([3])
sage: f = t*s([2])
sage: a(f)
t^3*s[2, 2, 2] + t^3*s[4, 2] + t^3*s[6]
sage: f(a)
t*s[4, 2] + t*s[6]
EXAMPLES:
sage: s = SFASchur(QQ)
sage: z = s([4]) + s([2,1]) + s([1,1,1]) + s([1])
sage: z.restrict_degree(2)
0
sage: z.restrict_degree(1)
s[1]
sage: z.restrict_degree(3)
s[1, 1, 1] + s[2, 1]
sage: z.restrict_degree(3, exact=False)
s[1] + s[1, 1, 1] + s[2, 1]
EXAMPLES:
sage: s = SFASchur(QQ)
sage: z = s([4]) + s([2,1]) + s([1,1,1]) + s([1])
sage: z.restrict_partition_lengths(2)
s[2, 1]
sage: z.restrict_partition_lengths(2, exact=False)
s[1] + s[2, 1] + s[4]
EXAMPLES:
sage: s = SFASchur(QQ)
sage: z = s([4]) + s([2,1]) + s([1,1,1]) + s([1])
sage: z.restrict_parts(2)
s[1] + s[1, 1, 1] + s[2, 1]
sage: z.restrict_parts(1)
s[1] + s[1, 1, 1]
Returns standard scalar product between self and s.
This is the default implementation that converts both self and x into Schur functions and performs the scalar product that basis.
EXAMPLES:
sage: e = SFAElementary(QQ)
sage: h = SFAHomogeneous(QQ)
sage: m = SFAMonomial(QQ)
sage: p4 = Partitions(4)
sage: matrix([ [e(a).scalar(h(b)) for a in p4] for b in p4])
[ 0 0 0 0 1]
[ 0 0 0 1 4]
[ 0 0 1 2 6]
[ 0 1 2 5 12]
[ 1 4 6 12 24]
sage: matrix([ [h(a).scalar(e(b)) for a in p4] for b in p4])
[ 0 0 0 0 1]
[ 0 0 0 1 4]
[ 0 0 1 2 6]
[ 0 1 2 5 12]
[ 1 4 6 12 24]
sage: matrix([ [m(a).scalar(e(b)) for a in p4] for b in p4])
[-1 2 1 -3 1]
[ 0 1 0 -2 1]
[ 0 0 1 -2 1]
[ 0 0 0 -1 1]
[ 0 0 0 0 1]
sage: matrix([ [m(a).scalar(h(b)) for a in p4] for b in p4])
[1 0 0 0 0]
[0 1 0 0 0]
[0 0 1 0 0]
[0 0 0 1 0]
[0 0 0 0 1]
Returns the standard Hall-Littlewood scalar product of self and x.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: a = s([2,1])
sage: sp = a.scalar_t(a); sp
(-t^2 - 1)/(t^5 - 2*t^4 + t^3 - t^2 + 2*t - 1)
sage: sp.parent()
Fraction Field of Univariate Polynomial Ring in t over Rational Field
Returns the standard Hall-Littlewood scalar product of self and x.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: a = s([2,1])
sage: sp = a.scalar_t(a); sp
(-t^2 - 1)/(t^5 - 2*t^4 + t^3 - t^2 + 2*t - 1)
sage: sp.parent()
Fraction Field of Univariate Polynomial Ring in t over Rational Field
Returns the element whose result is the dual to multiplication by x applied to self.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: s([3,2]).skew_by(s([2]))
s[2, 1] + s[3]
sage: s([3,2]).skew_by(s([1,1,1]))
0
sage: s([3,2,1]).skew_by(s([2,1]))
s[1, 1, 1] + 2*s[2, 1] + s[3]
sage: p = SFAPower(QQ)
sage: p([4,3,3,2,2,1]).skew_by(p([2,1]))
4*p[4, 3, 3, 2]
sage: zee = sage.combinat.sf.sfa.zee
sage: zee([4,3,3,2,2,1])/zee([4,3,3,2])
4
Returns the image of self under the theta automorphism which sends
to
.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: s([2,1]).theta(2)
2*s[1, 1, 1] + 6*s[2, 1] + 2*s[3]
sage: p = SFAPower(QQ)
sage: p([2]).theta(2)
2*p[2]
Returns the image of self under the theta automorphism which sends
to
.
EXAMPLES:
sage: QQqt = QQ['q,t'].fraction_field()
sage: q,t = QQqt.gens()
sage: p = SFAPower(QQqt)
sage: p([2]).theta_qt(q,t)
((-q^2+1)/(-t^2+1))*p[2]
sage: p([2,1]).theta_qt(q,t)
((q^3-q^2-q+1)/(t^3-t^2-t+1))*p[2, 1]
INPUT:
-```` - y : a element of self
(basis elements) and returns an element of the target domain
EXAMPLES:
sage: s = SFASchur(QQ)
sage: a = s([2,1])+s([1,1,1])
sage: b = s([3])+s([2,1])
sage: f1 = lambda p1, p2: len(p1)*len(p2)
sage: f2 = lambda p1, p2: len(p1)+len(p2)
sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=False) #(2+3)*(2+1)
15
sage: s._apply_multi_module_morphism(a,b,f1,orthogonal=True) #(2)*(2)
4
sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=False) #2*(2+3+2+1)
16
sage: s._apply_multi_module_morphism(a,b,f2,orthogonal=True) #2+2
4
EXAMPLES:
sage: m = SFAMonomial(QQ)
sage: a = m([2,1])
sage: a.omega()
-m[2, 1] - 2*m[3]
sage: m._change_by_plethysm(-a,-1,[])
-m[2, 1] - 2*m[3]
sage: s = SFASchur(QQ)
sage: a = s([3])
sage: s._change_by_plethysm(-a,-1,[])
s[1, 1, 1]
Return the symmetric function obtained by scaling each basis element corresponding to the partition part by f(part).
INPUT: x: a symmetric function function: a function which takes in a partition and returns a scalar
OUTPUT: a symmetric function in self which is a scaled version of x
EXAMPLES:
sage: s = SFASchur(QQ)
sage: a = s([3])+s([2,1])+s([1,1,1]); a
s[1, 1, 1] + s[2, 1] + s[3]
sage: f = lambda part: len(part)
sage: s._change_by_proportionality(a, f)
3*s[1, 1, 1] + 2*s[2, 1] + s[3]
EXAMPLES:
sage: s = SFASchur(QQ)
sage: m = SFAMonomial(ZZ)
sage: s._coerce_impl(m([2,1]))
-2*s[1, 1, 1] + s[2, 1]
Return an element of self from .
INPUT:
EXAMPLES:
sage: R.<x> = QQ[]
sage: s = SFASchur(R)
sage: p21 = Partition([2,1])
sage: a = s(p21)
sage: e = SFAElementary(R)
sage: cache_dict = {}
sage: cache_dict[3] = {}
sage: cache_dict[3][p21] = {}
sage: cache_dict[3][p21][p21] = x^2
sage: cache_dict[3][p21][Partition([1,1,1])] = 3*x
sage: cache_function = lambda n: 0 #do nothing
sage: e._from_cache(a, cache_function, cache_dict)
3*x*e[1, 1, 1] + x^2*e[2, 1]
sage: e._from_cache(a, cache_function, cache_dict, x=2)
6*e[1, 1, 1] + 4*e[2, 1]
Return the element of self with the same ‘internal structure’ as x.
EXAMPLES:
sage: e = SFAElementary(QQ)
sage: s = SFASchur(QQ)
sage: a = e([2,1]) + e([1,1,1]); a
e[1, 1, 1] + e[2, 1]
sage: s._from_element(a)
s[1, 1, 1] + s[2, 1]
EXAMPLES:
sage: cache = {}
sage: from sage.combinat.sf.sfa import zee
sage: s = SFASchur(QQ)
sage: m = SFAMonomial(QQ)
sage: s._gram_schmidt(3, m, zee, cache)
sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]
sage: l(cache)
[([1, 1, 1], [([1, 1, 1], 1)]),
([2, 1], [([1, 1, 1], 2), ([2, 1], 1)]),
([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])]
Compute the inverse of a morphism between self and other. In order to use this, you must be able compute the morphism in one direction. This method assumes that the morphism is indeed invertible.
INPUT:
EXAMPLES: First, we will do an example of inverting the morphism which sends a Schur function to its conjugate Schur function. Note that this is an involution.
sage: s = SFASchur(QQ)
sage: conj = lambda p1: lambda p2: QQ(1) if p2 == p1.conjugate() else QQ(0)
sage: c1 = {}
sage: c2 = {}
sage: s._invert_morphism(4, QQ, c1, c2, to_other_function = conj)
sage: l = lambda c: [ (i[0],[j for j in sorted(i[1].items())]) for i in sorted(c.items())]
sage: l(c1[4])
[([1, 1, 1, 1], [([4], 1)]),
([2, 1, 1], [([3, 1], 1)]),
([2, 2], [([2, 2], 1)]),
([3, 1], [([2, 1, 1], 1)]),
([4], [([1, 1, 1, 1], 1)])]
sage: l(c2[4])
[([1, 1, 1, 1], [([4], 1)]),
([2, 1, 1], [([3, 1], 1)]),
([2, 2], [([2, 2], 1)]),
([3, 1], [([2, 1, 1], 1)]),
([4], [([1, 1, 1, 1], 1)])]
sage: c2 == c1
True
We can check that we get the same results if specify to_self_function = conj.
sage: d1 = {}
sage: d2 = {}
sage: s._invert_morphism(4, QQ, d1, d2, to_self_function = conj)
sage: d1 == c1
True
sage: d2 == c2
True
Now we do an example of upper triangularity and check that we get the same thing whether or not we specify ones_on_diagonal.
sage: f = lambda p1: lambda p2: QQ(1) if p2 <= p1 else QQ(0)
sage: c1 = {}
sage: c2 = {}
sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, upper_triangular=True)
sage: l(c1[3])
[([1, 1, 1], [([1, 1, 1], 1)]),
([2, 1], [([1, 1, 1], 1), ([2, 1], 1)]),
([3], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)])]
sage: l(c2[3])
[([1, 1, 1], [([1, 1, 1], 1)]),
([2, 1], [([1, 1, 1], -1), ([2, 1], 1)]),
([3], [([2, 1], -1), ([3], 1)])]
sage: d1 = {}
sage: d2 = {}
sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,upper_triangular=True, ones_on_diagonal=True)
sage: c1 == d1
True
sage: c2 == d2
True
Finally, we do the same thing for lower triangular matrices.
sage: f = lambda p1: lambda p2: QQ(1) if p2 >= p1 else QQ(0)
sage: c1 = {}
sage: c2 = {}
sage: s._invert_morphism(3, QQ, c1, c2, to_other_function = f, lower_triangular=True)
sage: l(c1[3])
[([1, 1, 1], [([1, 1, 1], 1), ([2, 1], 1), ([3], 1)]),
([2, 1], [([2, 1], 1), ([3], 1)]),
([3], [([3], 1)])]
sage: l(c2[3])
[([1, 1, 1], [([1, 1, 1], 1), ([2, 1], -1)]),
([2, 1], [([2, 1], 1), ([3], -1)]),
([3], [([3], 1)])]
sage: d1 = {}
sage: d2 = {}
sage: s._invert_morphism(3, QQ, d1, d2, to_other_function = f,lower_triangular=True, ones_on_diagonal=True)
sage: c1 == d1
True
sage: c2 == d2
True
Returns the name of the basis of self.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: s.basis_name()
'schur'
sage: p = SFAPower(QQ)
sage: p.basis_name()
'power'
sage: h = SFAHomogeneous(QQ)
sage: h.basis_name()
'homogeneous'
sage: e = SFAElementary(QQ)
sage: e.basis_name()
'elementary'
sage: m = SFAMonomial(QQ)
sage: m.basis_name()
'monomial'
Returns the dual basis of self with respect to the scalar product scalar. If scalar is None, then the standard (Hall) scalar product is used.
EXAMPLES: The duals of the elementary symmetric functions with respect to the Hall scalar product are the forgotten symmetric functions.
sage: e = SFAElementary(QQ)
sage: f = e.dual_basis(prefix='f'); f
Dual basis to Symmetric Function Algebra over Rational Field, Elementary symmetric functions as basis with respect to the Hall scalar product
sage: f([2,1])^2
4*f[2, 2, 1, 1] + 6*f[2, 2, 2] + 2*f[3, 2, 1] + 2*f[3, 3] + 2*f[4, 1, 1] + f[4, 2]
sage: f([2,1]).scalar(e([2,1]))
1
sage: f([2,1]).scalar(e([1,1,1]))
0
Since the power-sum symmetric functions are orthogonal, their duals with respect to the Hall scalar product are scalar multiples of themselves.
sage: p = SFAPower(QQ)
sage: q = p.dual_basis(prefix='q'); q
Dual basis to Symmetric Function Algebra over Rational Field, Power symmetric functions as basis with respect to the Hall scalar product
sage: q([2,1])^2
4*q[2, 2, 1, 1]
sage: p([2,1]).scalar(q([2,1]))
1
sage: p([2,1]).scalar(q([1,1,1]))
0
Returns the value of the current print style for self.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: s.get_print_style()
'lex'
sage: s.set_print_style('length')
sage: s.get_print_style()
'length'
sage: s.set_print_style('lex')
Returns the prefix on the elements of self.
EXAMPLES:
sage: schur = SFASchur(QQ)
sage: schur([3,2,1])
s[3, 2, 1]
sage: schur.prefix()
's'
Set the value of the current print style to ps.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: s.get_print_style()
'lex'
sage: s.set_print_style('length')
sage: s.get_print_style()
'length'
sage: s.set_print_style('lex')
Returns the transitions matrix between self and basis for the homogenous component of degree n.
EXAMPLES:
sage: s = SFASchur(QQ)
sage: m = SFAMonomial(QQ)
sage: s.transition_matrix(m,5)
[1 1 1 1 1 1 1]
[0 1 1 2 2 3 4]
[0 0 1 1 2 3 5]
[0 0 0 1 1 3 6]
[0 0 0 0 1 2 5]
[0 0 0 0 0 1 4]
[0 0 0 0 0 0 1]
sage: p = SFAPower(QQ)
sage: s.transition_matrix(p, 4)
[ 1/4 1/3 1/8 1/4 1/24]
[-1/4 0 -1/8 1/4 1/8]
[ 0 -1/3 1/4 0 1/12]
[ 1/4 0 -1/8 -1/4 1/8]
[-1/4 1/3 1/8 -1/4 1/24]
sage: StoP = s.transition_matrix(p,4)
sage: a = s([3,1])+5*s([1,1,1,1])-s([4])
sage: a
5*s[1, 1, 1, 1] + s[3, 1] - s[4]
sage: mon = a.support()
sage: coeffs = a.coefficients()
sage: coeffs
[5, 1, -1]
sage: mon
[[1, 1, 1, 1], [3, 1], [4]]
sage: cm = matrix([[-1,1,0,0,5]])
sage: cm * StoP
[-7/4 4/3 3/8 -5/4 7/24]
sage: p(a)
7/24*p[1, 1, 1, 1] - 5/4*p[2, 1, 1] + 3/8*p[2, 2] + 4/3*p[3, 1] - 7/4*p[4]
sage: h = SFAHomogeneous(QQ)
sage: e = SFAElementary(QQ)
sage: s.transition_matrix(m,7) == h.transition_matrix(s,7).transpose()
True
sage: h.transition_matrix(m, 7) == h.transition_matrix(m, 7).transpose()
True
sage: h.transition_matrix(e, 7) == e.transition_matrix(h, 7)
True
sage: p.transition_matrix(s, 5)
[ 1 -1 0 1 0 -1 1]
[ 1 0 -1 0 1 0 -1]
[ 1 -1 1 0 -1 1 -1]
[ 1 1 -1 0 -1 1 1]
[ 1 0 1 -2 1 0 1]
[ 1 2 1 0 -1 -2 -1]
[ 1 4 5 6 5 4 1]
sage: e.transition_matrix(m,7) == e.transition_matrix(m,7).transpose()
True
Returns the max of x[0] where x is a list. If x is the empty list, the _lmax returns 0.
EXAMPLES:
sage: from sage.combinat.sf.sfa import _lmax
sage: _lmax(([3,2,1], 2))
3
sage: _lmax(([],4))
0
Returns True if x has nonnegative coefficients.
EXAMPLES:
sage: from sage.combinat.sf.sfa import _nonnegative_coefficients
sage: _nonnegative_coefficients(2)
True
sage: _nonnegative_coefficients(-2)
False
sage: R.<x> = ZZ[]
sage: _nonnegative_coefficients(x^2+4)
True
sage: _nonnegative_coefficients(x^2-4)
False
Returns True if x is a symmetric function.
EXAMPLES:
sage: from sage.combinat.sf.sfa import is_SymmetricFunction
sage: s = SFASchur(QQ)
sage: is_SymmetricFunction(2)
False
sage: is_SymmetricFunction(s(2))
True
sage: is_SymmetricFunction(s([2,1]))
True
Return True if x is a symmetric function algebra; otherwise, return False.
EXAMPLES:
sage: sage.combinat.sf.sfa.is_SymmetricFunctionAlgebra(5)
False
sage: sage.combinat.sf.sfa.is_SymmetricFunctionAlgebra(ZZ)
False
sage: sage.combinat.sf.sfa.is_SymmetricFunctionAlgebra(SymmetricFunctionAlgebra(ZZ,'schur'))
True
Returns the size of the centralizer of permutations of cycle type part. Note that this is the inner product between p(part) and itself where p is the power-sum symmetric functions.
INPUT:
EXAMPLES:
sage: from sage.combinat.sf.sfa import zee
sage: zee([2,1,1])
4