Symmetric Functions in Non-Commuting Variables

AUTHORS:

  • Travis Scrimshaw (08-04-2013): Initial version
class sage.combinat.ncsym.ncsym.SymmetricFunctionsNonCommutingVariables(R)

Bases: sage.structure.unique_representation.UniqueRepresentation, sage.structure.parent.Parent

Symmetric functions in non-commutative variables.

The ring of symmetric functions in non-commutative variables, which is not to be confused with the non-commutative symmetric functions, is the ring of all bounded-degree noncommutative power series in countably many indeterminates (i.e., elements in \(R \langle \langle x_1, x_2, x_3, \ldots \rangle \rangle\) of bounded degree) which are invariant with respect to the action of the symmetric group \(S_{\infty}\) on the indices of the indeterminates. It can be regarded as a direct limit over all \(n \to \infty\) of rings of \(S_n\)-invariant polynomials in \(n\) non-commuting variables (that is, \(S_n\)-invariant elements of \(R\langle x_1, x_2, \ldots, x_n \rangle\)).

This ring is implemented as a Hopf algebra whose basis elements are indexed by set parititions.

Let \(A = \{A_1, A_2, \ldots, A_r\}\) be a set partition of the integers \(\{ 1, 2, \ldots, k \}\). A monomial basis element indexed by \(A\) represents the sum of monomials \(x_{i_1} x_{i_2} \cdots x_{i_k}\) where \(i_c = i_d\) if and only if \(c\) and \(d\) are in the same part \(A_i\) for some \(i\).

The \(k\)-th graded component of the ring of symmetric functions in non-commutative variables has its dimension equal to the number of set partitions of \(k\). (If we work, instead, with finitely many – say, \(n\) – variables, then its dimension is equal to the number of set partitions of \(k\) where the number of parts is at most \(n\).)

Note

All set partitions are considered standard, a set partition of \([n]\) for some \(n\), unless otherwise stated.

REFERENCES:

[BZ05]N. Bergeron, M. Zabrocki. The Hopf algebra of symmetric functions and quasisymmetric functions in non-commutative variables are free and cofree. (2005). Arxiv math/0509265v3.
[BHRZ06]N. Bergeron, C. Hohlweg, M. Rosas, M. Zabrocki. Grothendieck bialgebras, partition lattices, and symmetric functions in noncommutative variables. Electronic Journal of Combinatorics. 13 (2006).
[RS06]M. Rosas, B. Sagan. Symmetric functions in noncommuting variables. Trans. Amer. Math. Soc. 358 (2006). no. 1, 215-232. Arxiv math/0208168.
[BRRZ08]N. Bergeron, C. Reutenauer, M. Rosas, M. Zabrocki. Invariants and coinvariants of the symmetric group in noncommuting variables. Canad. J. Math. 60 (2008). 266-296. http://www.lacim.uqam.ca/~christo/Publi%C3%A9s/2008/NBergeronRosasZabrocki.pdf

EXAMPLES:

We begin by first creating the ring of \(NCSym\) and the bases that are analogues of the usual symmetric functions:

sage: NCSym = SymmetricFunctionsNonCommutingVariables(QQ)
sage: m = NCSym.m()
sage: e = NCSym.e()
sage: h = NCSym.h()
sage: p = NCSym.p()
sage: m
Symmetric functions in non-commuting variables over the Rational Field in the monomial basis

The basis is indexed by set partitions, so we create a few elements and convert them between these bases:

sage: elt = m(SetPartition([[1,3],[2]])) - 2*m(SetPartition([[1],[2]])); elt
-2*m{{1}, {2}} + m{{1, 3}, {2}}
sage: e(elt)
1/2*e{{1}, {2, 3}} - 2*e{{1, 2}} + 1/2*e{{1, 2}, {3}} - 1/2*e{{1, 2, 3}} - 1/2*e{{1, 3}, {2}}
sage: h(elt)
-4*h{{1}, {2}} - 2*h{{1}, {2}, {3}} + 1/2*h{{1}, {2, 3}} + 2*h{{1, 2}}
 + 1/2*h{{1, 2}, {3}} - 1/2*h{{1, 2, 3}} + 3/2*h{{1, 3}, {2}}
sage: p(elt)
-2*p{{1}, {2}} + 2*p{{1, 2}} - p{{1, 2, 3}} + p{{1, 3}, {2}}
sage: m(p(elt))
-2*m{{1}, {2}} + m{{1, 3}, {2}}

