REFERENCES:
[Ges] | I. Gessel, Multipartite P-partitions and inner products of skew Schur functions, Contemp. Math. 34 (1984), 289-301. http://people.brandeis.edu/~gessel/homepage/papers/multipartite.pdf |
[MR] | C. Malvenuto and C. Reutenauer, Duality between quasi-symmetric functions and the Solomon descent algebra, J. Algebra 177 (1995), no. 3, 967-982. http://www.mat.uniroma1.it/people/malvenuto/Duality.pdf |
[Reiner2013] | Victor Reiner, Hopf algebras in combinatorics, 17 January 2013. http://www.math.umn.edu/~reiner/Classes/HopfComb.pdf |
[Mal1993] | (1, 2, 3, 4, 5) Claudia Malvenuto, Produits et coproduits des fonctions quasi-symetriques et de l’algebre des descentes, thesis, November 1993. http://www1.mat.uniroma1.it/people/malvenuto/Thesis.pdf |
[Haz2004] | (1, 2, 3, 4) Michiel Hazewinkel, Explicit polynomial generators for the ring of quasisymmetric functions over the integers. Arxiv math/0410366v1 |
[Rad1979] | David E. Radford, A natural ring basis for the shuffle algebra and an application to group schemes, J. Algebra 58 (1979), 432-454. |
[NCSF1] | Israel Gelfand, D. Krob, Alain Lascoux, B. Leclerc, V. S. Retakh, J.-Y. Thibon, Noncommutative symmetric functions. Arxiv hep-th/9407124v1 |
[NCSF2] | D. Krob, B. Leclerc, J.-Y. Thibon, Noncommutative symmetric functions II: Transformations of alphabets. http://www-igm.univ-mlv.fr/~jyt/ARTICLES/NCSF2.ps |
[LMvW13] | (1, 2, 3, 4, 5, 6) Kurt Luoto, Stefan Mykytiuk and Stephanie van Willigenburg, An introduction to quasisymmetric Schur functions – Hopf algebras, quasisymmetric functions, and Young composition tableaux, May 23, 2013, Springer. http://www.math.ubc.ca/%7Esteph/papers/QuasiSchurBook.pdf |
AUTHOR:
Bases: sage.structure.unique_representation.UniqueRepresentation, sage.structure.parent.Parent
The Hopf algebra of quasisymmetric functions.
Let be a commutative ring with unity.
The
-algebra of quasi-symmetric functions may be realized as an
-subalgebra of the ring of power series in countably many
variables
. It consists of those
formal power series
which are degree-bounded (i. e., the degrees
of all monomials occuring with nonzero coefficient in
are bounded
from above, although the bound can depend on
) and satisfy the
following condition: For every tuple
of
positive integers, the coefficient of the monomial
in
is the same
for all strictly increasing sequences
of
positive integers. (In other words, the coefficient of a monomial in
depends only on the sequence of nonzero exponents in the monomial. If
“sequence” were to be replaced by “multiset” here, we would obtain
the definition of a symmetric function.)
The -algebra of quasi-symmetric functions is commonly called
or occasionally just
(when
is clear from the context or
or
). It is graded by
the total degree of the power series. Its homogeneous elements of degree
form a free
-submodule of rank equal to the number of
compositions of
(that is,
if
, else
).
The two classical bases of , the monomial basis
and the fundamental basis
, are indexed by
compositions
and defined by the
formulas:
and
where in the second equation the sum runs over all weakly increasing
-tuples
of positive integers
(where
is the size of
) which increase strictly from
to
if
is a descent of the composition
.
These bases are related by the formula
where the inequality indicates that
is finer than
.
The -algebra of quasi-symmetric functions is a Hopf algebra,
with the coproduct satisfying
for every composition .
It is possible to define an -algebra of quasi-symmetric
functions in a finite number of variables as well (but it is not
a bialgebra). These quasi-symmetric functions are actual polynomials
then, not just power series.
Chapter 5 of [Reiner2013] and Section 11 of [HazWitt1] are devoted to quasi-symmetric functions, as are Malvenuto’s thesis [Mal1993] and part of Chapter 7 of [Sta-EC2].
The implementation of the quasi-symmetric function Hopf algebra
We realize the -algebra of quasi-symmetric functions in Sage as
a graded Hopf algebra with basis elements indexed by compositions:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: QSym.category()
Join of Category of hopf algebras over Rational Field
and Category of graded algebras over Rational Field
and Category of monoids with realizations
and Category of coalgebras over Rational Field with realizations
The most standard two bases for this -algebra are the monomial and
fundamental bases, and are accessible by the M() and F() methods:
sage: M = QSym.M()
sage: F = QSym.F()
sage: M(F[2,1,2])
M[1, 1, 1, 1, 1] + M[1, 1, 1, 2] + M[2, 1, 1, 1] + M[2, 1, 2]
sage: F(M[2,1,2])
F[1, 1, 1, 1, 1] - F[1, 1, 1, 2] - F[2, 1, 1, 1] + F[2, 1, 2]
The product on this space is commutative and is inherited from the product on the realization within the ring of power series:
sage: M[3]*M[1,1] == M[1,1]*M[3]
True
sage: M[3]*M[1,1]
M[1, 1, 3] + M[1, 3, 1] + M[1, 4] + M[3, 1, 1] + M[4, 1]
sage: F[3]*F[1,1]
F[1, 1, 3] + F[1, 2, 2] + F[1, 3, 1] + F[1, 4] + F[2, 1, 2]
+ F[2, 2, 1] + F[2, 3] + F[3, 1, 1] + F[3, 2] + F[4, 1]
sage: M[3]*F[2]
M[1, 1, 3] + M[1, 3, 1] + M[1, 4] + M[2, 3] + M[3, 1, 1] + M[3, 2]
+ M[4, 1] + M[5]
sage: F[2]*M[3]
F[1, 1, 1, 2] - F[1, 2, 2] + F[2, 1, 1, 1] - F[2, 1, 2] - F[2, 2, 1]
+ F[5]
There is a coproduct on as well, which in the Monomial
basis acts by cutting the composition into a left half and a right
half. The coproduct is not co-commutative:
sage: M[1,3,1].coproduct()
M[] # M[1, 3, 1] + M[1] # M[3, 1] + M[1, 3] # M[1] + M[1, 3, 1] # M[]
sage: F[1,3,1].coproduct()
F[] # F[1, 3, 1] + F[1] # F[3, 1] + F[1, 1] # F[2, 1]
+ F[1, 2] # F[1, 1] + F[1, 3] # F[1] + F[1, 3, 1] # F[]
The duality pairing with non-commutative symmetric functions
These two operations endow the quasi-symmetric functions
with the structure of a Hopf algebra. It is the graded
dual Hopf algebra of the non-commutative symmetric functions
.
Under this duality, the Monomial basis of
is dual to
the Complete basis of
, and the Fundamental basis of
is dual to the Ribbon basis of
(see [MR]).
sage: S = M.dual(); S
Non-Commutative Symmetric Functions over the Rational Field in the Complete basis
sage: M[1,3,1].duality_pairing( S[1,3,1] )
1
sage: M.duality_pairing_matrix( S, degree=4 )
[1 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0]
[0 0 0 1 0 0 0 0]
[0 0 0 0 1 0 0 0]
[0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 1]
sage: F.duality_pairing_matrix( S, degree=4 )
[1 0 0 0 0 0 0 0]
[1 1 0 0 0 0 0 0]
[1 0 1 0 0 0 0 0]
[1 1 1 1 0 0 0 0]
[1 0 0 0 1 0 0 0]
[1 1 0 0 1 1 0 0]
[1 0 1 0 1 0 1 0]
[1 1 1 1 1 1 1 1]
sage: NCSF = M.realization_of().dual()
sage: R = NCSF.Ribbon()
sage: F.duality_pairing_matrix( R, degree=4 )
[1 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0]
[0 0 0 1 0 0 0 0]
[0 0 0 0 1 0 0 0]
[0 0 0 0 0 1 0 0]
[0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 1]
sage: M.duality_pairing_matrix( R, degree=4 )
[ 1 0 0 0 0 0 0 0]
[-1 1 0 0 0 0 0 0]
[-1 0 1 0 0 0 0 0]
[ 1 -1 -1 1 0 0 0 0]
[-1 0 0 0 1 0 0 0]
[ 1 -1 0 0 -1 1 0 0]
[ 1 0 -1 0 -1 0 1 0]
[-1 1 1 -1 1 -1 -1 1]
Let and
be elements of
, and
an element of
. Then, if we represent the duality pairing with the
mathematical notation
,
For example, the coefficient of M[2,1,4,1] in M[1,3]*M[2,1,1] may be computed with the duality pairing:
sage: I, J = Composition([1,3]), Composition([2,1,1])
sage: (M[I]*M[J]).duality_pairing(S[2,1,4,1])
1
And the coefficient of S[1,3] # S[2,1,1] in S[2,1,4,1].coproduct() is equal to this result:
sage: S[2,1,4,1].coproduct()
S[] # S[2, 1, 4, 1] + ... + S[1, 3] # S[2, 1, 1] + ... + S[4, 1] # S[2, 1]
The duality pairing on the tensor space is another way of getting this coefficient, but currently the method duality_pairing is not defined on the tensor squared space. However, we can extend this functionality by applying a linear morphism to the terms in the coproduct, as follows:
sage: X = S[2,1,4,1].coproduct()
sage: def linear_morphism(x, y):
....: return x.duality_pairing(M[1,3]) * y.duality_pairing(M[2,1,1])
sage: X.apply_multilinear_morphism(linear_morphism, codomain=ZZ)
1
Similarly, if is an element of
and
and
are
elements of
, then
For example, the coefficient of R[2,3,1] in R[2,1]*R[2,1] is computed with the duality pairing by the following command:
sage: (R[2,1]*R[2,1]).duality_pairing(F[2,3,1])
1
sage: R[2,1]*R[2,1]
R[2, 1, 2, 1] + R[2, 3, 1]
This coefficient should then be equal to the coefficient of F[2,1] # F[2,1] in F[2,3,1].coproduct():
sage: F[2,3,1].coproduct()
F[] # F[2, 3, 1] + ... + F[2, 1] # F[2, 1] + ... + F[2, 3, 1] # F[]
This can also be computed by the duality pairing on the tensor space, as above:
sage: X = F[2,3,1].coproduct()
sage: def linear_morphism(x, y):
....: return x.duality_pairing(R[2,1]) * y.duality_pairing(R[2,1])
sage: X.apply_multilinear_morphism(linear_morphism, codomain=ZZ)
1
The operation dual to multiplication by a non-commutative symmetric function
Let and consider the linear endomorphism of
defined by
left (respectively, right) multiplication by
. Since there is a duality
between
and
, this linear transformation induces an
operator
on
satisfying
for any non-commutative symmetric function .
This is implemented by the method skew_by(). Explicitly, if H is a quasi-symmetric function and g a non-commutative symmetric function, then H.skew_by(g) and H.skew_by(g, side='right') are expressions that satisfy, for any non-commutative symmetric function h, the following equalities:
H.skew_by(g).duality_pairing(h) == H.duality_pairing(g*h)
H.skew_by(g, side='right').duality_pairing(h) == H.duality_pairing(h*g)
For example, M[J].skew_by(S[I]) is unless the composition J
begins with I and M(J).skew_by(S(I), side='right') is
unless
the composition J ends with I. For example:
sage: M[3,2,2].skew_by(S[3])
M[2, 2]
sage: M[3,2,2].skew_by(S[2])
0
sage: M[3,2,2].coproduct().apply_multilinear_morphism( lambda x,y: x.duality_pairing(S[3])*y )
M[2, 2]
sage: M[3,2,2].skew_by(S[3], side='right')
0
sage: M[3,2,2].skew_by(S[2], side='right')
M[3, 2]
The counit
The counit is defined by sending all elements of positive degree to zero:
sage: M[3].degree(), M[3,1,2].degree(), M.one().degree()
(3, 6, 0)
sage: M[3].counit()
0
sage: M[3,1,2].counit()
0
sage: M.one().counit()
1
sage: (M[3] - 2*M[3,1,2] + 7).counit()
7
sage: (F[3] - 2*F[3,1,2] + 7).counit()
7
The antipode
The antipode sends the Fundamental basis element indexed by the
composition to
times the Fundamental
basis element indexed by the conjugate composition to
(where
stands for the size of
, that is, the sum of all
entries of
).
sage: F[3,2,2].antipode()
-F[1, 2, 2, 1, 1]
sage: Composition([3,2,2]).conjugate()
[1, 2, 2, 1, 1]
The antipodes of the Monomial quasisymmetric functions can also be
computed easily: Every composition satisfies
where the sum ranges over all compositions of
which are coarser than the reversed composition
of
. Here,
denotes the length of the composition
(that is, the number of its parts).
sage: M[3,2,1].antipode()
-M[1, 2, 3] - M[1, 5] - M[3, 3] - M[6]
sage: M[3,2,2].antipode()
-M[2, 2, 3] - M[2, 5] - M[4, 3] - M[7]
We demonstrate here the defining relation of the antipode:
sage: X = F[3,2,2].coproduct()
sage: X.apply_multilinear_morphism(lambda x,y: x*y.antipode())
0
sage: X.apply_multilinear_morphism(lambda x,y: x.antipode()*y)
0
The relation with symmetric functions
The quasi-symmetric functions are a ring which contain the symmetric functions as a subring. The Monomial quasi-symmetric functions are related to the monomial symmetric functions by
There are methods to test if an expression in the quasi-symmetric functions is a symmetric function and, if it is, send it to an expression in the symmetric functions:
sage: f = M[1,1,2] + M[1,2,1]
sage: f.is_symmetric()
False
sage: g = M[3,1] + M[1,3]
sage: g.is_symmetric()
True
sage: g.to_symmetric_function()
m[3, 1]
The expansion of the Schur function in terms of the Fundamental quasi-symmetric functions is due to [Ges]. There is one term in the expansion for each standard tableau of shape equal to the partition indexing the Schur function.
sage: f = F[3,2] + F[2,2,1] + F[2,3] + F[1,3,1] + F[1,2,2]
sage: f.is_symmetric()
True
sage: f.to_symmetric_function()
5*m[1, 1, 1, 1, 1] + 3*m[2, 1, 1, 1] + 2*m[2, 2, 1] + m[3, 1, 1] + m[3, 2]
sage: s = SymmetricFunctions(QQ).s()
sage: s(f.to_symmetric_function())
s[3, 2]
It is also possible to convert a symmetric function to a quasi-symmetric function:
sage: m = SymmetricFunctions(QQ).m()
sage: M( m[3,1,1] )
M[1, 1, 3] + M[1, 3, 1] + M[3, 1, 1]
sage: F( s[2,2,1] )
F[1, 1, 2, 1] + F[1, 2, 1, 1] + F[1, 2, 2] + F[2, 1, 2] + F[2, 2, 1]
It is possible to experiment with the quasi-symmetric function expansion of other bases, but it is important that the base ring be the same for both algebras.
sage: R = QQ['t']
sage: Qp = SymmetricFunctions(R).hall_littlewood().Qp()
sage: QSymt = QuasiSymmetricFunctions(R)
sage: Ft = QSymt.F()
sage: Ft( Qp[2,2] )
F[1, 2, 1] + t*F[1, 3] + (t+1)*F[2, 2] + t*F[3, 1] + t^2*F[4]
sage: K = QQ['q','t'].fraction_field()
sage: Ht = SymmetricFunctions(K).macdonald().Ht()
sage: Fqt = QuasiSymmetricFunctions(Ht.base_ring()).F()
sage: Fqt(Ht[2,1])
q*t*F[1, 1, 1] + (q+t)*F[1, 2] + (q+t)*F[2, 1] + F[3]
The following will raise an error because the base ring of F is not equal to the base ring of Ht:
sage: F(Ht[2,1])
Traceback (most recent call last):
...
TypeError: do not know how to make x (= McdHt[2, 1]) an element of self (=Quasisymmetric functions over the Rational Field in the Fundamental basis)
The map to the ring of polynomials
The quasi-symmetric functions can be seen as an inverse limit
of a subring of a polynomial ring as the number of variables
increases. Indeed, there exists a projection from the
quasi-symmetric functions onto the polynomial ring
. This projection is defined by
sending the variables
to
, while
the remaining
variables remain fixed. Note that this
projection sends
to
if the length of the composition
is higher than
.
sage: M[1,3,1].expand(4)
x0*x1^3*x2 + x0*x1^3*x3 + x0*x2^3*x3 + x1*x2^3*x3
sage: F[1,3,1].expand(4)
x0*x1^3*x2 + x0*x1^3*x3 + x0*x1^2*x2*x3 + x0*x1*x2^2*x3 + x0*x2^3*x3 + x1*x2^3*x3
sage: M[1,3,1].expand(2)
0
TESTS:
sage: QSym = QuasiSymmetricFunctions(QQ); QSym
Quasisymmetric functions over the Rational Field
sage: QSym.base_ring()
Rational Field
Bases: sage.categories.realizations.Category_realization_of_parent
Category of bases of quasi-symmetric functions.
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: QSym.Bases()
Category of bases of Quasisymmetric functions over the Rational Field
Methods common to all elements of QuasiSymmetricFunctions.
Return the image of the quasi-symmetric function self
under the -th Frobenius operator.
The -th Frobenius operator
is defined to be
the map from the
-algebra of quasi-symmetric functions
to itself that sends every symmetric function
to
. This operator
is a Hopf algebra endomorphism, and satisfies
for every composition
(where
means the monomial basis).
The -th Frobenius operator is also called the
-th
Frobenius endomorphism. It is not related to the Frobenius map
which connects the ring of symmetric functions with the
representation theory of the symmetric group.
The -th Frobenius operator is also the
-th Adams operator
of the
-ring of quasi-symmetric functions over the
integers.
The restriction of the -th Frobenius operator to the
subring formed by all symmetric functions is, not
unexpectedly, the
-th Frobenius operator of the ring of
symmetric functions.
adams_operation() serves as alias for frobenius(),
since the Frobenius operators are the Adams operations of
the -ring of quasi-symmetric functions.
See also
INPUT:
OUTPUT:
The result of applying the -th Frobenius operator (on the
ring of quasi-symmetric functions) to self.
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(ZZ)
sage: M = QSym.M()
sage: F = QSym.F()
sage: M[3,2].frobenius(2)
M[6, 4]
sage: (M[2,1] - 2*M[3]).frobenius(4)
M[8, 4] - 2*M[12]
sage: M([]).frobenius(3)
M[]
sage: F[1,1].frobenius(2)
F[1, 1, 1, 1] - F[1, 1, 2] - F[2, 1, 1] + F[2, 2]
The Frobenius endomorphisms are multiplicative:
sage: all( all( M(I).frobenius(3) * M(J).frobenius(3)
....: == (M(I) * M(J)).frobenius(3)
....: for I in Compositions(3) )
....: for J in Compositions(2) )
True
Being Hopf algebra endomorphisms, the Frobenius operators commute with the antipode:
sage: all( M(I).frobenius(4).antipode()
....: == M(I).antipode().frobenius(4)
....: for I in Compositions(3) )
True
The restriction of the Frobenius operators to the subring of symmetric functions are the Frobenius operators of the latter:
sage: e = SymmetricFunctions(ZZ).e()
sage: all( M(e(lam)).frobenius(3)
....: == M(e(lam).frobenius(3))
....: for lam in Partitions(3) )
True
Expand the quasi-symmetric function into n variables in an alphabet, which by default is 'x'.
INPUT:
OUTPUT:
EXAMPLES:
sage: F=QuasiSymmetricFunctions(QQ).Fundamental()
sage: F[3].expand(3)
x0^3 + x0^2*x1 + x0*x1^2 + x1^3 + x0^2*x2 + x0*x1*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2 + x2^3
sage: F[2,1].expand(3)
x0^2*x1 + x0^2*x2 + x0*x1*x2 + x1^2*x2
One can use a different set of variable by adding an optional argument alphabet=...
sage: F=QuasiSymmetricFunctions(QQ).Fundamental()
sage: F[3].expand(2,alphabet='y')
y0^3 + y0^2*y1 + y0*y1^2 + y1^3
TESTS:
sage: (3*F([])).expand(2)
3
sage: F[4,2].expand(0)
0
sage: F([]).expand(0)
1
Return the image of the quasi-symmetric function self
under the -th Frobenius operator.
The -th Frobenius operator
is defined to be
the map from the
-algebra of quasi-symmetric functions
to itself that sends every symmetric function
to
. This operator
is a Hopf algebra endomorphism, and satisfies
for every composition
(where
means the monomial basis).
The -th Frobenius operator is also called the
-th
Frobenius endomorphism. It is not related to the Frobenius map
which connects the ring of symmetric functions with the
representation theory of the symmetric group.
The -th Frobenius operator is also the
-th Adams operator
of the
-ring of quasi-symmetric functions over the
integers.
The restriction of the -th Frobenius operator to the
subring formed by all symmetric functions is, not
unexpectedly, the
-th Frobenius operator of the ring of
symmetric functions.
adams_operation() serves as alias for frobenius(),
since the Frobenius operators are the Adams operations of
the -ring of quasi-symmetric functions.
See also
INPUT:
OUTPUT:
The result of applying the -th Frobenius operator (on the
ring of quasi-symmetric functions) to self.
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(ZZ)
sage: M = QSym.M()
sage: F = QSym.F()
sage: M[3,2].frobenius(2)
M[6, 4]
sage: (M[2,1] - 2*M[3]).frobenius(4)
M[8, 4] - 2*M[12]
sage: M([]).frobenius(3)
M[]
sage: F[1,1].frobenius(2)
F[1, 1, 1, 1] - F[1, 1, 2] - F[2, 1, 1] + F[2, 2]
The Frobenius endomorphisms are multiplicative:
sage: all( all( M(I).frobenius(3) * M(J).frobenius(3)
....: == (M(I) * M(J)).frobenius(3)
....: for I in Compositions(3) )
....: for J in Compositions(2) )
True
Being Hopf algebra endomorphisms, the Frobenius operators commute with the antipode:
sage: all( M(I).frobenius(4).antipode()
....: == M(I).antipode().frobenius(4)
....: for I in Compositions(3) )
True
The restriction of the Frobenius operators to the subring of symmetric functions are the Frobenius operators of the latter:
sage: e = SymmetricFunctions(ZZ).e()
sage: all( M(e(lam)).frobenius(3)
....: == M(e(lam).frobenius(3))
....: for lam in Partitions(3) )
True
Return the inner coproduct of self in the basis of self.
The inner coproduct (also known as the Kronecker coproduct,
or as the second comultiplication on the -algebra of
quasi-symmetric functions) is an
-algebra homomorphism
from the
-algebra of quasi-symmetric
functions to the tensor square (over
) of quasi-symmetric
functions. It can be defined in the following two ways:
If is a composition, then a
-matrix will mean a
matrix whose entries are nonnegative integers such that no
row and no column of this matrix is zero, and such that if
all the non-zero entries of the matrix are read (row by row,
starting at the topmost row, reading every row from left to
right), then the reading word obtained is
. If
is
a
-matrix, then
will denote the
vector of row sums of
(regarded as a composition), and
will denote the vector of column sums
of
(regarded as a composition).
For every composition , the internal coproduct
of the
-th monomial quasisymmetric
function
is the sum
See Section 11.39 of [HazWitt1].
For every permutation , let
denote the descent
composition of
. Then, for any composition
of size
, the internal coproduct
of the
-th fundamental quasisymmetric function
is the sum
where is any permutation in
having descent
composition
and where permutations act from the left and
multiply accordingly, so
means first applying
and then
. See Theorem 4.23 in [Mal1993],
but beware of the notations which are apparently different
from those in [HazWitt1].
The restriction of the internal coproduct to the
-algebra of symmetric functions is the well-known
internal coproduct on the symmetric functions.
The method kronecker_coproduct() is a synonym of this one.
EXAMPLES:
Let us compute the internal coproduct of (which is
short for
). The
-matrices are
so
This is confirmed by the following Sage computation (incidentally demonstrating the non-cocommutativity of the internal coproduct):
sage: M = QuasiSymmetricFunctions(ZZ).M()
sage: a = M([2,1])
sage: a.internal_coproduct()
M[2, 1] # M[1, 2] + M[2, 1] # M[2, 1] + M[2, 1] # M[3] + M[3] # M[2, 1]
Further examples:
sage: all( M([i]).internal_coproduct() == tensor([M([i]), M([i])])
....: for i in range(1, 4) )
True
sage: M([1, 2]).internal_coproduct()
M[1, 2] # M[1, 2] + M[1, 2] # M[2, 1] + M[1, 2] # M[3] + M[3] # M[1, 2]
The definition of in terms of
-matrices is not suitable for computation in
cases where the length of
is large, but we can use
it as a doctest. Here is a naive implementation:
sage: def naive_internal_coproduct_on_M(I):
....: # INPUT: composition I
....: # (not quasi-symmetric function)
....: # OUTPUT: interior coproduct of M_I
....: M = QuasiSymmetricFunctions(ZZ).M()
....: M2 = M.tensor(M)
....: res = M2.zero()
....: l = len(I)
....: n = I.size()
....: for S in Subsets(range(l**2), l):
....: M_list = sorted(S)
....: row_M = [sum([I[M_list.index(l * i + j)]
....: for j in range(l) if
....: l * i + j in S])
....: for i in range(l)]
....: col_M = [sum([I[M_list.index(l * i + j)]
....: for i in range(l) if
....: l * i + j in S])
....: for j in range(l)]
....: if 0 in row_M:
....: first_zero = row_M.index(0)
....: row_M = row_M[:first_zero]
....: if sum(row_M) != n:
....: continue
....: if 0 in col_M:
....: first_zero = col_M.index(0)
....: col_M = col_M[:first_zero]
....: if sum(col_M) != n:
....: continue
....: res += tensor([M(Compositions(n)(row_M)),
....: M(Compositions(n)(col_M))])
....: return res
sage: all( naive_internal_coproduct_on_M(I)
....: == M(I).internal_coproduct()
....: for I in Compositions(3) )
True
TESTS:
Border cases:
sage: M = QuasiSymmetricFunctions(ZZ).M()
sage: F = QuasiSymmetricFunctions(ZZ).F()
sage: M([]).internal_coproduct()
M[] # M[]
sage: F([]).internal_coproduct()
F[] # F[]
The implementations on the F and M bases play nicely with each other:
sage: M = QuasiSymmetricFunctions(ZZ).M()
sage: F = QuasiSymmetricFunctions(ZZ).F()
sage: def int_copr_on_F_via_M(I):
....: result = tensor([F.zero(), F.zero()])
....: w = M(F(I)).internal_coproduct()
....: for lam, a in w:
....: (U, V) = lam
....: result += a * tensor([F(M(U)), F(M(V))])
....: return result
sage: all( int_copr_on_F_via_M(I) == F(I).internal_coproduct()
....: for I in Compositions(3) )
True
sage: all( int_copr_on_F_via_M(I) == F(I).internal_coproduct()
....: for I in Compositions(4) )
True
Restricting to the subring of symmetric functions gives the standard internal coproduct on the latter:
sage: M = QuasiSymmetricFunctions(ZZ).M()
sage: e = SymmetricFunctions(ZZ).e()
sage: def int_copr_of_e_in_M(mu):
....: result = tensor([M.zero(), M.zero()])
....: w = e(mu).internal_coproduct()
....: for lam, a in w:
....: (nu, kappa) = lam
....: result += a * tensor([M(e(nu)), M(e(kappa))])
....: return result
sage: all( int_copr_of_e_in_M(mu) == M(e(mu)).internal_coproduct()
....: for mu in Partitions(3) )
True
sage: all( int_copr_of_e_in_M(mu) == M(e(mu)).internal_coproduct()
....: for mu in Partitions(4) )
True
Todo
Implement this directly on the monomial basis maybe?
The -matrices are a pain to generate from their
definition, but maybe there is a good algorithm.
If so, the above “further examples” should be moved
to the M-method.
Return True if self is an element of the symmetric functions.
This is being tested by looking at the expansion in the Monomial basis and checking if the coefficients are the same if the indexing compositions are permutations of each other.
OUTPUT:
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: F = QSym.Fundamental()
sage: (F[3,2] + F[2,3]).is_symmetric()
False
sage: (F[1, 1, 1, 2] + F[1, 1, 3] + F[1, 3, 1] + F[2, 1, 1, 1] + F[3, 1, 1]).is_symmetric()
True
sage: F([]).is_symmetric()
True
Return the inner coproduct of self in the basis of self.
The inner coproduct (also known as the Kronecker coproduct,
or as the second comultiplication on the -algebra of
quasi-symmetric functions) is an
-algebra homomorphism
from the
-algebra of quasi-symmetric
functions to the tensor square (over
) of quasi-symmetric
functions. It can be defined in the following two ways:
If is a composition, then a
-matrix will mean a
matrix whose entries are nonnegative integers such that no
row and no column of this matrix is zero, and such that if
all the non-zero entries of the matrix are read (row by row,
starting at the topmost row, reading every row from left to
right), then the reading word obtained is
. If
is
a
-matrix, then
will denote the
vector of row sums of
(regarded as a composition), and
will denote the vector of column sums
of
(regarded as a composition).
For every composition , the internal coproduct
of the
-th monomial quasisymmetric
function
is the sum
See Section 11.39 of [HazWitt1].
For every permutation , let
denote the descent
composition of
. Then, for any composition
of size
, the internal coproduct
of the
-th fundamental quasisymmetric function
is the sum
where is any permutation in
having descent
composition
and where permutations act from the left and
multiply accordingly, so
means first applying
and then
. See Theorem 4.23 in [Mal1993],
but beware of the notations which are apparently different
from those in [HazWitt1].
The restriction of the internal coproduct to the
-algebra of symmetric functions is the well-known
internal coproduct on the symmetric functions.
The method kronecker_coproduct() is a synonym of this one.
EXAMPLES:
Let us compute the internal coproduct of (which is
short for
). The
-matrices are
so
This is confirmed by the following Sage computation (incidentally demonstrating the non-cocommutativity of the internal coproduct):
sage: M = QuasiSymmetricFunctions(ZZ).M()
sage: a = M([2,1])
sage: a.internal_coproduct()
M[2, 1] # M[1, 2] + M[2, 1] # M[2, 1] + M[2, 1] # M[3] + M[3] # M[2, 1]
Further examples:
sage: all( M([i]).internal_coproduct() == tensor([M([i]), M([i])])
....: for i in range(1, 4) )
True
sage: M([1, 2]).internal_coproduct()
M[1, 2] # M[1, 2] + M[1, 2] # M[2, 1] + M[1, 2] # M[3] + M[3] # M[1, 2]
The definition of in terms of
-matrices is not suitable for computation in
cases where the length of
is large, but we can use
it as a doctest. Here is a naive implementation:
sage: def naive_internal_coproduct_on_M(I):
....: # INPUT: composition I
....: # (not quasi-symmetric function)
....: # OUTPUT: interior coproduct of M_I
....: M = QuasiSymmetricFunctions(ZZ).M()
....: M2 = M.tensor(M)
....: res = M2.zero()
....: l = len(I)
....: n = I.size()
....: for S in Subsets(range(l**2), l):
....: M_list = sorted(S)
....: row_M = [sum([I[M_list.index(l * i + j)]
....: for j in range(l) if
....: l * i + j in S])
....: for i in range(l)]
....: col_M = [sum([I[M_list.index(l * i + j)]
....: for i in range(l) if
....: l * i + j in S])
....: for j in range(l)]
....: if 0 in row_M:
....: first_zero = row_M.index(0)
....: row_M = row_M[:first_zero]
....: if sum(row_M) != n:
....: continue
....: if 0 in col_M:
....: first_zero = col_M.index(0)
....: col_M = col_M[:first_zero]
....: if sum(col_M) != n:
....: continue
....: res += tensor([M(Compositions(n)(row_M)),
....: M(Compositions(n)(col_M))])
....: return res
sage: all( naive_internal_coproduct_on_M(I)
....: == M(I).internal_coproduct()
....: for I in Compositions(3) )
True
TESTS:
Border cases:
sage: M = QuasiSymmetricFunctions(ZZ).M()
sage: F = QuasiSymmetricFunctions(ZZ).F()
sage: M([]).internal_coproduct()
M[] # M[]
sage: F([]).internal_coproduct()
F[] # F[]
The implementations on the F and M bases play nicely with each other:
sage: M = QuasiSymmetricFunctions(ZZ).M()
sage: F = QuasiSymmetricFunctions(ZZ).F()
sage: def int_copr_on_F_via_M(I):
....: result = tensor([F.zero(), F.zero()])
....: w = M(F(I)).internal_coproduct()
....: for lam, a in w:
....: (U, V) = lam
....: result += a * tensor([F(M(U)), F(M(V))])
....: return result
sage: all( int_copr_on_F_via_M(I) == F(I).internal_coproduct()
....: for I in Compositions(3) )
True
sage: all( int_copr_on_F_via_M(I) == F(I).internal_coproduct()
....: for I in Compositions(4) )
True
Restricting to the subring of symmetric functions gives the standard internal coproduct on the latter:
sage: M = QuasiSymmetricFunctions(ZZ).M()
sage: e = SymmetricFunctions(ZZ).e()
sage: def int_copr_of_e_in_M(mu):
....: result = tensor([M.zero(), M.zero()])
....: w = e(mu).internal_coproduct()
....: for lam, a in w:
....: (nu, kappa) = lam
....: result += a * tensor([M(e(nu)), M(e(kappa))])
....: return result
sage: all( int_copr_of_e_in_M(mu) == M(e(mu)).internal_coproduct()
....: for mu in Partitions(3) )
True
sage: all( int_copr_of_e_in_M(mu) == M(e(mu)).internal_coproduct()
....: for mu in Partitions(4) )
True
Todo
Implement this directly on the monomial basis maybe?
The -matrices are a pain to generate from their
definition, but maybe there is a good algorithm.
If so, the above “further examples” should be moved
to the M-method.
Return the image of the quasisymmetric function self under the omega involution.
The omega involution is defined as the linear map
which, for every composition
, sends
the fundamental quasisymmetric function
to
, where
denotes the conjugate
(conjugate())
of the composition
. This map is commonly denoted by
. It is an algebra homomorphism and a coalgebra
antihomomorphism; it also is an involution and an
automorphism of the graded vector space
. Also,
every composition
satisfies
where the sum ranges over all compositions of
which are coarser than the reversed composition
of
. Here,
denotes the length of the composition
(that is, the number of parts of
).
If is a homogeneous element of
of degree
,
then
where denotes the antipode of
.
The restriction of to the ring of symmetric
functions (which is a subring of
) is precisely the
omega involution
(omega())
of said ring.
The omega involution on is adjoint to the omega
involution on
by the standard adjunction between
and
.
The omega involution has been denoted by in [LMvW13],
section 3.6.
See also
sage.combinat.ncsf_qsym.ncsf.NonCommutativeSymmetricFunctions.Bases.ElementMethods.omega_involution(), sage.combinat.ncsf_qsym.qsym.QuasiSymmetricFunctions.Bases.ElementMethods.psi_involution(), sage.combinat.ncsf_qsym.qsym.QuasiSymmetricFunctions.Bases.ElementMethods.star_involution().
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(ZZ)
sage: F = QSym.F()
sage: F[3,2].omega_involution()
F[1, 2, 1, 1]
sage: F[6,3].omega_involution()
F[1, 1, 2, 1, 1, 1, 1, 1]
sage: (F[9,1] - F[8,2] + 2*F[2,4] - 3*F[3] + 4*F[[]]).omega_involution()
4*F[] - 3*F[1, 1, 1] + 2*F[1, 1, 1, 2, 1] - F[1, 2, 1, 1, 1, 1, 1, 1, 1] + F[2, 1, 1, 1, 1, 1, 1, 1, 1]
sage: (F[3,3] - 2*F[2]).omega_involution()
-2*F[1, 1] + F[1, 1, 2, 1, 1]
sage: F([2,1,1]).omega_involution()
F[3, 1]
sage: M = QSym.M()
sage: M([2,1]).omega_involution()
-M[1, 2] - M[3]
sage: M.zero().omega_involution()
0
Testing the fact that the restriction of to
is the omega automorphism of
:
sage: Sym = SymmetricFunctions(ZZ)
sage: e = Sym.e()
sage: all( F(e[lam]).omega_involution() == F(e[lam].omega())
....: for lam in Partitions(4) )
True
Return the image of the quasisymmetric function self
under the involution .
The involution is defined as the linear map
which, for every composition
, sends the
fundamental quasisymmetric function
to
, where
denotes the complement of the composition
.
The map
is an involution and a graded Hopf algebra
automorphism of
. Its restriction to the ring of
symmetric functions coincides with the omega automorphism of
the latter ring.
The involution of
is adjoint to the involution
of
by the standard adjunction between
and
.
The involution has been denoted by
in [LMvW13],
section 3.6.
See also
sage.combinat.ncsf_qsym.ncsf.NonCommutativeSymmetricFunctions.Bases.ElementMethods.psi_involution(), sage.combinat.ncsf_qsym.qsym.QuasiSymmetricFunctions.Bases.ElementMethods.star_involution().
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(ZZ)
sage: F = QSym.F()
sage: F[3,2].psi_involution()
F[1, 1, 2, 1]
sage: F[6,3].psi_involution()
F[1, 1, 1, 1, 1, 2, 1, 1]
sage: (F[9,1] - F[8,2] + 2*F[2,4] - 3*F[3] + 4*F[[]]).psi_involution()
4*F[] - 3*F[1, 1, 1] + F[1, 1, 1, 1, 1, 1, 1, 1, 2] - F[1, 1, 1, 1, 1, 1, 1, 2, 1] + 2*F[1, 2, 1, 1, 1]
sage: (F[3,3] - 2*F[2]).psi_involution()
-2*F[1, 1] + F[1, 1, 2, 1, 1]
sage: F([2,1,1]).psi_involution()
F[1, 3]
sage: M = QSym.M()
sage: M([2,1]).psi_involution()
-M[2, 1] - M[3]
sage: M.zero().psi_involution()
0
The involution commutes with the antipode:
sage: all( F(I).psi_involution().antipode()
....: == F(I).antipode().psi_involution()
....: for I in Compositions(4) )
True
Testing the fact that the restriction of to
is the omega automorphism of
:
sage: Sym = SymmetricFunctions(ZZ)
sage: e = Sym.e()
sage: all( F(e[lam]).psi_involution() == F(e[lam].omega())
....: for lam in Partitions(4) )
True
Return the image of the quasisymmetric function self under the star involution.
The star involution is defined as the linear map
which, for every composition
, sends the
monomial quasisymmetric function
to
. Here, if
is a composition, we denote by
the reversed
composition of
. Denoting by
the image of an
element
under the star involution, it can be shown
that every composition
satisfies
where denotes the fundamental quasisymmetric function
corresponding to the composition
. The star involution is an
involution, an algebra automorphism and a coalgebra
anti-automorphism of
. It also is an automorphism of the
graded vector space
, and is the identity on the subspace
of
. It is adjoint to the star involution on
by the standard adjunction between
and
.
The star involution has been denoted by in [LMvW13],
section 3.6.
See also
sage.combinat.ncsf_qsym.ncsf.NonCommutativeSymmetricFunctions.Bases.ElementMethods.star_involution().
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(ZZ)
sage: M = QSym.M()
sage: M[3,2].star_involution()
M[2, 3]
sage: M[6,3].star_involution()
M[3, 6]
sage: (M[9,1] - M[6,2] + 2*M[6,4] - 3*M[3] + 4*M[[]]).star_involution()
4*M[] + M[1, 9] - M[2, 6] - 3*M[3] + 2*M[4, 6]
sage: (M[3,3] - 2*M[2]).star_involution()
-2*M[2] + M[3, 3]
sage: M([4,2]).star_involution()
M[2, 4]
sage: dI = QSym.dI()
sage: dI([1,2]).star_involution()
-dI[1, 2] + dI[2, 1]
sage: dI.zero().star_involution()
0
The star involution commutes with the antipode:
sage: all( M(I).star_involution().antipode()
....: == M(I).antipode().star_involution()
....: for I in Compositions(4) )
True
The star involution is the identity on :
sage: Sym = SymmetricFunctions(ZZ)
sage: e = Sym.e()
sage: all( M(e(lam)).star_involution() == M(e(lam))
....: for lam in Partitions(4) )
True
Convert a quasi-symmetric function to a symmetric function.
OUTPUT:
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: F = QSym.Fundamental()
sage: (F[3,2] + F[2,3]).to_symmetric_function()
Traceback (most recent call last):
...
ValueError: F[2, 3] + F[3, 2] is not a symmetric function
sage: m = SymmetricFunctions(QQ).m()
sage: s = SymmetricFunctions(QQ).s()
sage: F(s[3,1,1]).to_symmetric_function()
6*m[1, 1, 1, 1, 1] + 3*m[2, 1, 1, 1] + m[2, 2, 1] + m[3, 1, 1]
sage: m(s[3,1,1])
6*m[1, 1, 1, 1, 1] + 3*m[2, 1, 1, 1] + m[2, 2, 1] + m[3, 1, 1]
Methods common to all bases of QuasiSymmetricFunctions.
Return the Eulerian (quasi)symmetric function in
terms of self.
INPUT:
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: M = QSym.M()
sage: M.Eulerian(3, 1)
4*M[1, 1, 1] + 3*M[1, 2] + 3*M[2, 1] + 2*M[3]
sage: M.Eulerian(4, 1, 2)
6*M[1, 1, 1, 1] + 4*M[1, 1, 2] + 4*M[1, 2, 1]
+ 2*M[1, 3] + 4*M[2, 1, 1] + 3*M[2, 2] + 2*M[3, 1] + M[4]
sage: QS = QSym.QS()
sage: QS.Eulerian(4, 2)
2*QS[1, 3] + QS[2, 2] + 2*QS[3, 1] + 3*QS[4]
sage: QS.Eulerian([2, 2, 1], 2)
QS[1, 2, 2] + QS[1, 4] + QS[2, 1, 2] + QS[2, 2, 1]
+ QS[2, 3] + QS[3, 2] + QS[4, 1] + QS[5]
sage: dI = QSym.dI()
sage: dI.Eulerian(5, 2)
-dI[1, 3, 1] - 5*dI[1, 4] + dI[2, 2, 1] + dI[3, 1, 1]
+ 5*dI[3, 2] + 6*dI[4, 1] + 6*dI[5]
The quasi-symmetric function expanded in this basis corresponding to the quasi-symmetric polynomial f.
This is a default implementation that computes the expansion in the Monomial basis and converts to this basis.
INPUT:
OUTPUT:
EXAMPLES:
sage: M = QuasiSymmetricFunctions(QQ).Monomial()
sage: F = QuasiSymmetricFunctions(QQ).Fundamental()
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.from_polynomial(f)
F[1]
sage: f = x[0]**2+x[1]**2+x[2]**2
sage: M.from_polynomial(f)
M[2]
sage: F.from_polynomial(f)
-F[1, 1] + F[2]
If the polynomial is not quasi-symmetric, an error is raised:
sage: f = x[0]^2+x[1]
sage: M.from_polynomial(f)
Traceback (most recent call last):
...
ValueError: x0^2 + x1 is not a quasi-symmetric polynomial
sage: F.from_polynomial(f)
Traceback (most recent call last):
...
ValueError: x0^2 + x1 is not a quasi-symmetric polynomial
TESTS:
We convert some quasi-symmetric functions to quasi-symmetric polynomials and back:
sage: f = (M[1,2] + M[1,1]).expand(3); f
x0*x1^2 + x0*x2^2 + x1*x2^2 + x0*x1 + x0*x2 + x1*x2
sage: M.from_polynomial(f)
M[1, 1] + M[1, 2]
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]
sage: f = (F[1,2] + F[1,1]).expand(3); f
x0*x1^2 + x0*x1*x2 + x0*x2^2 + x1*x2^2 + x0*x1 + x0*x2 + x1*x2
sage: F.from_polynomial(f)
F[1, 1] + F[1, 2]
sage: f = (2*F[2,1]+F[1,1]+3*F[3]).expand(3)
sage: F.from_polynomial(f)
F[1, 1] + 2*F[2, 1] + 3*F[3]
Return the super categories of bases of the Quasi-symmetric functions.
OUTPUT:
TESTS:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: QSym.Bases().super_categories()
[Category of commutative bases of Non-Commutative Symmetric Functions or Quasisymmetric functions over the Rational Field]
Bases: sage.combinat.free_module.CombinatorialFreeModule, sage.misc.bindable_class.BindableClass
The Hopf algebra of quasi-symmetric functions in the Fundamental basis.
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: F = QSym.F()
sage: M = QSym.M()
sage: F(M[2,2])
F[1, 1, 1, 1] - F[1, 1, 2] - F[2, 1, 1] + F[2, 2]
sage: s = SymmetricFunctions(QQ).s()
sage: F(s[3,2])
F[1, 2, 2] + F[1, 3, 1] + F[2, 2, 1] + F[2, 3] + F[3, 2]
sage: (1+F[1])^3
F[] + 3*F[1] + 3*F[1, 1] + F[1, 1, 1] + 2*F[1, 2] + 3*F[2] + 2*F[2, 1] + F[3]
sage: F[1,2,1].coproduct()
F[] # F[1, 2, 1] + F[1] # F[2, 1] + F[1, 1] # F[1, 1] + F[1, 2] # F[1] + F[1, 2, 1] # F[]
The following is an alias for this basis:
sage: QSym.Fundamental()
Quasisymmetric functions over the Rational Field in the Fundamental basis
TESTS:
sage: F(M([]))
F[]
sage: F(M(0))
0
sage: F(s([]))
F[]
sage: F(s(0))
0
Bases: sage.combinat.free_module.CombinatorialFreeModuleElement
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
Return the inner coproduct of self in the Fundamental basis.
The inner coproduct (also known as the Kronecker coproduct,
or as the second comultiplication on the -algebra of
quasi-symmetric functions) is an
-algebra homomorphism
from the
-algebra of quasi-symmetric
functions to the tensor square (over
) of quasi-symmetric
functions. It can be defined in the following two ways:
If is a composition, then a
-matrix will mean a
matrix whose entries are nonnegative integers such that no
row and no column of this matrix is zero, and such that if
all the non-zero entries of the matrix are read (row by row,
starting at the topmost row, reading every row from left to
right), then the reading word obtained is
. If
is
a
-matrix, then
will denote the
vector of row sums of
(regarded as a composition), and
will denote the vector of column sums
of
(regarded as a composition).
For every composition , the internal coproduct
of the
-th monomial quasisymmetric
function
is the sum
See Section 11.39 of [HazWitt1].
For every permutation , let
denote the descent
composition of
. Then, for any composition
of size
, the internal coproduct
of the
-th fundamental quasisymmetric function
is the sum
where is any permutation in
having descent
composition
and where permutations act from the left and
multiply accordingly, so
means first applying
and then
. See Theorem 4.23 in [Mal1993],
but beware of the notations which are apparently different
from those in [HazWitt1].
The restriction of the internal coproduct to the
-algebra of symmetric functions is the well-known
internal coproduct on the symmetric functions.
The method kronecker_coproduct() is a synonym of this one.
EXAMPLES:
Let us compute the internal coproduct of (which is
short for
). The
-matrices are
so
This is confirmed by the following Sage computation (incidentally demonstrating the non-cocommutativity of the internal coproduct):
sage: M = QuasiSymmetricFunctions(ZZ).M()
sage: a = M([2,1])
sage: a.internal_coproduct()
M[2, 1] # M[1, 2] + M[2, 1] # M[2, 1] + M[2, 1] # M[3] + M[3] # M[2, 1]
Some examples on the Fundamental basis:
sage: F = QuasiSymmetricFunctions(ZZ).F()
sage: F([1,1]).internal_coproduct()
F[1, 1] # F[2] + F[2] # F[1, 1]
sage: F([2]).internal_coproduct()
F[1, 1] # F[1, 1] + F[2] # F[2]
sage: F([3]).internal_coproduct()
F[1, 1, 1] # F[1, 1, 1] + F[1, 2] # F[1, 2] + F[1, 2] # F[2, 1]
+ F[2, 1] # F[1, 2] + F[2, 1] # F[2, 1] + F[3] # F[3]
sage: F([1,2]).internal_coproduct()
F[1, 1, 1] # F[1, 2] + F[1, 2] # F[2, 1] + F[1, 2] # F[3]
+ F[2, 1] # F[1, 1, 1] + F[2, 1] # F[2, 1] + F[3] # F[1, 2]
Return the inner coproduct of self in the Fundamental basis.
The inner coproduct (also known as the Kronecker coproduct,
or as the second comultiplication on the -algebra of
quasi-symmetric functions) is an
-algebra homomorphism
from the
-algebra of quasi-symmetric
functions to the tensor square (over
) of quasi-symmetric
functions. It can be defined in the following two ways:
If is a composition, then a
-matrix will mean a
matrix whose entries are nonnegative integers such that no
row and no column of this matrix is zero, and such that if
all the non-zero entries of the matrix are read (row by row,
starting at the topmost row, reading every row from left to
right), then the reading word obtained is
. If
is
a
-matrix, then
will denote the
vector of row sums of
(regarded as a composition), and
will denote the vector of column sums
of
(regarded as a composition).
For every composition , the internal coproduct
of the
-th monomial quasisymmetric
function
is the sum
See Section 11.39 of [HazWitt1].
For every permutation , let
denote the descent
composition of
. Then, for any composition
of size
, the internal coproduct
of the
-th fundamental quasisymmetric function
is the sum
where is any permutation in
having descent
composition
and where permutations act from the left and
multiply accordingly, so
means first applying
and then
. See Theorem 4.23 in [Mal1993],
but beware of the notations which are apparently different
from those in [HazWitt1].
The restriction of the internal coproduct to the
-algebra of symmetric functions is the well-known
internal coproduct on the symmetric functions.
The method kronecker_coproduct() is a synonym of this one.
EXAMPLES:
Let us compute the internal coproduct of (which is
short for
). The
-matrices are
so
This is confirmed by the following Sage computation (incidentally demonstrating the non-cocommutativity of the internal coproduct):
sage: M = QuasiSymmetricFunctions(ZZ).M()
sage: a = M([2,1])
sage: a.internal_coproduct()
M[2, 1] # M[1, 2] + M[2, 1] # M[2, 1] + M[2, 1] # M[3] + M[3] # M[2, 1]
Some examples on the Fundamental basis:
sage: F = QuasiSymmetricFunctions(ZZ).F()
sage: F([1,1]).internal_coproduct()
F[1, 1] # F[2] + F[2] # F[1, 1]
sage: F([2]).internal_coproduct()
F[1, 1] # F[1, 1] + F[2] # F[2]
sage: F([3]).internal_coproduct()
F[1, 1, 1] # F[1, 1, 1] + F[1, 2] # F[1, 2] + F[1, 2] # F[2, 1]
+ F[2, 1] # F[1, 2] + F[2, 1] # F[2, 1] + F[3] # F[3]
sage: F([1,2]).internal_coproduct()
F[1, 1, 1] # F[1, 2] + F[1, 2] # F[2, 1] + F[1, 2] # F[3]
+ F[2, 1] # F[1, 1, 1] + F[2, 1] # F[2, 1] + F[3] # F[1, 2]
Return the image of the quasisymmetric function self under the star involution.
The star involution is defined as the linear map
which, for every composition
, sends the
monomial quasisymmetric function
to
. Here, if
is a composition, we denote by
the reversed
composition of
. Denoting by
the image of an
element
under the star involution, it can be shown
that every composition
satisfies
where denotes the fundamental quasisymmetric function
corresponding to the composition
. The star involution is an
involution, an algebra automorphism and a coalgebra
anti-automorphism of
. It also is an automorphism of the
graded vector space
, and is the identity on the subspace
of
. It is adjoint to the star involution on
by the standard adjunction between
and
.
The star involution has been denoted by in [LMvW13],
section 3.6.
See also
sage.combinat.ncsf_qsym.qsym.QuasiSymmetricFunctions.Bases.ElementMethods.star_involution(), sage.combinat.ncsf_qsym.ncsf.NonCommutativeSymmetricFunctions.Bases.ElementMethods.star_involution().
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(ZZ)
sage: F = QSym.F()
sage: F[3,1].star_involution()
F[1, 3]
sage: F[5,3].star_involution()
F[3, 5]
sage: (F[9,1] - F[6,2] + 2*F[6,4] - 3*F[3] + 4*F[[]]).star_involution()
4*F[] + F[1, 9] - F[2, 6] - 3*F[3] + 2*F[4, 6]
sage: (F[3,3] - 2*F[2]).star_involution()
-2*F[2] + F[3, 3]
sage: F([4,2]).star_involution()
F[2, 4]
sage: dI = QSym.dI()
sage: dI([1,2]).star_involution()
-dI[1, 2] + dI[2, 1]
sage: dI.zero().star_involution()
0
Return the Eulerian (quasi)symmetric function (with
either an integer or a partition) defined in [SW2010] in
terms of the fundamental quasisymmetric functions.
Or, if the optional argument k is specified, return the
function
defined ibidem.
If and
are nonnegative integers, then the Eulerian
quasisymmetric function
is defined as
where we sum over all permutations such that
the number of excedances of
is
, and where
is a composition of
defined as follows:
Let
be the set of all
such
that either
or
or
. Then,
is set to be the composition of
whose
descent set is
.
Here, an excedance of a permutation means an
element
satisfying
.
Similarly we can define a quasisymmetric function
for every partition
and every nonnegative integer
.
This differs from
only in that the sum is restricted to
all permutations
whose cycle type is
(where
, and where we still require the number of
excedances to be
). The method at hand allows computing these
functions by passing
as the n parameter.
Analogously we can define a quasisymmetric function for
any nonnegative integers
,
and
by restricting the sum to
all permutations
that have exactly
fixed
points (and
excedances). This can be obtained by specifying the
optional k argument in this method.
All three versions of Eulerian quasisymmetric functions
(,
and
) are actually
symmetric functions. See
Eulerian().
INPUT:
REFERENCES:
[SW2010] | John Shareshian and Michelle Wachs. Eulerian quasisymmetric functions. (2010). Arxiv 0812.0764v2 |
EXAMPLES:
sage: F = QuasiSymmetricFunctions(QQ).F()
sage: F.Eulerian(3, 1)
F[1, 2] + F[2, 1] + 2*F[3]
sage: F.Eulerian(4, 2)
F[1, 2, 1] + 2*F[1, 3] + 3*F[2, 2] + 2*F[3, 1] + 3*F[4]
sage: F.Eulerian(5, 2)
F[1, 1, 2, 1] + F[1, 1, 3] + F[1, 2, 1, 1] + 7*F[1, 2, 2] + 6*F[1, 3, 1] + 6*F[1, 4] + 2*F[2, 1, 2] + 7*F[2, 2, 1] + 11*F[2, 3] + F[3, 1, 1] + 11*F[3, 2] + 6*F[4, 1] + 6*F[5]
sage: F.Eulerian(4, 0)
F[4]
sage: F.Eulerian(4, 3)
F[4]
sage: F.Eulerian(4, 1, 2)
F[1, 2, 1] + F[1, 3] + 2*F[2, 2] + F[3, 1] + F[4]
sage: F.Eulerian(Partition([2, 2, 1]), 2)
F[1, 1, 2, 1] + F[1, 2, 1, 1] + 2*F[1, 2, 2] + F[1, 3, 1]
+ F[1, 4] + F[2, 1, 2] + 2*F[2, 2, 1] + 2*F[2, 3]
+ 2*F[3, 2] + F[4, 1] + F[5]
sage: F.Eulerian(0, 0)
F[]
sage: F.Eulerian(0, 1)
0
sage: F.Eulerian(1, 0)
F[1]
sage: F.Eulerian(1, 1)
0
TESTS:
sage: F = QuasiSymmetricFunctions(QQ).F()
sage: F.Eulerian(Partition([3, 1]), 1, 1)
Traceback (most recent call last):
...
ValueError: invalid input, k cannot be specified
Return the antipode to a Fundamental quasi-symmetric basis element.
INPUT:
OUTPUT:
EXAMPLES:
sage: F = QuasiSymmetricFunctions(QQ).F()
sage: F.antipode_on_basis(Composition([2,1]))
-F[2, 1]
Return the coproduct to a Fundamental quasi-symmetric basis element.
Combinatorial rule: quasi-deconcatenation.
INPUT:
OUTPUT:
EXAMPLES:
sage: F = QuasiSymmetricFunctions(QQ).Fundamental()
sage: F[4].coproduct()
F[] # F[4] + F[1] # F[3] + F[2] # F[2] + F[3] # F[1] + F[4] # F[]
sage: F[2,1,3].coproduct()
F[] # F[2, 1, 3] + F[1] # F[1, 1, 3] + F[2] # F[1, 3] + F[2, 1] # F[3] + F[2, 1, 1] # F[2] + F[2, 1, 2] # F[1] + F[2, 1, 3] # F[]
TESTS:
sage: F.coproduct_on_basis(Composition([2,1,3]))
F[] # F[2, 1, 3] + F[1] # F[1, 1, 3] + F[2] # F[1, 3] + F[2, 1] # F[3] + F[2, 1, 1] # F[2] + F[2, 1, 2] # F[1] + F[2, 1, 3] # F[]
sage: F.one().coproduct() # generic for graded / graded connected
F[] # F[]
Return the dual basis to the Fundamental basis. This is the ribbon basis of the non-commutative symmetric functions.
OUTPUT:
EXAMPLES:
sage: F = QuasiSymmetricFunctions(QQ).F()
sage: F.dual()
Non-Commutative Symmetric Functions over the Rational Field in the Ribbon basis
Bases: sage.combinat.free_module.CombinatorialFreeModule, sage.misc.bindable_class.BindableClass
The Hazewinkel lambda basis of the quasi-symmetric functions.
This basis goes back to [Haz2004], albeit it is indexed in a different way here. It is a multiplicative basis in a weak sense of this word (the product of any two basis elements is a basis element, but of course not the one obtained by concatenating the indexing compositions).
In [Haz2004], Hazewinkel showed that the -algebra
is a polynomial algebra. (The proof is correct
but rests upon an unproven claim that the lexicographically
largest term of the
-th shuffle power of a Lyndon word is
the
-fold concatenatenation of this Lyndon word with
itself, occuring
times in that shuffle power. But this
can be deduced from Section 2 of [Rad1979].) More precisely,
he showed that
is generated, as a free
commutative
-algebra, by the elements
, where
ranges over the positive integers,
and
ranges over all compositions which are Lyndon words
and whose entries have gcd
. Here,
denotes the
-th lambda operation as explained in
lambda_of_monomial().
Thus, products of these generators form a -module
basis of
. We index this basis by compositions
here. More precisely, we define the Hazewinkel lambda basis
(with
ranging over all compositions)
as follows:
Let be a composition. Let
be the
Chen-Fox-Lyndon factorization of
(see
lyndon_factorization()
). For every
, let
be the
gcd of the entries of the Lyndon word
, and let
be
the result of dividing the entries of
by this gcd. Then,
is defined to be
.
Todo
The conversion from the M basis to the HWL basis is currently implemented in the naive way (inverting the base-change matrix in the other direction). This matrix is not triangular (not even after any permutations of the bases), and there could very well be a faster method (the one given by Hazewinkel?).
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(ZZ)
sage: HWL = QSym.HazewinkelLambda()
sage: M = QSym.M()
sage: M(HWL([2]))
M[1, 1]
sage: M(HWL([1,1]))
2*M[1, 1] + M[2]
sage: M(HWL([1,2]))
M[1, 2]
sage: M(HWL([2,1]))
3*M[1, 1, 1] + M[1, 2] + M[2, 1]
sage: M(HWL(Composition([])))
M[]
sage: HWL(M([1,1]))
HWL[2]
sage: HWL(M(Composition([2])))
HWL[1, 1] - 2*HWL[2]
sage: HWL(M([1]))
HWL[1]
TESTS:
Transforming from the M-basis into the HWL-basis and back returns us to where we started:
sage: all( M(HWL(M[I])) == M[I] for I in Compositions(3) )
True
sage: all( HWL(M(HWL[I])) == HWL[I] for I in Compositions(4) )
True
Checking the HWL basis elements corresponding to Lyndon words:
sage: all( M(HWL[Composition(I)])
....: == M.lambda_of_monomial([i // gcd(I) for i in I], gcd(I))
....: for I in LyndonWords(e=3, k=2) )
True
The product on Hazewinkel Lambda basis elements.
The product of the basis elements indexed by two compositions
and
is the basis element obtained by concatenating the
Lyndon factorizations of the words
and
, then reordering
the Lyndon factors in nonincreasing order, and finally
concatenating them in this order (giving a new composition).
INPUT:
OUTPUT:
EXAMPLES:
sage: HWL = QuasiSymmetricFunctions(QQ).HazewinkelLambda()
sage: c1 = Composition([1, 2, 1])
sage: c2 = Composition([2, 1, 3, 2])
sage: HWL.product_on_basis(c1, c2)
HWL[2, 1, 3, 2, 1, 2, 1]
sage: HWL.product_on_basis(c1, Composition([]))
HWL[1, 2, 1]
sage: HWL.product_on_basis(Composition([]), Composition([]))
HWL[]
TESTS:
sage: M = QuasiSymmetricFunctions(QQ).M()
sage: all( all( M(HWL[I] * HWL[J]) == M(HWL[I]) * M(HWL[J])
....: for I in Compositions(3) )
....: for J in Compositions(3) )
True
Bases: sage.combinat.free_module.CombinatorialFreeModule, sage.misc.bindable_class.BindableClass
The Hopf algebra of quasi-symmetric function in the Monomial basis.
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: M = QSym.M()
sage: F = QSym.F()
sage: M(F[2,2])
M[1, 1, 1, 1] + M[1, 1, 2] + M[2, 1, 1] + M[2, 2]
sage: m = SymmetricFunctions(QQ).m()
sage: M(m[3,1,1])
M[1, 1, 3] + M[1, 3, 1] + M[3, 1, 1]
sage: (1+M[1])^3
M[] + 3*M[1] + 6*M[1, 1] + 6*M[1, 1, 1] + 3*M[1, 2] + 3*M[2] + 3*M[2, 1] + M[3]
sage: M[1,2,1].coproduct()
M[] # M[1, 2, 1] + M[1] # M[2, 1] + M[1, 2] # M[1] + M[1, 2, 1] # M[]
The following is an alias for this basis:
sage: QSym.Monomial()
Quasisymmetric functions over the Rational Field in the Monomial basis
TESTS:
sage: M(F([]))
M[]
sage: M(F(0))
0
sage: M(m([]))
M[]
Bases: sage.combinat.free_module.CombinatorialFreeModuleElement
Element methods of the Monomial basis of QuasiSymmetricFunctions.
Expand the quasi-symmetric function written in the monomial basis in
variables.
INPUT:
OUTPUT:
Todo
accept an alphabet as input
EXAMPLES:
sage: M = QuasiSymmetricFunctions(QQ).Monomial()
sage: M[4,2].expand(3)
x0^4*x1^2 + x0^4*x2^2 + x1^4*x2^2
One can use a different set of variables by using the optional argument alphabet:
sage: M=QuasiSymmetricFunctions(QQ).Monomial()
sage: M[2,1,1].expand(4,alphabet='y')
y0^2*y1*y2 + y0^2*y1*y3 + y0^2*y2*y3 + y1^2*y2*y3
TESTS:
sage: (3*M([])).expand(2)
3
sage: M[4,2].expand(0)
0
sage: M([]).expand(0)
1
Determine if a quasi-symmetric function, written in the Monomial basis, is symmetric.
This is being tested by looking at the expansion in the Monomial basis and checking if the coefficients are the same if the indexing compositions are permutations of each other.
OUTPUT:
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: M = QSym.Monomial()
sage: (M[3,2] + M[2,3] + M[4,1]).is_symmetric()
False
sage: (M[3,2] + M[2,3]).is_symmetric()
True
sage: (M[1,2,1] + M[1,1,2]).is_symmetric()
False
sage: (M[1,2,1] + M[1,1,2] + M[2,1,1]).is_symmetric()
True
Return the image of the quasisymmetric function self
under the involution .
The involution is defined as the linear map
which, for every composition
, sends the
fundamental quasisymmetric function
to
, where
denotes the complement of the composition
.
The map
is an involution and a graded Hopf algebra
automorphism of
. Its restriction to the ring of
symmetric functions coincides with the omega automorphism of
the latter ring.
The involution of
is adjoint to the involution
of
by the standard adjunction between
and
.
The involution has been denoted by
in [LMvW13],
section 3.6.
See also
sage.combinat.ncsf_qsym.qsym.QuasiSymmetricFunctions.Bases.ElementMethods.psi_involution(), sage.combinat.ncsf_qsym.ncsf.NonCommutativeSymmetricFunctions.Bases.ElementMethods.psi_involution(), sage.combinat.ncsf_qsym.qsym.QuasiSymmetricFunctions.Bases.ElementMethods.star_involution().
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(ZZ)
sage: M = QSym.M()
sage: M[3,2].psi_involution()
-M[3, 2] - M[5]
sage: M[3,1].psi_involution()
M[3, 1] + M[4]
sage: M[3,1,1].psi_involution()
M[3, 1, 1] + M[3, 2] + M[4, 1] + M[5]
sage: M[1,1,1].psi_involution()
M[1, 1, 1] + M[1, 2] + M[2, 1] + M[3]
sage: M[[]].psi_involution()
M[]
sage: M(0).psi_involution()
0
sage: (2*M[[]] - M[3,1] + 4*M[2]).psi_involution()
2*M[] - 4*M[2] - M[3, 1] - M[4]
This particular implementation is tailored to the monomial basis. It is semantically equivalent to the generic implementation it overshadows:
sage: F = QSym.F()
sage: all( F(M[I].psi_involution()) == F(M[I]).psi_involution()
....: for I in Compositions(3) )
True
sage: F = QSym.F()
sage: all( F(M[I].psi_involution()) == F(M[I]).psi_involution()
....: for I in Compositions(4) )
True
Take a quasi-symmetric function, expressed in the monomial basis, and return its symmetric realization, when possible, expressed in the monomial basis of symmetric functions.
OUTPUT:
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: M = QSym.Monomial()
sage: (M[3,2] + M[2,3] + M[4,1]).to_symmetric_function()
Traceback (most recent call last):
...
ValueError: M[2, 3] + M[3, 2] + M[4, 1] is not a symmetric function
sage: (M[3,2] + M[2,3] + 2*M[4,1] + 2*M[1,4]).to_symmetric_function()
m[3, 2] + 2*m[4, 1]
sage: m = SymmetricFunctions(QQ).m()
sage: M(m[3,1,1]).to_symmetric_function()
m[3, 1, 1]
sage: (M(m[2,1])*M(m[2,1])).to_symmetric_function()-m[2,1]*m[2,1]
0
TESTS:
sage: (M(0)).to_symmetric_function()
0
sage: (M([])).to_symmetric_function()
m[]
sage: (2*M([])).to_symmetric_function()
2*m[]
Return the result of the antipode applied to a quasi-symmetric Monomial basis element.
INPUT:
OUTPUT:
EXAMPLES:
sage: M = QuasiSymmetricFunctions(QQ).M()
sage: M.antipode_on_basis(Composition([2,1]))
M[1, 2] + M[3]
sage: M.antipode_on_basis(Composition([]))
M[]
Return the coproduct of a Monomial basis element.
Combinatorial rule: deconcatenation.
INPUT:
OUTPUT:
EXAMPLES:
sage: M=QuasiSymmetricFunctions(QQ).Monomial()
sage: M[4,2,3].coproduct()
M[] # M[4, 2, 3] + M[4] # M[2, 3] + M[4, 2] # M[3] + M[4, 2, 3] # M[]
sage: M.coproduct_on_basis(Composition([]))
M[] # M[]
Return the dual basis to the Monomial basis. This is the complete basis of the non-commutative symmetric functions.
OUTPUT:
EXAMPLES:
sage: M = QuasiSymmetricFunctions(QQ).M()
sage: M.dual()
Non-Commutative Symmetric Functions over the Rational Field in the Complete basis
Return the image of the monomial quasi-symmetric function
under the lambda-map
, expanded in the
monomial basis.
The ring of quasi-symmetric functions over the integers,
(and more generally, the ring of
quasi-symmetric functions over any binomial ring) becomes
a
-ring (with the
-structure inherited
from the ring of formal power series, so that
is
if
and
if
).
The Adams operations of this -ring are the
Frobenius endomorphisms
(see
frobenius()
for their definition). Using these endomorphisms, the
-operations can be explicitly computed via the formula
in the ring of formal power series in a variable over
the ring of quasi-symmetric functions. In particular,
every composition
satisfies
(corrected version of Remark 2.4 in [Haz2004]).
The quasi-symmetric functions with
ranging over the positive integers and
ranging over
the reduced Lyndon compositions (i. e., compositions
which are Lyndon words and have the gcd of their entries
equal to
) form a set of free polynomial generators
for
. See [Haz2004] for a major part
of the proof.
INPUT:
OUTPUT:
The quasi-symmetric function , expanded in
the monomial basis over the ground ring of self.
EXAMPLES:
sage: M = QuasiSymmetricFunctions(CyclotomicField()).Monomial()
sage: M.lambda_of_monomial([1, 2], 2)
2*M[1, 1, 2, 2] + M[1, 1, 4] + M[1, 2, 1, 2] + M[1, 3, 2] + M[2, 2, 2]
sage: M.lambda_of_monomial([1, 1], 2)
3*M[1, 1, 1, 1] + M[1, 1, 2] + M[1, 2, 1] + M[2, 1, 1]
sage: M = QuasiSymmetricFunctions(Integers(19)).Monomial()
sage: M.lambda_of_monomial([1, 2], 3)
6*M[1, 1, 1, 2, 2, 2] + 3*M[1, 1, 1, 2, 4] + 3*M[1, 1, 1, 4, 2]
+ M[1, 1, 1, 6] + 4*M[1, 1, 2, 1, 2, 2] + 2*M[1, 1, 2, 1, 4]
+ 2*M[1, 1, 2, 2, 1, 2] + 2*M[1, 1, 2, 3, 2] + 4*M[1, 1, 3, 2, 2]
+ 2*M[1, 1, 3, 4] + M[1, 1, 4, 1, 2] + M[1, 1, 5, 2]
+ 2*M[1, 2, 1, 1, 2, 2] + M[1, 2, 1, 1, 4] + M[1, 2, 1, 2, 1, 2]
+ M[1, 2, 1, 3, 2] + 4*M[1, 2, 2, 2, 2] + M[1, 2, 2, 4] + M[1, 2, 4, 2]
+ 2*M[1, 3, 1, 2, 2] + M[1, 3, 1, 4] + M[1, 3, 2, 1, 2] + M[1, 3, 3, 2]
+ M[1, 4, 2, 2] + 3*M[2, 1, 2, 2, 2] + M[2, 1, 2, 4] + M[2, 1, 4, 2]
+ 2*M[2, 2, 1, 2, 2] + M[2, 2, 1, 4] + M[2, 2, 2, 1, 2] + M[2, 2, 3, 2]
+ 2*M[2, 3, 2, 2] + M[2, 3, 4] + M[3, 2, 2, 2]
The map sends everything to
:
sage: M = QuasiSymmetricFunctions(ZZ).Monomial()
sage: all( M.lambda_of_monomial(I, 0) == M.one()
....: for I in Compositions(3) )
True
The map is the identity map:
sage: M = QuasiSymmetricFunctions(QQ).Monomial()
sage: all( M.lambda_of_monomial(I, 1) == M(I)
....: for I in Compositions(3) )
True
sage: M = QuasiSymmetricFunctions(Integers(5)).Monomial()
sage: all( M.lambda_of_monomial(I, 1) == M(I)
....: for I in Compositions(3) )
True
sage: M = QuasiSymmetricFunctions(ZZ).Monomial()
sage: all( M.lambda_of_monomial(I, 1) == M(I)
....: for I in Compositions(3) )
True
The product on Monomial basis elements.
The product of the basis elements indexed by two compositions
and
is the sum of the basis elements indexed by
compositions in the stuffle product (also called the
overlapping shuffle product) of
and
.
INPUT:
OUTPUT:
EXAMPLES:
sage: M = QuasiSymmetricFunctions(QQ).Monomial()
sage: c1 = Composition([2])
sage: c2 = Composition([1,3])
sage: M.product_on_basis(c1, c2)
M[1, 2, 3] + M[1, 3, 2] + M[1, 5] + M[2, 1, 3] + M[3, 3]
sage: M.product_on_basis(c1, Composition([]))
M[2]
Bases: sage.combinat.free_module.CombinatorialFreeModule, sage.misc.bindable_class.BindableClass
The Hopf algebra of quasi-symmetric function in the Quasisymmetric Schur basis.
The basis of Quasisymmetric Schur functions is defined in [QSCHUR] and in Definition 5.1.1 of [LMvW13]. Don’t mistake them for the completely unrelated quasi-Schur functions of [NCSF1]!
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: QS = QSym.QS()
sage: F = QSym.F()
sage: M = QSym.M()
sage: F(QS[1,2])
F[1, 2]
sage: M(QS[1,2])
M[1, 1, 1] + M[1, 2]
sage: s = SymmetricFunctions(QQ).s()
sage: QS(s[2,1,1])
QS[1, 1, 2] + QS[1, 2, 1] + QS[2, 1, 1]
Return the realization of the Monomial basis of the ring of quasi-symmetric functions.
OUTPUT:
EXAMPLES:
sage: QuasiSymmetricFunctions(QQ).a_realization()
Quasisymmetric functions over the Rational Field in the Monomial basis
Return the dual Hopf algebra of the quasi-symmetric functions, which is the non-commutative symmetric functions.
OUTPUT:
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: QSym.dual()
Non-Commutative Symmetric Functions over the Rational Field
Bases: sage.combinat.free_module.CombinatorialFreeModule, sage.misc.bindable_class.BindableClass
The dual immaculate basis of the quasi-symmetric functions.
This basis first appears in [BBSSZ2012].
REFERENCES:
[BBSSZ2012] | Chris Berg, Nantel Bergeron, Franco Saliola, Luis Serrano, Mike Zabrocki, A lift of the Schur and Hall-Littlewood bases to non-commutative symmetric functions, Arxiv 1208.5191v3. |
EXAMPLES:
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: dI = QSym.dI()
sage: dI([1,3,2])*dI([1]) # long time (6s on sage.math, 2013)
dI[1, 1, 3, 2] + dI[2, 3, 2]
sage: dI([1,3])*dI([1,1])
dI[1, 1, 1, 3] + dI[1, 1, 4] + dI[1, 2, 3] - dI[1, 3, 2] - dI[1, 4, 1] - dI[1, 5] + dI[2, 3, 1] + dI[2, 4]
sage: dI([3,1])*dI([2,1]) # long time (7s on sage.math, 2013)
dI[1, 1, 5] - dI[1, 4, 1, 1] - dI[1, 4, 2] - 2*dI[1, 5, 1] - dI[1, 6] - dI[2, 4, 1] - dI[2, 5] - dI[3, 1, 3] + dI[3, 2, 1, 1] + dI[3, 2, 2] + dI[3, 3, 1] + dI[4, 1, 1, 1] + 2*dI[4, 2, 1] + dI[4, 3] + dI[5, 1, 1] + dI[5, 2]
sage: F = QSym.F()
sage: dI(F[1,3,1])
-dI[1, 1, 1, 2] + dI[1, 1, 2, 1] - dI[1, 2, 2] + dI[1, 3, 1]
sage: F(dI(F([2,1,3])))
F[2, 1, 3]
Return the quasi-symmetric function in the Monomial basis corresponding to the quasi-symmetric polynomial f.
INPUT:
OUTPUT:
EXAMPLES:
sage: P = PolynomialRing(QQ, 'x', 3)
sage: x = P.gens()
sage: f = x[0] + x[1] + x[2]
sage: QSym = QuasiSymmetricFunctions(QQ)
sage: QSym.from_polynomial(f)
M[1]
Beware of setting check=False:
sage: f = x[0] + 2*x[1] + x[2]
sage: QSym.from_polynomial(f, check=True)
Traceback (most recent call last):
...
ValueError: x0 + 2*x1 + x2 is not a quasi-symmetric polynomial
sage: QSym.from_polynomial(f, check=False)
M[1]
To expand the quasi-symmetric function in a basis other than the Monomial basis, the following shorthands are provided:
sage: M = QSym.Monomial()
sage: f = x[0]**2+x[1]**2+x[2]**2
sage: g = M.from_polynomial(f); g
M[2]
sage: F = QSym.Fundamental()
sage: F(g)
-F[1, 1] + F[2]
sage: F.from_polynomial(f)
-F[1, 1] + F[2]