# Examples of Combinatorial Species#

sage.combinat.species.library.BinaryForestSpecies()[source]#

Return the species of binary forests.

Binary forests are defined as sets of binary trees.

EXAMPLES:

sage: F = species.BinaryForestSpecies()
sage: F.generating_series().counts(10)
[1, 1, 3, 19, 193, 2721, 49171, 1084483, 28245729, 848456353]
sage: F.isotype_generating_series().counts(10)                                  # needs sage.modules
[1, 1, 2, 4, 10, 26, 77, 235, 758, 2504]
sage: F.cycle_index_series()[:7]                                                # needs sage.modules
[p[],
p[1],
3/2*p[1, 1] + 1/2*p[2],
19/6*p[1, 1, 1] + 1/2*p[2, 1] + 1/3*p[3],
193/24*p[1, 1, 1, 1] + 3/4*p[2, 1, 1] + 5/8*p[2, 2] + 1/3*p[3, 1] + 1/4*p[4],
907/40*p[1, 1, 1, 1, 1] + 19/12*p[2, 1, 1, 1] + 5/8*p[2, 2, 1] + 1/2*p[3, 1, 1] + 1/6*p[3, 2] + 1/4*p[4, 1] + 1/5*p[5],
49171/720*p[1, 1, 1, 1, 1, 1] + 193/48*p[2, 1, 1, 1, 1] + 15/16*p[2, 2, 1, 1] + 61/48*p[2, 2, 2] + 19/18*p[3, 1, 1, 1] + 1/6*p[3, 2, 1] + 7/18*p[3, 3] + 3/8*p[4, 1, 1] + 1/8*p[4, 2] + 1/5*p[5, 1] + 1/6*p[6]]

>>> from sage.all import *
>>> F = species.BinaryForestSpecies()
>>> F.generating_series().counts(Integer(10))
[1, 1, 3, 19, 193, 2721, 49171, 1084483, 28245729, 848456353]
>>> F.isotype_generating_series().counts(Integer(10))                                  # needs sage.modules
[1, 1, 2, 4, 10, 26, 77, 235, 758, 2504]
>>> F.cycle_index_series()[:Integer(7)]                                                # needs sage.modules
[p[],
p[1],
3/2*p[1, 1] + 1/2*p[2],
19/6*p[1, 1, 1] + 1/2*p[2, 1] + 1/3*p[3],
193/24*p[1, 1, 1, 1] + 3/4*p[2, 1, 1] + 5/8*p[2, 2] + 1/3*p[3, 1] + 1/4*p[4],
907/40*p[1, 1, 1, 1, 1] + 19/12*p[2, 1, 1, 1] + 5/8*p[2, 2, 1] + 1/2*p[3, 1, 1] + 1/6*p[3, 2] + 1/4*p[4, 1] + 1/5*p[5],
49171/720*p[1, 1, 1, 1, 1, 1] + 193/48*p[2, 1, 1, 1, 1] + 15/16*p[2, 2, 1, 1] + 61/48*p[2, 2, 2] + 19/18*p[3, 1, 1, 1] + 1/6*p[3, 2, 1] + 7/18*p[3, 3] + 3/8*p[4, 1, 1] + 1/8*p[4, 2] + 1/5*p[5, 1] + 1/6*p[6]]

sage.combinat.species.library.BinaryTreeSpecies()[source]#

Return the species of binary trees on $$n$$ leaves.

The species of binary trees $$B$$ is defined by $$B = X + B \cdot B$$, where $$X$$ is the singleton species.

EXAMPLES:

sage: B = species.BinaryTreeSpecies()
sage: B.generating_series().counts(10)
[0, 1, 2, 12, 120, 1680, 30240, 665280, 17297280, 518918400]
sage: B.isotype_generating_series().counts(10)
[0, 1, 1, 2, 5, 14, 42, 132, 429, 1430]
sage: B._check()
True

>>> from sage.all import *
>>> B = species.BinaryTreeSpecies()
>>> B.generating_series().counts(Integer(10))
[0, 1, 2, 12, 120, 1680, 30240, 665280, 17297280, 518918400]
>>> B.isotype_generating_series().counts(Integer(10))
[0, 1, 1, 2, 5, 14, 42, 132, 429, 1430]
>>> B._check()
True

sage: B = species.BinaryTreeSpecies()
sage: a = B.structures([1,2,3,4,5])[187]; a
2*((5*3)*(4*1))
sage: a.automorphism_group()                                                    # needs sage.groups
Permutation Group with generators [()]

>>> from sage.all import *
>>> B = species.BinaryTreeSpecies()
>>> a = B.structures([Integer(1),Integer(2),Integer(3),Integer(4),Integer(5)])[Integer(187)]; a
2*((5*3)*(4*1))
>>> a.automorphism_group()                                                    # needs sage.groups
Permutation Group with generators [()]

sage.combinat.species.library.SimpleGraphSpecies()[source]#

Return the species of simple graphs.

EXAMPLES:

sage: S = species.SimpleGraphSpecies()
sage: S.generating_series().counts(10)
[1, 1, 2, 8, 64, 1024, 32768, 2097152, 268435456, 68719476736]
sage: S.cycle_index_series()[:5]                                                # needs sage.modules
[p[],
p[1],
p[1, 1] + p[2],
4/3*p[1, 1, 1] + 2*p[2, 1] + 2/3*p[3],
8/3*p[1, 1, 1, 1] + 4*p[2, 1, 1] + 2*p[2, 2] + 4/3*p[3, 1] + p[4]]
sage: S.isotype_generating_series()[:6]                                         # needs sage.modules
[1, 1, 2, 4, 11, 34]

>>> from sage.all import *
>>> S = species.SimpleGraphSpecies()
>>> S.generating_series().counts(Integer(10))
[1, 1, 2, 8, 64, 1024, 32768, 2097152, 268435456, 68719476736]
>>> S.cycle_index_series()[:Integer(5)]                                                # needs sage.modules
[p[],
p[1],
p[1, 1] + p[2],
4/3*p[1, 1, 1] + 2*p[2, 1] + 2/3*p[3],
8/3*p[1, 1, 1, 1] + 4*p[2, 1, 1] + 2*p[2, 2] + 4/3*p[3, 1] + p[4]]
>>> S.isotype_generating_series()[:Integer(6)]                                         # needs sage.modules
[1, 1, 2, 4, 11, 34]