sage: elt = p(SetPartition([[1,3],[2]])) - 4*p(SetPartition([[1],[2]])) + 2; elt
2*p{} - 4*p{{1}, {2}} + p{{1, 3}, {2}}
sage: e(elt)
2*e{} - 4*e{{1}, {2}} + e{{1}, {2}, {3}} - e{{1, 3}, {2}}
sage: m(elt)
2*m{} - 4*m{{1}, {2}} - 4*m{{1, 2}} + m{{1, 2, 3}} + m{{1, 3}, {2}}
sage: h(elt)
2*h{} - 4*h{{1}, {2}} - h{{1}, {2}, {3}} + h{{1, 3}, {2}}
sage: p(m(elt))
2*p{} - 4*p{{1}, {2}} + p{{1, 3}, {2}}

There is also a shorthand for creating elements. We note that we must use p[[]] to create the empty set partition due to python’s syntax.

sage: eltm = m[[1,3],[2]] - 3*m[[1],[2]]; eltm
-3*m{{1}, {2}} + m{{1, 3}, {2}}
sage: elte = e[[1,3],[2]]; elte
e{{1, 3}, {2}}
sage: elth = h[[1,3],[2,4]]; elth
h{{1, 3}, {2, 4}}
sage: eltp = p[[1,3],[2,4]] + 2*p[[1]] - 4*p[[]]; eltp
-4*p{} + 2*p{{1}} + p{{1, 3}, {2, 4}}

There is also a natural projection to the usual symmetric functions by letting the variables commute. This projection map preserves the product and coproduct structure. We check that Theorem 2.1 of [RS06] holds:

sage: Sym = SymmetricFunctions(QQ)
sage: Sm = Sym.m()
sage: Se = Sym.e()
sage: Sh = Sym.h()
sage: Sp = Sym.p()
sage: eltm.to_symmetric_function()
-6*m[1, 1] + m[2, 1]
sage: Sm(p(eltm).to_symmetric_function())
-6*m[1, 1] + m[2, 1]
sage: elte.to_symmetric_function()
2*e[2, 1]
sage: Se(h(elte).to_symmetric_function())
2*e[2, 1]
sage: elth.to_symmetric_function()
4*h[2, 2]
sage: Sh(m(elth).to_symmetric_function())
4*h[2, 2]
sage: eltp.to_symmetric_function()
-4*p[] + 2*p[1] + p[2, 2]
sage: Sp(e(eltp).to_symmetric_function())
-4*p[] + 2*p[1] + p[2, 2]
a_realization()

Return the realization of the powersum basis of self.

OUTPUT:

  • The powersum basis of symmetric functions in non-commuting variables.

EXAMPLES:

sage: SymmetricFunctionsNonCommutingVariables(QQ).a_realization()
Symmetric functions in non-commuting variables over the Rational Field in the powersum basis
dual()

Return the dual Hopf algebra of the symmetric functions in non-commuting variables.

EXAMPLES:

sage: SymmetricFunctionsNonCommutingVariables(QQ).dual()
Dual symmetric functions in non-commuting variables over the Rational Field
class elementary(NCSym)

Bases: sage.combinat.ncsym.bases.NCSymBasis_abstract

The Hopf algebra of symmetric functions in non-commuting variables in the elementary basis.

EXAMPLES:

sage: NCSym = SymmetricFunctionsNonCommutingVariables(QQ)
sage: e = NCSym.e()
Element

alias of elementary.Element

class SymmetricFunctionsNonCommutingVariables.homogeneous(NCSym)

Bases: sage.combinat.ncsym.bases.NCSymBasis_abstract

The Hopf algebra of symmetric functions in non-commuting variables in the homogeneous basis.

EXAMPLES:

sage: NCSym = SymmetricFunctionsNonCommutingVariables(QQ)
sage: h = NCSym.h()
Element

alias of homogeneous.Element

class SymmetricFunctionsNonCommutingVariables.monomial(NCSym)

Bases: sage.combinat.ncsym.bases.NCSymBasis_abstract

The Hopf algebra of symmetric functions in non-commuting variables in the monomial basis.

EXAMPLES:

sage: NCSym = SymmetricFunctionsNonCommutingVariables(QQ)
sage: m = NCSym.m()
Element

alias of monomial.Element

coproduct_on_basis(A)

Return the coproduct of a monomial basis element.

INPUT:

  • A – a set partition

OUTPUT:

  • The coproduct applied to the monomial symmetric function in non-commuting variables indexed by A expressed in the monomial basis.

