Skip to content

Commit 36ee074

Browse files
author
Matthias Koeppe
committed
More # optional
1 parent c934842 commit 36ee074

File tree

8 files changed

+65
-61
lines changed

8 files changed

+65
-61
lines changed

src/sage/combinat/species/generating_series.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,8 @@ def LogarithmCycleIndexSeries(R=QQ):
669669
(that is, that composition with `E^{+}` in both directions yields the
670670
multiplicative identity `X`)::
671671
672-
sage: Eplus = sage.combinat.species.set_species.SetSpecies(min=1).cycle_index_series()
673-
sage: LogarithmCycleIndexSeries()(Eplus)[0:4] # optional - sage.modules
672+
sage: Eplus = sage.combinat.species.set_species.SetSpecies(min=1).cycle_index_series() # optional - sage.modules
673+
sage: LogarithmCycleIndexSeries()(Eplus)[0:4] # optional - sage.modules
674674
[0, p[1], 0, 0]
675675
"""
676676
CIS = CycleIndexSeriesRing(R)

src/sage/combinat/species/library.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@ def SimpleGraphSpecies():
4949
p[1, 1] + p[2],
5050
4/3*p[1, 1, 1] + 2*p[2, 1] + 2/3*p[3],
5151
8/3*p[1, 1, 1, 1] + 4*p[2, 1, 1] + 2*p[2, 2] + 4/3*p[3, 1] + p[4]]
52-
sage: S.isotype_generating_series()[:6]
52+
sage: S.isotype_generating_series()[:6] # optional - sage.modules
5353
[1, 1, 2, 4, 11, 34]
5454
5555
TESTS::
5656
57-
sage: seq = S.isotype_generating_series().counts(6)[1:]
58-
sage: oeis(seq)[0] # optional -- internet
57+
sage: seq = S.isotype_generating_series().counts(6)[1:] # optional - sage.modules
58+
sage: oeis(seq)[0] # optional -- internet # optional - sage.modules
5959
A000088: Number of graphs on n unlabeled nodes.
6060
6161
::
6262
63-
sage: seq = S.generating_series().counts(10)[1:]
64-
sage: oeis(seq)[0] # optional -- internet
63+
sage: seq = S.generating_series().counts(10)[1:] # optional - sage.modules
64+
sage: oeis(seq)[0] # optional -- internet # optional - sage.modules
6565
A006125: a(n) = 2^(n*(n-1)/2).
6666
"""
6767
E = SetSpecies()

