Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 235f69b

Browse files
committed
implement the inclusion NCSym -> WQSym
1 parent 7394bf7 commit 235f69b

File tree

2 files changed

+67
-8
lines changed

2 files changed

+67
-8
lines changed

src/sage/combinat/ncsym/bases.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,62 @@ def to_symmetric_function(self):
603603
m = self.parent().realization_of().monomial()
604604
return m(self).to_symmetric_function()
605605

606+
def to_wqsym(self):
607+
r"""
608+
Return the image of ``self`` under the canonical
609+
inclusion map `NCSym \to WQSym`.
610+
611+
The canonical inclusion map `NCSym \to WQSym` is
612+
an injective homomorphism of algebras. It sends a
613+
basis element `\mathbf{m}_A` of `NCSym` to the sum of
614+
basis elements `\mathbf{M}_P` of `WQSym`, where `P`
615+
ranges over all ordered set partitions that become
616+
`A` when the ordering is forgotten.
617+
This map is denoted by `\theta` in [BZ05]_ (17).
618+
619+
.. SEEALSO::
620+
621+
:class:`WordQuasisymmetricFunctions` for a
622+
definition of `WQSym`.
623+
624+
EXAMPLES::
625+
626+
sage: NCSym = SymmetricFunctionsNonCommutingVariables(QQ)
627+
sage: e = NCSym.e()
628+
sage: h = NCSym.h()
629+
sage: p = NCSym.p()
630+
sage: cp = NCSym.cp()
631+
sage: x = NCSym.x()
632+
sage: m = NCSym.m()
633+
sage: m[[1,3],[2]].to_wqsym()
634+
M[{2}, {1, 3}] + M[{1, 3}, {2}]
635+
sage: x[[1,3],[2]].to_wqsym()
636+
-M[{1}, {3}, {2}] - M[{2}, {1}, {3}] - M[{1, 2}, {3}]
637+
- M[{2, 3}, {1}] - M[{1}, {2}, {3}] - M[{3}, {2}, {1}]
638+
- M[{3}, {1}, {2}] - M[{3}, {1, 2}] - M[{2}, {3}, {1}]
639+
- M[{1}, {2, 3}]
640+
sage: (4*p[[1,3],[2]]-p[[1]]).to_wqsym()
641+
4*M[{1, 2, 3}] + 4*M[{2}, {1, 3}] + 4*M[{1, 3}, {2}] - M[{1}]
642+
"""
643+
parent = self.parent()
644+
NCSym = parent.realization_of()
645+
R = parent.base_ring()
646+
one = R.one()
647+
m = NCSym.monomial()
648+
from sage.combinat.chas.wqsym import WordQuasisymmetricFunctions
649+
from sage.combinat.set_partition_ordered import OrderedSetPartition
650+
M = WordQuasisymmetricFunctions(R).M()
651+
from itertools import permutations
652+
def to_wqsym_on_m_basis(A):
653+
# Return the image of `\mathbf{m}_A` under the inclusion
654+
# map `NCSym \to WQSym`.
655+
l = len(A)
656+
return M.sum_of_terms([(OrderedSetPartition([A[u[i]] for i in range(l)]), 1)
657+
for u in permutations(range(l))],
658+
distinct=True)
659+
return M.sum(coeff * to_wqsym_on_m_basis(A)
660+
for A, coeff in m(self))
661+
606662
def internal_coproduct(self):
607663
"""
608664
Return the internal coproduct of ``self``.

src/sage/combinat/ncsym/ncsym.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,23 @@ class SymmetricFunctionsNonCommutingVariables(UniqueRepresentation, Parent):
162162
indexed by set partitions.
163163
164164
Let `A = \{A_1, A_2, \ldots, A_r\}` be a set partition of the integers
165-
`\{ 1, 2, \ldots, k \}`. A monomial basis element indexed by `A`
166-
represents the sum of monomials `x_{i_1} x_{i_2} \cdots x_{i_k}` where
167-
`i_c = i_d` if and only if `c` and `d` are in the same part `A_i` for some `i`.
165+
`[k] := \{ 1, 2, \ldots, k \}`. This partition `A` determines an
166+
equivalence relation `~_A` on `[k]`, which has `c ~_A d` if and
167+
only if `c` and `d` are in the same part `A_j` of `A`.
168+
The monomial basis element `\mathbf{m}_A` indexed by `A` is the sum of
169+
monomials `x_{i_1} x_{i_2} \cdots x_{i_k}` such that `i_c = i_d` if
170+
and only if `c ~_A d`.
168171
169172
The `k`-th graded component of the ring of symmetric functions in
170173
non-commutative variables has its dimension equal to the number of
171-
set partitions of `k`. (If we work, instead, with finitely many --
174+
set partitions of `[k]`. (If we work, instead, with finitely many --
172175
say, `n` -- variables, then its dimension is equal to the number of
173-
set partitions of `k` where the number of parts is at most `n`.)
176+
set partitions of `[k]` where the number of parts is at most `n`.)
174177
175178
.. NOTE::
176179
177-
All set partitions are considered standard, a set partition of `[n]`
178-
for some `n`, unless otherwise stated.
180+
All set partitions are considered standard (i.e., set partitions
181+
of `[n]` for some `n`) unless otherwise stated.
179182
180183
REFERENCES:
181184
@@ -537,7 +540,7 @@ def product_on_basis(self, A, B):
537540
and `A | B` is the
538541
:meth:`SetPartition.pipe` operation.
539542
Equivalently we can describe all `C` as matchings between the
540-
partitions of `A` and `B` where if `a \in A` is matched
543+
parts of `A` and `B` where if `a \in A` is matched
541544
with `b \in B`, we take `a \cup b` instead of `a` and `b` in `C`.
542545
543546
INPUT:

0 commit comments

Comments
 (0)