EXAMPLES:

sage: m = SymmetricFunctionsNonCommutingVariables(QQ).monomial()
sage: m[[1, 3], [2]].coproduct()
m{} # m{{1, 3}, {2}} + m{{1}} # m{{1, 2}} + m{{1, 2}} # m{{1}} + m{{1, 3}, {2}} # m{}
sage: m.coproduct_on_basis(SetPartition([]))
m{} # m{}
sage: m.coproduct_on_basis(SetPartition([[1,2,3]]))
m{} # m{{1, 2, 3}} + m{{1, 2, 3}} # m{}
sage: m[[1,5],[2,4],[3,7],[6]].coproduct()
m{} # m{{1, 5}, {2, 4}, {3, 7}, {6}} + m{{1}} # m{{1, 5}, {2, 4}, {3, 6}}
 + 2*m{{1, 2}} # m{{1, 3}, {2, 5}, {4}} + m{{1, 2}} # m{{1, 4}, {2, 3}, {5}}
 + 2*m{{1, 2}, {3}} # m{{1, 3}, {2, 4}} + m{{1, 3}, {2}} # m{{1, 4}, {2, 3}}
 + 2*m{{1, 3}, {2, 4}} # m{{1, 2}, {3}} + 2*m{{1, 3}, {2, 5}, {4}} # m{{1, 2}}
 + m{{1, 4}, {2, 3}} # m{{1, 3}, {2}} + m{{1, 4}, {2, 3}, {5}} # m{{1, 2}}
 + m{{1, 5}, {2, 4}, {3, 6}} # m{{1}} + m{{1, 5}, {2, 4}, {3, 7}, {6}} # m{}
dual_basis()

Return the dual basis to the monomial basis.

OUTPUT:

  • the \(\mathbf{w}\) basis of the dual Hopf algebra

EXAMPLES:

sage: m = SymmetricFunctionsNonCommutingVariables(QQ).m()
sage: m.dual_basis()
Dual symmetric functions in non-commuting variables over the Rational Field in the w basis
duality_pairing(x, y)

Compute the pairing between an element of self and an element of the dual.

INPUT:

  • x – an element of symmetric functions in non-commuting variables
  • y – an element of the dual of symmetric functions in non-commuting variables

OUTPUT:

  • an element of the base ring of self

EXAMPLES:

sage: NCSym = SymmetricFunctionsNonCommutingVariables(QQ)
sage: m = NCSym.m()
sage: w = m.dual_basis()
sage: matrix([[m(A).duality_pairing(w(B)) for A in SetPartitions(3)] for B in SetPartitions(3)])
[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]
sage: (m[[1,2],[3]] + 3*m[[1,3],[2]]).duality_pairing(2*w[[1,3],[2]] + w[[1,2,3]] + 2*w[[1,2],[3]])
8
from_symmetric_function(f)

Return the image of the symmetric function f in self.

This is performed by converting to the monomial basis and extending the method sum_of_partitions() linearly. This is a linear map from the symmetric functions to the symmetric functions in non-commuting variables that does not preserve the product or coproduct structure of the Hopf algebra.

See also

to_symmetric_function()

INPUT:

  • f – an element of the symmetric functions

OUTPUT:

  • An element of the \(\mathbf{m}\) basis

EXAMPLES:

sage: m = SymmetricFunctionsNonCommutingVariables(QQ).m()
sage: mon = SymmetricFunctions(QQ).m()
sage: elt = m.from_symmetric_function(mon[2,1,1]); elt
1/12*m{{1}, {2}, {3, 4}} + 1/12*m{{1}, {2, 3}, {4}} + 1/12*m{{1}, {2, 4}, {3}}
 + 1/12*m{{1, 2}, {3}, {4}} + 1/12*m{{1, 3}, {2}, {4}} + 1/12*m{{1, 4}, {2}, {3}}
sage: elt.to_symmetric_function()
m[2, 1, 1]
sage: e = SymmetricFunctionsNonCommutingVariables(QQ).e()
sage: elm = SymmetricFunctions(QQ).e()
sage: e(m.from_symmetric_function(elm[4]))
1/24*e{{1, 2, 3, 4}}
sage: h = SymmetricFunctionsNonCommutingVariables(QQ).h()
sage: hom = SymmetricFunctions(QQ).h()
sage: h(m.from_symmetric_function(hom[4]))
1/24*h{{1, 2, 3, 4}}
sage: p = SymmetricFunctionsNonCommutingVariables(QQ).p()
sage: pow = SymmetricFunctions(QQ).p()
sage: p(m.from_symmetric_function(pow[4]))
p{{1, 2, 3, 4}}
sage: p(m.from_symmetric_function(pow[2,1]))
1/3*p{{1}, {2, 3}} + 1/3*p{{1, 2}, {3}} + 1/3*p{{1, 3}, {2}}
sage: p([[1,2]])*p([[1]])
p{{1, 2}, {3}}