src/sage/combinat/species/permutation_species.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ def _cis(self, series_ring, base_ring):
225225
EXAMPLES::
226226
227227
sage: P = species.PermutationSpecies()
228-
sage: g = P.cycle_index_series()
229-
sage: g[0:5]
228+
sage: g = P.cycle_index_series() # optional - sage.modules
229+
sage: g[0:5] # optional - sage.modules
230230
[p[],
231231
p[1],
232232
p[1, 1] + p[2],
@@ -244,7 +244,7 @@ def _cis_gen(self, base_ring, m, n):
244244
EXAMPLES::
245245
246246
sage: P = species.PermutationSpecies()
247-
sage: [P._cis_gen(QQ, 2, i) for i in range(10)]
247+
sage: [P._cis_gen(QQ, 2, i) for i in range(10)] # optional - sage.modules
248248
[p[], 0, p[2], 0, p[2, 2], 0, p[2, 2, 2], 0, p[2, 2, 2, 2], 0]
249249
"""
250250
from sage.combinat.sf.sf import SymmetricFunctions

src/sage/combinat/species/product_species.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ def transport(self, perm):
5858
"""
5959
EXAMPLES::
6060
61-
sage: p = PermutationGroupElement((2,3))
62-
sage: S = species.SetSpecies()
63-
sage: F = S * S
64-
sage: a = F.structures(['a','b','c'])[4]; a
61+
sage: p = PermutationGroupElement((2,3)) # optional - sage.groups
62+
sage: S = species.SetSpecies() # optional - sage.groups
63+
sage: F = S * S # optional - sage.groups
64+
sage: a = F.structures(['a','b','c'])[4]; a # optional - sage.groups
6565
{'a', 'b'}*{'c'}
66-
sage: a.transport(p)
66+
sage: a.transport(p) # optional - sage.groups
6767
{'a', 'c'}*{'b'}
6868
"""
6969
left, right = self._list
@@ -151,17 +151,17 @@ def automorphism_group(self):
151151
"""
152152
EXAMPLES::
153153
154-
sage: p = PermutationGroupElement((2,3))
155-
sage: S = species.SetSpecies()
156-
sage: F = S * S
157-
sage: a = F.structures([1,2,3,4])[1]; a
154+
sage: p = PermutationGroupElement((2,3)) # optional - sage.groups
155+
sage: S = species.SetSpecies() # optional - sage.groups
156+
sage: F = S * S # optional - sage.groups
157+
sage: a = F.structures([1,2,3,4])[1]; a # optional - sage.groups
158158
{1}*{2, 3, 4}
159-
sage: a.automorphism_group()
159+
sage: a.automorphism_group() # optional - sage.groups
160160
Permutation Group with generators [(2,3), (2,3,4)]
161161
162162
::
163163
164-
sage: [a.transport(g) for g in a.automorphism_group()]
164+
sage: [a.transport(g) for g in a.automorphism_group()] # optional - sage.groups
165165
[{1}*{2, 3, 4},
166166
{1}*{2, 3, 4},
167167
{1}*{2, 3, 4},
@@ -171,9 +171,9 @@ def automorphism_group(self):
171171
172172
::
173173
174-
sage: a = F.structures([1,2,3,4])[8]; a
174+
sage: a = F.structures([1,2,3,4])[8]; a # optional - sage.groups
175175
{2, 3}*{1, 4}
176-
sage: [a.transport(g) for g in a.automorphism_group()]
176+
sage: [a.transport(g) for g in a.automorphism_group()] # optional - sage.groups
177177
[{2, 3}*{1, 4}, {2, 3}*{1, 4}, {2, 3}*{1, 4}, {2, 3}*{1, 4}]
178178
"""
179179
from sage.groups.perm_gps.constructor import PermutationGroupElement
@@ -355,7 +355,7 @@ def _cis(self, series_ring, base_ring):
355355
356356
sage: P = species.PermutationSpecies()
357357
sage: F = P * P
358-
sage: F.cycle_index_series()[0:5]
358+
sage: F.cycle_index_series()[0:5] # optional - sage.modules
359359
[p[],
360360
2*p[1],
361361
3*p[1, 1] + 2*p[2],
@@ -409,7 +409,7 @@ def _equation(self, var_mapping):
409409
410410
sage: X = species.SingletonSpecies()
411411
sage: S = X * X
412-
sage: S.algebraic_equation_system()
412+
sage: S.algebraic_equation_system() # optional - sage.graphs
413413
[node0 + (-z^2)]
414414
"""
415415
from sage.misc.misc_c import prod

src/sage/combinat/species/set_species.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def transport(self, perm):
5757
sage: F = species.SetSpecies()
5858
sage: a = F.structures(["a", "b", "c"]).random_element(); a
5959
{'a', 'b', 'c'}
60-
sage: p = PermutationGroupElement((1,2))
61-
sage: a.transport(p)
60+
sage: p = PermutationGroupElement((1,2)) # optional - sage.groups
61+
sage: a.transport(p) # optional - sage.groups
6262
{'a', 'b', 'c'}
6363
"""
6464
return self
@@ -74,7 +74,7 @@ def automorphism_group(self):
7474
sage: F = species.SetSpecies()
7575
sage: a = F.structures(["a", "b", "c"]).random_element(); a
7676
{'a', 'b', 'c'}
77-
sage: a.automorphism_group()
77+
sage: a.automorphism_group() # optional - sage.groups
7878
Symmetric group of order 3! as a permutation group
7979
"""
8080
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
@@ -170,8 +170,8 @@ def _cis(self, series_ring, base_ring):
170170
EXAMPLES::
171171
172172
sage: S = species.SetSpecies()
173-
sage: g = S.cycle_index_series()
174-
sage: g[0:5]
173+
sage: g = S.cycle_index_series() # optional - sage.modules
174+
sage: g[0:5] # optional - sage.modules
175175
[p[],
176176
p[1],
177177
1/2*p[1, 1] + 1/2*p[2],

src/sage/combinat/species/species.py

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
sage: L = species.LinearOrderSpecies(min=1)
2525
sage: T = species.CombinatorialSpecies(min=1)
2626
sage: T.define(leaf + internal_node*L(T))
27-
sage: T.isotype_generating_series()[0:6]
27+
sage: T.isotype_generating_series()[0:6] # optional - sage.modules
2828
[0, 1, q, q^2 + q, q^3 + 3*q^2 + q, q^4 + 6*q^3 + 6*q^2 + q]
2929
3030
Consider the following::
3131
32-
sage: T.isotype_generating_series().coefficient(4)
32+
sage: T.isotype_generating_series().coefficient(4) # optional - sage.modules
3333
q^3 + 3*q^2 + q
3434
3535
This means that, among the trees on `4` nodes, one has a
@@ -335,7 +335,7 @@ def functorial_composition(self, g):
335335
sage: WP = species.SubsetSpecies()
336336
sage: P2 = E2*E
337337
sage: G = WP.functorial_composition(P2)
338-
sage: G.isotype_generating_series()[0:5]
338+
sage: G.isotype_generating_series()[0:5] # optional - sage.modules
339339
[1, 1, 2, 4, 11]
340340
"""
341341
from .functorial_composition_species import FunctorialCompositionSpecies
@@ -448,7 +448,7 @@ def __pow__(self, n):
448448
sage: X^1 is X
449449
True
450450
sage: A = X^32
451-
sage: A.digraph()
451+
sage: A.digraph() # optional - sage.graphs
452452
Multi-digraph on 6 vertices
453453
454454
TESTS::
@@ -643,8 +643,8 @@ def cycle_index_series(self, base_ring=None):
643643
EXAMPLES::
644644
645645
sage: P = species.PermutationSpecies()
646-
sage: g = P.cycle_index_series()
647-
sage: g[0:4]
646+
sage: g = P.cycle_index_series() # optional - sage.modules
647+
sage: g[0:4] # optional - sage.modules
648648
[p[], p[1], p[1, 1] + p[2], p[1, 1, 1] + p[2, 1] + p[3]]
649649
"""
650650
return self._get_series(CycleIndexSeriesRing, "cis", base_ring)
@@ -710,19 +710,19 @@ def digraph(self):
710710
sage: X = species.SingletonSpecies()
711711
sage: B = species.CombinatorialSpecies()
712712
sage: B.define(X+B*B)
713-
sage: g = B.digraph(); g
713+
sage: g = B.digraph(); g # optional - sage.graphs
714714
Multi-digraph on 4 vertices
715715
716-
sage: sorted(g, key=str)
716+
sage: sorted(g, key=str) # optional - sage.graphs
717717
[Combinatorial species,
718718
Product of (Combinatorial species) and (Combinatorial species),
719719
Singleton species,
720720
Sum of (Singleton species) and
721721
(Product of (Combinatorial species) and (Combinatorial species))]
722722
723-
sage: d = {sp: i for i, sp in enumerate(g)}
724-
sage: g.relabel(d)
725-
sage: g.canonical_label().edges(sort=True)
723+
sage: d = {sp: i for i, sp in enumerate(g)} # optional - sage.graphs
724+
sage: g.relabel(d) # optional - sage.graphs
725+
sage: g.canonical_label().edges(sort=True) # optional - sage.graphs
726726
[(0, 3, None), (2, 0, None), (2, 0, None), (3, 1, None), (3, 2, None)]
727727
"""
728728
from sage.graphs.digraph import DiGraph
@@ -739,13 +739,13 @@ def _add_to_digraph(self, d):
739739
740740
EXAMPLES::
741741
742-
sage: d = DiGraph(multiedges=True)
743-
sage: X = species.SingletonSpecies()
744-
sage: X._add_to_digraph(d); d
742+
sage: d = DiGraph(multiedges=True) # optional - sage.graphs
743+
sage: X = species.SingletonSpecies() # optional - sage.graphs
744+
sage: X._add_to_digraph(d); d # optional - sage.graphs
745745
Multi-digraph on 1 vertex
746-
sage: (X+X)._add_to_digraph(d); d
746+
sage: (X+X)._add_to_digraph(d); d # optional - sage.graphs
747747
Multi-digraph on 2 vertices
748-
sage: d.edges(sort=True)
748+
sage: d.edges(sort=True) # optional - sage.graphs
749749
[(Sum of (Singleton species) and (Singleton species), Singleton species, None),
750750
(Sum of (Singleton species) and (Singleton species), Singleton species, None)]
751751
"""
@@ -770,21 +770,25 @@ def algebraic_equation_system(self):
770770
EXAMPLES::
771771
772772
sage: B = species.BinaryTreeSpecies()
773-
sage: B.algebraic_equation_system()
773+
sage: B.algebraic_equation_system() # optional - sage.graphs
774774
[-node3^2 + node1, -node1 + node3 + (-z)]
775775
776776
::
777777
778-
sage: sorted(B.digraph().vertex_iterator(), key=str)
778+
sage: sorted(B.digraph().vertex_iterator(), key=str) # optional - sage.graphs
779779
[Combinatorial species with min=1,
780-
Product of (Combinatorial species with min=1) and (Combinatorial species with min=1),
780+
Product of (Combinatorial species with min=1)
781+
and (Combinatorial species with min=1),
781782
Singleton species,
782-
Sum of (Singleton species) and (Product of (Combinatorial species with min=1) and (Combinatorial species with min=1))]
783+
Sum of (Singleton species)
784+
and (Product of (Combinatorial species with min=1)
785+
and (Combinatorial species with min=1))]
783786
784787
::
785788
786-
sage: B.algebraic_equation_system()[0].parent()
787-
Multivariate Polynomial Ring in node0, node1, node2, node3 over Fraction Field of Univariate Polynomial Ring in z over Rational Field
789+
sage: B.algebraic_equation_system()[0].parent() # optional - sage.graphs
790+
Multivariate Polynomial Ring in node0, node1, node2, node3 over
791+
Fraction Field of Univariate Polynomial Ring in z over Rational Field
788792
"""
789793
d = self.digraph()
790794

src/sage/combinat/species/subset_species.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ def transport(self, perm):
7474
sage: F = species.SubsetSpecies()
7575
sage: a = F.structures(["a", "b", "c"])[5]; a
7676
{'a', 'c'}
77-
sage: p = PermutationGroupElement((1,2))
78-
sage: a.transport(p)
77+
sage: p = PermutationGroupElement((1,2)) # optional - sage.groups
78+
sage: a.transport(p) # optional - sage.groups
7979
{'b', 'c'}
80-
sage: p = PermutationGroupElement((1,3))
81-
sage: a.transport(p)
80+
sage: p = PermutationGroupElement((1,3)) # optional - sage.groups
81+
sage: a.transport(p) # optional - sage.groups
8282
{'a', 'c'}
8383
"""
8484
l = sorted([perm(i) for i in self._list])
@@ -94,12 +94,12 @@ def automorphism_group(self):
9494
sage: F = species.SubsetSpecies()
9595
sage: a = F.structures([1,2,3,4])[6]; a
9696
{1, 3}
97-
sage: a.automorphism_group()
97+
sage: a.automorphism_group() # optional - sage.groups
9898
Permutation Group with generators [(2,4), (1,3)]
9999
100100
::
101101
102-
sage: [a.transport(g) for g in a.automorphism_group()]
102+
sage: [a.transport(g) for g in a.automorphism_group()] # optional - sage.groups
103103
[{1, 3}, {1, 3}, {1, 3}, {1, 3}]
104104
"""
105105
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
@@ -224,7 +224,7 @@ def _cis(self, series_ring, base_ring):
224224
EXAMPLES::
225225
226226
sage: S = species.SubsetSpecies()
227-
sage: S.cycle_index_series()[0:5]
227+
sage: S.cycle_index_series()[0:5] # optional - sage.modules
228228
[p[],
229229
2*p[1],
230230
2*p[1, 1] + p[2],

src/sage/combinat/species/sum_species.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _cis(self, series_ring, base_ring):
171171
172172
sage: P = species.PermutationSpecies()
173173
sage: F = P + P
174-
sage: F.cycle_index_series()[:5]
174+
sage: F.cycle_index_series()[:5] # optional - sage.modules
175175
[2*p[],
176176
2*p[1],
177177
2*p[1, 1] + 2*p[2],
@@ -214,7 +214,7 @@ def _equation(self, var_mapping):
214214
215215
sage: X = species.SingletonSpecies()
216216
sage: S = X + X
217-
sage: S.algebraic_equation_system()
217+
sage: S.algebraic_equation_system() # optional - sage.graphs
218218
[node1 + (-2*z)]
219219
"""
220220
return sum(var_mapping[operand] for operand in self._state_info)

0 commit comments

Comments
 (0)