Composition species - Combinatorics

Skip to content
Back to top
View this page
Edit this page

# Composition species

class sage.combinat.species.composition_species.CompositionSpecies(F, G, min=None, max=None, weight=None)

  Bases: `GenericCombinatorialSpecies`, `UniqueRepresentation`

  Return the composition of two species.

  EXAMPLES:

  Sage

      sage: E = species.SetSpecies()
      sage: C = species.CycleSpecies()
      sage: S = E(C)
      sage: S.generating_series()[:5]
      [1, 1, 1, 1, 1]
      sage: E(C) is S
      True

  Python

      >>> from sage.all import *
      >>> E = species.SetSpecies()
      >>> C = species.CycleSpecies()
      >>> S = E(C)
      >>> S.generating_series()[:Integer(5)]
      [1, 1, 1, 1, 1]
      >>> E(C) is S
      True

  weight_ring()

    Return the weight ring for this species. This is determined by asking Sage’s coercion model what the result is when you multiply (and add) elements of the weight rings for each of the operands.

    EXAMPLES:

    Sage

        sage: E = species.SetSpecies(); C = species.CycleSpecies()
        sage: L = E(C)
        sage: L.weight_ring()
        Rational Field

    Python

        >>> from sage.all import *
        >>> E = species.SetSpecies(); C = species.CycleSpecies()
        >>> L = E(C)
        >>> L.weight_ring()
        Rational Field

class sage.combinat.species.composition_species.CompositionSpeciesStructure(parent, labels, pi, f, gs)

  Bases: `GenericSpeciesStructure`

  change_labels(labels)

    Return a relabelled structure.

    INPUT:

    - `labels` – list of labels

    OUTPUT:

    A structure with the \(i\)-th label of `self` replaced with the \(i\)-th label of the list.

    EXAMPLES:

    Sage

        sage: E = species.SetSpecies(); C = species.CycleSpecies()
        sage: L = E(C)
        sage: S = L.structures(['a','b','c']).list()                                # needs sage.libs.flint
        sage: a = S[2]; a                                                           # needs sage.libs.flint
        F-structure: {{'a', 'c'}, {'b'}}; G-structures: (('a', 'c'), ('b'))
        sage: a.change_labels([1,2,3])                                              # needs sage.libs.flint
        F-structure: {{1, 3}, {2}}; G-structures: [(1, 3), (2)]

    Python

        >>> from sage.all import *
        >>> E = species.SetSpecies(); C = species.CycleSpecies()
        >>> L = E(C)
        >>> S = L.structures(['a','b','c']).list()                                # needs sage.libs.flint
        >>> a = S[Integer(2)]; a                                                           # needs sage.libs.flint
        F-structure: {{'a', 'c'}, {'b'}}; G-structures: (('a', 'c'), ('b'))
        >>> a.change_labels([Integer(1),Integer(2),Integer(3)])                                              # needs sage.libs.flint
        F-structure: {{1, 3}, {2}}; G-structures: [(1, 3), (2)]

  transport(perm)

    EXAMPLES:

    Sage

        sage: p = PermutationGroupElement((2,3))                                    # needs sage.groups
        sage: E = species.SetSpecies(); C = species.CycleSpecies()
        sage: L = E(C)
        sage: S = L.structures(['a','b','c']).list()                                # needs sage.libs.flint
        sage: a = S[2]; a                                                           # needs sage.libs.flint
        F-structure: {{'a', 'c'}, {'b'}}; G-structures: (('a', 'c'), ('b'))
        sage: a.transport(p)                                                        # needs sage.groups sage.libs.flint
        F-structure: {{'a', 'b'}, {'c'}}; G-structures: (('a', 'c'), ('b'))

    Python

        >>> from sage.all import *
        >>> p = PermutationGroupElement((Integer(2),Integer(3)))                                    # needs sage.groups
        >>> E = species.SetSpecies(); C = species.CycleSpecies()
        >>> L = E(C)
        >>> S = L.structures(['a','b','c']).list()                                # needs sage.libs.flint
        >>> a = S[Integer(2)]; a                                                           # needs sage.libs.flint
        F-structure: {{'a', 'c'}, {'b'}}; G-structures: (('a', 'c'), ('b'))
        >>> a.transport(p)                                                        # needs sage.groups sage.libs.flint
        F-structure: {{'a', 'b'}, {'c'}}; G-structures: (('a', 'c'), ('b'))

sage.combinat.species.composition_species.CompositionSpecies_class

  alias of `CompositionSpecies`