Check that \(\chi \circ \widetilde{\chi}\) is the identity on \(Sym\):

sage: all(m.from_symmetric_function(pow(la)).to_symmetric_function() == pow(la)
....:     for la in Partitions(4))
True
internal_coproduct_on_basis(A)

Return the internal coproduct of a monomial basis element.

The internal coproduct is defined by

\[\Delta^{\odot}(\mathbf{m}_A) = \sum_{B \wedge C = A} \mathbf{m}_B \otimes \mathbf{m}_C\]

where we sum over all pairs of set partitions \(B\) and \(C\) whose infimum is \(A\).

INPUT:

  • A – a set partition

OUTPUT:

  • an element of the tensor square of the \(\mathbf{m}\) basis

EXAMPLES:

sage: m = SymmetricFunctionsNonCommutingVariables(QQ).monomial()
sage: m.internal_coproduct_on_basis(SetPartition([[1,3],[2]]))
m{{1, 2, 3}} # m{{1, 3}, {2}} + m{{1, 3}, {2}} # m{{1, 2, 3}} + m{{1, 3}, {2}} # m{{1, 3}, {2}}
product_on_basis(A, B)

The product on monomial basis elements.

The product of the basis elements indexed by two set partitions \(A\) and \(B\) is the sum of the basis elements indexed by set partitions \(C\) such that \(C \wedge ([n] | [k]) = A | B\) where \(n = |A|\) and \(k = |B|\). Here \(A \wedge B\) is the infimum of \(A\) and \(B\) and \(A | B\) is the pipe() operation. Equivalently we can describe all \(C\) as matchings between the partitions of \(A\) and \(B\) where if \(a \in A\) is matched with \(b \in B\), we take \(a \cup b\) instead of \(a\) and \(b\) in \(C\).

INPUT:

  • A, B – set partitions

OUTPUT:

  • an element of the \(\mathbf{m}\) basis

EXAMPLES:

sage: m = SymmetricFunctionsNonCommutingVariables(QQ).monomial()
sage: A = SetPartition([[1], [2,3]])
sage: B = SetPartition([[1], [3], [2,4]])
sage: m.product_on_basis(A, B)
m{{1}, {2, 3}, {4}, {5, 7}, {6}} + m{{1}, {2, 3, 4}, {5, 7}, {6}}
 + m{{1}, {2, 3, 5, 7}, {4}, {6}} + m{{1}, {2, 3, 6}, {4}, {5, 7}}
 + m{{1, 4}, {2, 3}, {5, 7}, {6}} + m{{1, 4}, {2, 3, 5, 7}, {6}}
 + m{{1, 4}, {2, 3, 6}, {5, 7}} + m{{1, 5, 7}, {2, 3}, {4}, {6}}
 + m{{1, 5, 7}, {2, 3, 4}, {6}} + m{{1, 5, 7}, {2, 3, 6}, {4}}
 + m{{1, 6}, {2, 3}, {4}, {5, 7}} + m{{1, 6}, {2, 3, 4}, {5, 7}}
 + m{{1, 6}, {2, 3, 5, 7}, {4}}
sage: B = SetPartition([[1], [2]])
sage: m.product_on_basis(A, B)
m{{1}, {2, 3}, {4}, {5}} + m{{1}, {2, 3, 4}, {5}}
 + m{{1}, {2, 3, 5}, {4}} + m{{1, 4}, {2, 3}, {5}} + m{{1, 4}, {2, 3, 5}}
 + m{{1, 5}, {2, 3}, {4}} + m{{1, 5}, {2, 3, 4}}
sage: m.product_on_basis(A, SetPartition([]))
m{{1}, {2, 3}}

TESTS:

We check that we get all of the correct set partitions:

