Skip to content

Commit 6b178b5

Browse files
author
Matthias Koeppe
committed
Run ./sage -fixdoctests --distribution "sagemath-graphs[modules]" etc.
1 parent 66c205a commit 6b178b5

13 files changed

+79
-75
lines changed

src/sage/homology/algebraic_topological_model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ def algebraic_topological_model(K, base_ring=None):
101101
102102
sage: from sage.homology.algebraic_topological_model import algebraic_topological_model
103103
sage: RP2 = simplicial_complexes.RealProjectivePlane()
104-
sage: phi, M = algebraic_topological_model(RP2, GF(2)) # needs sage.rings.finite_rings
105-
sage: M.homology() # needs sage.rings.finite_rings
104+
sage: phi, M = algebraic_topological_model(RP2, GF(2))
105+
sage: M.homology()
106106
{0: Vector space of dimension 1 over Finite Field of size 2,
107107
1: Vector space of dimension 1 over Finite Field of size 2,
108108
2: Vector space of dimension 1 over Finite Field of size 2}
@@ -372,8 +372,8 @@ def algebraic_topological_model_delta_complex(K, base_ring=None):
372372
373373
sage: from sage.homology.algebraic_topological_model import algebraic_topological_model_delta_complex as AT_model
374374
sage: RP2 = simplicial_complexes.RealProjectivePlane()
375-
sage: phi, M = AT_model(RP2, GF(2)) # needs sage.rings.finite_rings
376-
sage: M.homology() # needs sage.rings.finite_rings
375+
sage: phi, M = AT_model(RP2, GF(2))
376+
sage: M.homology()
377377
{0: Vector space of dimension 1 over Finite Field of size 2,
378378
1: Vector space of dimension 1 over Finite Field of size 2,
379379
2: Vector space of dimension 1 over Finite Field of size 2}

