# Examples of Combinatorial Species¶

sage.combinat.species.library.BinaryForestSpecies()

Returns 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)
[1, 1, 2, 4, 10, 26, 77, 235, 758, 2504]
sage: F.cycle_index_series().coefficients(7)
[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()

Return the species of binary trees on n leaves.

The species of binary trees B is defined by B = X + B*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

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

sage.combinat.species.library.SimpleGraphSpecies()

Returns 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().coefficients(5)
[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().coefficients(6)
[1, 1, 2, 4, 11, 34]