sage: m = SymmetricFunctionsNonCommutingVariables(QQ).monomial()
sage: A = SetPartition([[1], [2,3]])
sage: B = SetPartition([[1], [2]])
sage: S = SetPartition([[1,2,3], [4,5]])
sage: AB = SetPartition([[1], [2,3], [4], [5]])
sage: L = sorted(filter(lambda x: S.inf(x) == AB, SetPartitions(5)), key=str)
sage: map(list, L) == map(list, sorted(m.product_on_basis(A, B).support(), key=str))
True
sum_of_partitions(la)

Return the sum over all set partitions whose shape is la with a fixed coefficient \(C\) defined below.

Fix a partition \(\lambda\), we define \(\lambda! := \prod_i \lambda_i!\) and \(\lambda^! := \prod_i m_i!\). Recall that \(|\lambda| = \sum_i \lambda_i\) and \(m_i\) is the number of parts of length \(i\) of \(\lambda\). Thus we defined the coefficient as

\[C := \frac{\lambda! \lambda^!}{|\lambda|!}.\]

Hence we can define a lift \(\widetilde{\chi}\) from \(Sym\) to \(NCSym\) by

\[m_{\lambda} \mapsto C \sum_A \mathbf{m}_A\]

where the sum is over all set partitions whose shape is \(\lambda\).

INPUT:

  • la – an integer partition

OUTPUT:

  • an element of the \(\mathbf{m}\) basis

EXAMPLES:

sage: m = SymmetricFunctionsNonCommutingVariables(QQ).m()
sage: m.sum_of_partitions(Partition([2,1,1]))
1/12*m{{1}, {2}, {3, 4}} + 1/12*m{{1}, {2, 3}, {4}} + 1/12*m{{1}, {2, 4}, {3}}
 + 1/12*m{{1, 2}, {3}, {4}} + 1/12*m{{1, 3}, {2}, {4}} + 1/12*m{{1, 4}, {2}, {3}}

TESTS:

Check that \(\chi \circ \widetilde{\chi}\) is the identity on \(Sym\):

sage: m = SymmetricFunctionsNonCommutingVariables(QQ).m()
sage: mon = SymmetricFunctions(QQ).monomial()
sage: all(m.from_symmetric_function(mon[la]).to_symmetric_function() == mon[la]
....:     for i in range(6) for la in Partitions(i))
True
class SymmetricFunctionsNonCommutingVariables.powersum(NCSym)

Bases: sage.combinat.ncsym.bases.NCSymBasis_abstract

The Hopf algebra of symmetric functions in non-commuting variables in the powersum basis.

EXAMPLES:

sage: NCSym = SymmetricFunctionsNonCommutingVariables(QQ)
sage: p = NCSym.p()
Element

alias of powersum.Element

antipode_on_basis(A)

Return the result of the antipode applied to a powersum basis element.

Let \(A\) be a set partition. The antipode given in [LM2011] is

\[S(\mathbf{p}_A) = \sum_{\gamma} (-1)^{\ell(\gamma)} \mathbf{p}_{\gamma[A]}\]

where we sum over all ordered set partitions (i.e. set compositions) of \([\ell(A)]\) and

\[\gamma[A] = A_{\gamma_1}^{\downarrow} | \cdots | A_{\gamma_{\ell(A)}}^{\downarrow}\]

is the action of \(\gamma\) on \(A\) defined in SetPartition.ordered_set_partition_action().

INPUT:

  • A – a set partition

OUTPUT:

  • an element in the basis self

EXAMPLES:

sage: p = SymmetricFunctionsNonCommutingVariables(QQ).powersum()
sage: p.antipode_on_basis(SetPartition([[1], [2,3]]))
p{{1, 2}, {3}}
sage: p.antipode_on_basis(SetPartition([]))
p{}
sage: F = p[[1,3],[5],[2,4]].coproduct()
sage: F.apply_multilinear_morphism(lambda x,y: x.antipode()*y)
0
coproduct_on_basis(A)

Return the coproduct of a monomial basis element.

INPUT:

  • A – a set partition

OUTPUT:

  • The coproduct applied to the monomial symmetric function in non-commuting variables indexed by A expressed in the monomial basis.

EXAMPLES:

sage: p = SymmetricFunctionsNonCommutingVariables(QQ).powersum()
sage: p[[1, 3], [2]].coproduct()
p{} # p{{1, 3}, {2}} + p{{1}} # p{{1, 2}} + p{{1, 2}} # p{{1}} + p{{1, 3}, {2}} # p{}
sage: p.coproduct_on_basis(SetPartition([[1]]))
p{} # p{{1}} + p{{1}} # p{}
sage: p.coproduct_on_basis(SetPartition([]))
p{} # p{}
internal_coproduct_on_basis(A)