src/sage/homology/homology_morphism.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def base_ring(self):
198198
sage: id = H.identity()
199199
sage: id.induced_homology_morphism(QQ).base_ring()
200200
Rational Field
201-
sage: id.induced_homology_morphism(GF(13)).base_ring() # needs sage.rings.finite_rings
201+
sage: id.induced_homology_morphism(GF(13)).base_ring()
202202
Finite Field of size 13
203203
"""
204204
return self._base_ring
@@ -312,7 +312,7 @@ def __eq__(self, other) -> bool:
312312
sage: g = Hom(S1, K)({0: 0, 1:0, 2:0})
313313
sage: f.induced_homology_morphism(QQ) == g.induced_homology_morphism(QQ)
314314
True
315-
sage: f.induced_homology_morphism(QQ) == g.induced_homology_morphism(GF(2)) # needs sage.rings.finite_rings
315+
sage: f.induced_homology_morphism(QQ) == g.induced_homology_morphism(GF(2))
316316
False
317317
sage: id = Hom(K, K).identity() # different domain
318318
sage: f.induced_homology_morphism(QQ) == id.induced_homology_morphism(QQ)

src/sage/homology/homology_vector_space_with_basis.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ class HomologyVectorSpaceWithBasis(CombinatorialFreeModule):
135135
`\Delta`-complex model can be obtained by sending `x` to `u+v`,
136136
`y` to `v`. ::
137137
138+
sage: # needs sage.groups
138139
sage: X = simplicial_sets.RealProjectiveSpace(6)
139140
sage: H_X = X.cohomology_ring(GF(2))
140141
sage: a = H_X.basis()[1,0]
@@ -146,6 +147,7 @@ class HomologyVectorSpaceWithBasis(CombinatorialFreeModule):
146147
All products of positive-dimensional elements in a suspension
147148
should be zero::
148149
150+
sage: # needs sage.groups
149151
sage: Y = X.suspension()
150152
sage: H_Y = Y.cohomology_ring(GF(2))
151153
sage: b = H_Y.basis()[2,0]
@@ -453,6 +455,7 @@ class CohomologyRing(HomologyVectorSpaceWithBasis):
453455
sage: y.Sq(2)
454456
h^{4,0}
455457
458+
sage: # needs sage.groups
456459
sage: Y = simplicial_sets.RealProjectiveSpace(6).suspension()
457460
sage: H_Y = Y.cohomology_ring(GF(2))
458461
sage: b = H_Y.basis()[2,0]
@@ -577,9 +580,9 @@ def product_on_basis(self, li, ri):
577580
and simplicial sets::
578581
579582
sage: from sage.topology.simplicial_set_examples import RealProjectiveSpace
580-
sage: RP5 = RealProjectiveSpace(5)
581-
sage: x = RP5.cohomology_ring(GF(2)).basis()[1,0]
582-
sage: x**4
583+
sage: RP5 = RealProjectiveSpace(5) # needs sage.groups
584+
sage: x = RP5.cohomology_ring(GF(2)).basis()[1,0] # needs sage.groups
585+
sage: x**4 # needs sage.groups
583586
h^{4,0}
584587
585588
A non-connected example::
@@ -718,9 +721,9 @@ def Sq(self, i):
718721
one machine, 20 seconds with a simplicial complex, 4 ms
719722
with a simplicial set). ::
720723
721-
sage: RP4_ss = simplicial_sets.RealProjectiveSpace(4)
722-
sage: z_ss = RP4_ss.cohomology_ring(GF(2)).basis()[3,0]
723-
sage: z_ss.Sq(1)
724+
sage: RP4_ss = simplicial_sets.RealProjectiveSpace(4) # needs sage.groups
725+
sage: z_ss = RP4_ss.cohomology_ring(GF(2)).basis()[3,0] # needs sage.groups
726+
sage: z_ss.Sq(1) # needs sage.groups
724727
h^{4,0}
725728
726729
TESTS::

src/sage/homology/tests.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ def random_chain_complex(level=1):
4646
4747
EXAMPLES::
4848
49-
sage: from sage.homology.tests import random_chain_complex # needs sage.modules
50-
sage: C = random_chain_complex() # needs sage.modules
49+
sage: # needs sage.modules
50+
sage: from sage.homology.tests import random_chain_complex
51+
sage: C = random_chain_complex()
5152
sage: C # random
5253
Chain complex with at most ... nonzero terms over Integer Ring
5354
sage: len(C.nonzero_degrees()) in [0, 1, 2]
@@ -117,9 +118,9 @@ def random_simplicial_complex(level=1, p=0.5):
117118
118119
sage: from sage.homology.tests import random_simplicial_complex # needs sage.modules
119120
sage: X = random_simplicial_complex() # needs sage.modules
120-
sage: X # random
121+
sage: X # random # needs sage.modules
121122
Simplicial complex with vertex set (0, 1, 2, 3, 4, 5, 6, 7) and 31 facets
122-
sage: X.dimension() < 11
123+
sage: X.dimension() < 11 # needs sage.modules
123124
True
124125
"""
125126
n = randint(2, 4 * level)

