Recursive Species#
- class sage.combinat.species.recursive_species.CombinatorialSpecies(min=None)#
Bases:
sage.combinat.species.species.GenericCombinatorialSpecies
EXAMPLES:
sage: F = CombinatorialSpecies() sage: loads(dumps(F)) Combinatorial species
sage: X = species.SingletonSpecies() sage: E = species.EmptySetSpecies() sage: L = CombinatorialSpecies() sage: L.define(E+X*L) sage: L.generating_series()[0:4] [1, 1, 1, 1] sage: LL = loads(dumps(L)) sage: LL.generating_series()[0:4] [1, 1, 1, 1]
- define(x)#
Define
self
to be equal to the combinatorial speciesx
.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()[0: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()[0: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)#
Bases:
sage.combinat.species.structure.SpeciesStructureWrapper