Sum species - Combinatorics

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

# Sum species

class sage.combinat.species.sum_species.SumSpecies(F, G, min=None, max=None, weight=None)

  Bases: `GenericCombinatorialSpecies`, `UniqueRepresentation`

  Return the sum of two species.

  EXAMPLES:

  Sage

      sage: S = species.PermutationSpecies()
      doctest:warning...
      DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
      See https://github.com/sagemath/sage/issues/38544 for details.
      sage: A = S+S
      sage: A.generating_series()[:5]
      [2, 2, 2, 2, 2]

      sage: P = species.PermutationSpecies()
      sage: F = P + P
      sage: F._check()                                                            # needs sage.libs.flint
      True
      sage: F == loads(dumps(F))
      True

  Python

      >>> from sage.all import *
      >>> S = species.PermutationSpecies()
      doctest:warning...
      DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
      See https://github.com/sagemath/sage/issues/38544 for details.
      >>> A = S+S
      >>> A.generating_series()[:Integer(5)]
      [2, 2, 2, 2, 2]

      >>> P = species.PermutationSpecies()
      >>> F = P + P
      >>> F._check()                                                            # needs sage.libs.flint
      True
      >>> F == loads(dumps(F))
      True

  left_summand()

    Return the left summand of this species.

    EXAMPLES:

    Sage

        sage: P = species.PermutationSpecies()
        sage: F = P + P*P
        sage: F.left_summand()
        Permutation species

    Python

        >>> from sage.all import *
        >>> P = species.PermutationSpecies()
        >>> F = P + P*P
        >>> F.left_summand()
        Permutation species

  right_summand()

    Return the right summand of this species.

    EXAMPLES:

    Sage

        sage: P = species.PermutationSpecies()
        sage: F = P + P*P
        sage: F.right_summand()
        Product of (Permutation species) and (Permutation species)

    Python

        >>> from sage.all import *
        >>> P = species.PermutationSpecies()
        >>> F = P + P*P
        >>> F.right_summand()
        Product of (Permutation species) and (Permutation species)

  weight_ring()

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

    EXAMPLES:

    Sage

        sage: S = species.SetSpecies()
        sage: C = S+S
        sage: C.weight_ring()
        Rational Field

    Python

        >>> from sage.all import *
        >>> S = species.SetSpecies()
        >>> C = S+S
        >>> C.weight_ring()
        Rational Field

    Sage

        sage: S = species.SetSpecies(weight=QQ['t'].gen())
        sage: C = S + S
        sage: C.weight_ring()
        Univariate Polynomial Ring in t over Rational Field

    [Python]

        >>> from sage.all import *
        >>> S = species.SetSpecies(weight=QQ['t'].gen())
        >>> C = S + S
        >>> C.weight_ring()
        Univariate Polynomial Ring in t over Rational Field

class sage.combinat.species.sum_species.SumSpeciesStructure(parent, s, **options)

  Bases: `SpeciesStructureWrapper`

sage.combinat.species.sum_species.SumSpecies_class

  alias of `SumSpecies`