src/sage/topology/cell_complex.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -508,20 +508,20 @@ def homology(self, dim=None, base_ring=ZZ, subcomplex=None,
508508
{0: 0, 1: C2, 2: 0}
509509
sage: P.homology(reduced=False) # needs sage.modules
510510
{0: Z, 1: C2, 2: 0}
511-
sage: P.homology(base_ring=GF(2)) # needs sage.modules sage.rings.finite_rings
511+
sage: P.homology(base_ring=GF(2)) # needs sage.modules
512512
{0: Vector space of dimension 0 over Finite Field of size 2,
513513
1: Vector space of dimension 1 over Finite Field of size 2,
514514
2: Vector space of dimension 1 over Finite Field of size 2}
515515
sage: S7 = delta_complexes.Sphere(7)
516516
sage: S7.homology(7) # needs sage.modules
517517
Z
518-
sage: cubical_complexes.KleinBottle().homology(1, base_ring=GF(2)) # needs sage.modules sage.rings.finite_rings
518+
sage: cubical_complexes.KleinBottle().homology(1, base_ring=GF(2)) # needs sage.modules
519519
Vector space of dimension 2 over Finite Field of size 2
520520
521521
Sage can compute generators of homology groups::
522522
523523
sage: S2 = simplicial_complexes.Sphere(2)
524-
sage: S2.homology(dim=2, generators=True, base_ring=GF(2)) # needs sage.modules sage.rings.finite_rings
524+
sage: S2.homology(dim=2, generators=True, base_ring=GF(2)) # needs sage.modules
525525
[(Vector space of dimension 1 over Finite Field of size 2,
526526
(0, 1, 2) + (0, 1, 3) + (0, 2, 3) + (1, 2, 3))]
527527
@@ -628,9 +628,9 @@ def cohomology(self, dim=None, base_ring=ZZ, subcomplex=None,
628628
....: [1,2,4], [1,3,4], [1,3,5], [2,3,5], [2,4,5]])
629629
sage: P2.cohomology(2) # needs sage.modules
630630
C2
631-
sage: P2.cohomology(2, base_ring=GF(2)) # needs sage.modules sage.rings.finite_rings
631+
sage: P2.cohomology(2, base_ring=GF(2)) # needs sage.modules
632632
Vector space of dimension 1 over Finite Field of size 2
633-
sage: P2.cohomology(2, base_ring=GF(3)) # needs sage.modules sage.rings.finite_rings
633+
sage: P2.cohomology(2, base_ring=GF(3)) # needs sage.modules
634634
Vector space of dimension 0 over Finite Field of size 3
635635
636636
sage: cubical_complexes.KleinBottle().cohomology(2) # needs sage.modules
@@ -646,7 +646,7 @@ def cohomology(self, dim=None, base_ring=ZZ, subcomplex=None,
646646
A `\Delta`-complex example::
647647
648648
sage: s5 = delta_complexes.Sphere(5)
649-
sage: s5.cohomology(base_ring=GF(7))[5] # needs sage.modules sage.rings.finite_rings
649+
sage: s5.cohomology(base_ring=GF(7))[5] # needs sage.modules
650650
Vector space of dimension 1 over Finite Field of size 7
651651
"""
652652
return self.homology(dim=dim, cohomology=True, base_ring=base_ring,
@@ -846,16 +846,16 @@ def homology_with_basis(self, base_ring=QQ, cohomology=False):
846846
over Rational Field
847847
sage: sorted(H.basis(), key=str) # needs sage.modules
848848
[h_{0,0}, h_{1,0}]
849-
sage: H = K.homology_with_basis(GF(2)); H # needs sage.modules sage.rings.finite_rings
849+
sage: H = K.homology_with_basis(GF(2)); H # needs sage.modules
850850
Homology module of Minimal triangulation of the Klein bottle
851851
over Finite Field of size 2
852-
sage: sorted(H.basis(), key=str) # needs sage.modules sage.rings.finite_rings
852+
sage: sorted(H.basis(), key=str) # needs sage.modules
853853
[h_{0,0}, h_{1,0}, h_{1,1}, h_{2,0}]
854854
855855
The homology is constructed as a graded object, so for
856856
example, you can ask for the basis in a single degree::
857857
858-
sage: H.basis(1) # needs sage.modules sage.rings.finite_rings
858+
sage: H.basis(1) # needs sage.modules
859859
Finite family {(1, 0): h_{1,0}, (1, 1): h_{1,1}}
860860
861861
sage: S3 = delta_complexes.Sphere(3)
@@ -905,10 +905,10 @@ def cohomology_ring(self, base_ring=QQ):
905905
over Rational Field
906906
sage: sorted(H.basis(), key=str) # needs sage.modules
907907
[h^{0,0}, h^{1,0}]
908-
sage: H = K.cohomology_ring(GF(2)); H # needs sage.modules sage.rings.finite_rings
908+
sage: H = K.cohomology_ring(GF(2)); H # needs sage.modules
909909
Cohomology ring of Minimal triangulation of the Klein bottle
910910
over Finite Field of size 2
911-
sage: sorted(H.basis(), key=str) # needs sage.modules sage.rings.finite_rings
911+
sage: sorted(H.basis(), key=str) # needs sage.modules
912912
[h^{0,0}, h^{1,0}, h^{1,1}, h^{2,0}]
913913
914914
sage: X = delta_complexes.SurfaceOfGenus(2)

src/sage/topology/cubical_complex.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ class :class:`Cube`, or lists or tuples suitable for conversion to
839839
1: Vector space of dimension 2 over Rational Field,
840840
2: Vector space of dimension 1 over Rational Field}
841841
sage: RP2 = cubical_complexes.RealProjectivePlane()
842-
sage: RP2.cohomology(dim=[1, 2], base_ring=GF(2)) # needs sage.modules sage.rings.finite_rings
842+
sage: RP2.cohomology(dim=[1, 2], base_ring=GF(2)) # needs sage.modules
843843
{1: Vector space of dimension 1 over Finite Field of size 2,
844844
2: Vector space of dimension 1 over Finite Field of size 2}
845845
@@ -1672,8 +1672,8 @@ def algebraic_topological_model(self, base_ring=None):
16721672
EXAMPLES::
16731673
16741674
sage: RP2 = cubical_complexes.RealProjectivePlane()
1675-
sage: phi, M = RP2.algebraic_topological_model(GF(2)) # needs sage.rings.finite_rings
1676-
sage: M.homology() # needs sage.modules sage.rings.finite_rings
1675+
sage: phi, M = RP2.algebraic_topological_model(GF(2))
1676+
sage: M.homology() # needs sage.modules
16771677
{0: Vector space of dimension 1 over Finite Field of size 2,
16781678
1: Vector space of dimension 1 over Finite Field of size 2,
16791679
2: Vector space of dimension 1 over Finite Field of size 2}

src/sage/topology/delta_complex.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ def product(self, other):
952952
C2
953953
sage: X.homology(4) # needs sage.modules
954954
0
955-
sage: X.homology(base_ring=GF(2)) # needs sage.modules sage.rings.finite_rings
955+
sage: X.homology(base_ring=GF(2)) # needs sage.modules
956956
{0: Vector space of dimension 0 over Finite Field of size 2,
957957
1: Vector space of dimension 4 over Finite Field of size 2,
958958
2: Vector space of dimension 6 over Finite Field of size 2,
@@ -1582,8 +1582,8 @@ def algebraic_topological_model(self, base_ring=None):
15821582
EXAMPLES::
15831583
15841584
sage: RP2 = delta_complexes.RealProjectivePlane()
1585-
sage: phi, M = RP2.algebraic_topological_model(GF(2)) # needs sage.modules sage.rings.finite_rings
1586-
sage: M.homology() # needs sage.modules sage.rings.finite_rings
1585+
sage: phi, M = RP2.algebraic_topological_model(GF(2)) # needs sage.modules
1586+
sage: M.homology() # needs sage.modules
15871587
{0: Vector space of dimension 1 over Finite Field of size 2,
15881588
1: Vector space of dimension 1 over Finite Field of size 2,
15891589
2: Vector space of dimension 1 over Finite Field of size 2}
@@ -1650,7 +1650,7 @@ def Sphere(self, n):
16501650
16511651
EXAMPLES::
16521652
1653-
sage: delta_complexes.Sphere(4).cohomology(4, base_ring=GF(3)) # needs sage.modules sage.rings.finite_rings
1653+
sage: delta_complexes.Sphere(4).cohomology(4, base_ring=GF(3)) # needs sage.modules
16541654
Vector space of dimension 1 over Finite Field of size 3
16551655
"""
16561656
if n == 1:
@@ -1686,9 +1686,9 @@ def RealProjectivePlane(self):
16861686
0
16871687
sage: P.cohomology(2) # needs sage.modules
16881688
C2
1689-
sage: P.cohomology(dim=1, base_ring=GF(2)) # needs sage.modules sage.rings.finite_rings
1689+
sage: P.cohomology(dim=1, base_ring=GF(2)) # needs sage.modules
16901690
Vector space of dimension 1 over Finite Field of size 2
1691-
sage: P.cohomology(dim=2, base_ring=GF(2)) # needs sage.modules sage.rings.finite_rings
1691+
sage: P.cohomology(dim=2, base_ring=GF(2)) # needs sage.modules
16921692
Vector space of dimension 1 over Finite Field of size 2
16931693
"""
16941694
return DeltaComplex((((), ()), ((1, 0), (1, 0), (0, 0)),

0 commit comments

Comments
 (0)