# Recursive Species¶

class sage.combinat.species.recursive_species.CombinatorialSpecies

EXAMPLES:

sage: F = CombinatorialSpecies()
Combinatorial species

sage: X = species.SingletonSpecies()
sage: E = species.EmptySetSpecies()
sage: L = CombinatorialSpecies()
sage: L.define(E+X*L)
sage: L.generating_series().coefficients(4)
[1, 1, 1, 1]
sage: LL.generating_series().coefficients(4)
[1, 1, 1, 1]

define(x)

Define self to be equal to the combinatorial species x.

This is used to define combinatorial species recursively. All of the real work is done by calling the .set() method for each of the series associated to self.

EXAMPLES: The species of linear orders L can be recursively defined by $$L = 1 + X*L$$ where 1 represents the empty set species and X represents the singleton species.

sage: X = species.SingletonSpecies()
sage: E = species.EmptySetSpecies()
sage: L = CombinatorialSpecies()
sage: L.define(E+X*L)
sage: L.generating_series().coefficients(4)
[1, 1, 1, 1]
sage: L.structures([1,2,3]).cardinality()
6
sage: L.structures([1,2,3]).list()
[1*(2*(3*{})),
1*(3*(2*{})),
2*(1*(3*{})),
2*(3*(1*{})),
3*(1*(2*{})),
3*(2*(1*{}))]

sage: L = species.LinearOrderSpecies()
sage: L.generating_series().coefficients(4)
[1, 1, 1, 1]
sage: L.structures([1,2,3]).cardinality()
6
sage: L.structures([1,2,3]).list()
[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]

weight_ring()

EXAMPLES:

sage: F = species.CombinatorialSpecies()
sage: F.weight_ring()
Rational Field

sage: X = species.SingletonSpecies()
sage: E = species.EmptySetSpecies()
sage: L = CombinatorialSpecies()
sage: L.define(E+X*L)
sage: L.weight_ring()
Rational Field

class sage.combinat.species.recursive_species.CombinatorialSpeciesStructure(parent, s, **options)