Return the internal coproduct of a powersum basis element.

The internal coproduct is defined by

\[\Delta^{\odot}(\mathbf{p}_A) = \mathbf{p}_A \otimes \mathbf{p}_A\]

INPUT:

  • A – a set partition

OUTPUT:

  • an element of the tensor square of self

EXAMPLES:

sage: p = SymmetricFunctionsNonCommutingVariables(QQ).powersum()
sage: p.internal_coproduct_on_basis(SetPartition([[1,3],[2]]))
p{{1, 3}, {2}} # p{{1, 3}, {2}}
primitive(A, i=1)

Return the primitive associated to A in self.

Fix some \(i \in S\). Let \(A\) be an atomic set partition of \(S\), then the primitive \(p(A)\) given in [LM2011] is

\[p(A) = \sum_{\gamma} (-1)^{\ell(\gamma)-1} \mathbf{p}_{\gamma[A]}\]

where we sum over all ordered set partitions of \([\ell(A)]\) such that \(i \in \gamma_1\) and \(\gamma[A]\) is the action of \(\gamma\) on \(A\) defined in SetPartition.ordered_set_partition_action(). If \(A\) is not atomic, then \(p(A) = 0\).

INPUT:

  • A – a set partition
  • i – (default: 1) index in the base set for A specifying which set of primitives this belongs to

OUTPUT:

  • an element in the basis self

EXAMPLES:

sage: p = SymmetricFunctionsNonCommutingVariables(QQ).powersum()
sage: elt = p.primitive(SetPartition([[1,3], [2]])); elt
-p{{1, 2}, {3}} + p{{1, 3}, {2}}
sage: elt.coproduct()
-p{} # p{{1, 2}, {3}} + p{} # p{{1, 3}, {2}} - p{{1, 2}, {3}} # p{} + p{{1, 3}, {2}} # p{}
sage: p.primitive(SetPartition([[1], [2,3]]))
0
sage: p.primitive(SetPartition([]))
p{}
class SymmetricFunctionsNonCommutingVariables.q(NCSym)

Bases: sage.combinat.ncsym.bases.NCSymBasis_abstract

The Hopf algebra of symmetric functions in non-commuting variables in the \(\mathbf{q}\) basis.

This basis was defined in [BZ05] as

\[\mathbf{q}_A = \sum_{A \leq_* B} \mathbf{m}_B\]

where we sum over all strict coarsenings of the set partition \(A\).

EXAMPLES:

sage: NCSym = SymmetricFunctionsNonCommutingVariables(QQ)
sage: q = NCSym.q()
class SymmetricFunctionsNonCommutingVariables.x(NCSym)

Bases: sage.combinat.ncsym.bases.NCSymBasis_abstract

The Hopf algebra of symmetric functions in non-commuting variables in the \(\mathbf{x}\) basis.

This basis is defined in [BHRZ06] by the formula:

\[\mathbf{x}_A = \sum_{B \leq A} \mu(B, A) \mathbf{p}_B\]

and has the following properties:

\[\mathbf{x}_A \mathbf{x}_B = \mathbf{x}_{A|B}, \quad \quad \Delta^{\odot}(\mathbf{x}_C) = \sum_{A \vee B = C} \mathbf{x}_A \otimes \mathbf{x}_B.\]

EXAMPLES:

sage: NCSym = SymmetricFunctionsNonCommutingVariables(QQ)
sage: x = NCSym.x()
sage.combinat.ncsym.ncsym.matchings(A, B)

Iterate through all matchings of the sets \(A\) and \(B\).

EXAMPLES:

sage: from sage.combinat.ncsym.ncsym import matchings
sage: list(matchings([1, 2, 3], [-1, -2]))
[[[1], [2], [3], [-1], [-2]],
 [[1], [2], [3, -1], [-2]],
 [[1], [2], [3, -2], [-1]],
 [[1], [2, -1], [3], [-2]],
 [[1], [2, -1], [3, -2]],
 [[1], [2, -2], [3], [-1]],
 [[1], [2, -2], [3, -1]],
 [[1, -1], [2], [3], [-2]],
 [[1, -1], [2], [3, -2]],
 [[1, -1], [2, -2], [3]],
 [[1, -2], [2], [3], [-1]],
 [[1, -2], [2], [3, -1]],
 [[1, -2], [2, -1], [3]]]

Previous topic

Dual Symmetric Functions in Non-Commuting Variables

Next topic

Root Systems

This Page