Skip to content

Commit 850e627

Browse files
committed
src/sage/topology: remove all "needs sage.foo" tags
These are unmaintained, and do nothing in upstream SageMath.
1 parent 1398283 commit 850e627

16 files changed

Lines changed: 402 additions & 504 deletions

src/sage/topology/all.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# sage.doctest: needs sage.graphs
21
from sage.topology.simplicial_complex import SimplicialComplex, Simplex
32

43
from sage.topology.simplicial_complex_morphism import SimplicialComplexMorphism

src/sage/topology/cell_complex.py

Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# sage.doctest: needs sage.graphs
21
r"""
32
Generic cell complexes
43
@@ -228,7 +227,6 @@ def _n_cells_sorted(self, n, subcomplex=None):
228227
sage: Z._n_cells_sorted(2, subcomplex=K)
229228
[(1, 2, 4), (1, 3, 4)]
230229
231-
sage: # needs sage.symbolic
232230
sage: S = SimplicialComplex([[complex(i), complex(1)]])
233231
sage: S._n_cells_sorted(0)
234232
[((1+0j),), (1j,)]
@@ -508,7 +506,6 @@ def homology(self, dim=None, base_ring=ZZ, subcomplex=None,
508506
509507
EXAMPLES::
510508
511-
sage: # needs sage.modules
512509
sage: P = delta_complexes.RealProjectivePlane()
513510
sage: P.homology()
514511
{0: 0, 1: C2, 2: 0}
@@ -527,7 +524,7 @@ def homology(self, dim=None, base_ring=ZZ, subcomplex=None,
527524
Sage can compute generators of homology groups::
528525
529526
sage: S2 = simplicial_complexes.Sphere(2)
530-
sage: S2.homology(dim=2, generators=True, base_ring=GF(2)) # needs sage.modules
527+
sage: S2.homology(dim=2, generators=True, base_ring=GF(2))
531528
[(Vector space of dimension 1 over Finite Field of size 2,
532529
(0, 1, 2) + (0, 1, 3) + (0, 2, 3) + (1, 2, 3))]
533530
@@ -538,15 +535,15 @@ def homology(self, dim=None, base_ring=ZZ, subcomplex=None,
538535
complexes, each generator is a linear combination of cubes::
539536
540537
sage: S2_cub = cubical_complexes.Sphere(2)
541-
sage: S2_cub.homology(dim=2, generators=True) # needs sage.modules
538+
sage: S2_cub.homology(dim=2, generators=True)
542539
[(Z,
543540
[0,0] x [0,1] x [0,1] - [0,1] x [0,0] x [0,1] + [0,1] x [0,1] x [0,0]
544541
- [0,1] x [0,1] x [1,1] + [0,1] x [1,1] x [0,1] - [1,1] x [0,1] x [0,1])]
545542
546543
Similarly for simplicial sets::
547544
548545
sage: S = simplicial_sets.Sphere(2)
549-
sage: S.homology(generators=True) # needs sage.modules
546+
sage: S.homology(generators=True)
550547
{0: [], 1: 0, 2: [(Z, sigma_2)]}
551548
"""
552549
from sage.homology.homology_group import HomologyGroup
@@ -625,14 +622,13 @@ def cohomology(self, dim=None, base_ring=ZZ, subcomplex=None,
625622
EXAMPLES::
626623
627624
sage: circle = SimplicialComplex([[0,1], [1,2], [0, 2]])
628-
sage: circle.cohomology(0) # needs sage.modules
625+
sage: circle.cohomology(0)
629626
0
630-
sage: circle.cohomology(1) # needs sage.modules
627+
sage: circle.cohomology(1)
631628
Z
632629
633630
Projective plane::
634631
635-
sage: # needs sage.modules
636632
sage: P2 = SimplicialComplex([[0,1,2], [0,2,3], [0,1,5], [0,4,5], [0,3,4],
637633
....: [1,2,4], [1,3,4], [1,3,5], [2,3,5], [2,4,5]])
638634
sage: P2.cohomology(2)
@@ -642,20 +638,20 @@ def cohomology(self, dim=None, base_ring=ZZ, subcomplex=None,
642638
sage: P2.cohomology(2, base_ring=GF(3))
643639
Vector space of dimension 0 over Finite Field of size 3
644640
645-
sage: cubical_complexes.KleinBottle().cohomology(2) # needs sage.modules
641+
sage: cubical_complexes.KleinBottle().cohomology(2)
646642
C2
647643
648644
Relative cohomology::
649645
650646
sage: T = SimplicialComplex([[0,1]])
651647
sage: U = SimplicialComplex([[0], [1]])
652-
sage: T.cohomology(1, subcomplex=U) # needs sage.modules
648+
sage: T.cohomology(1, subcomplex=U)
653649
Z
654650
655651
A `\Delta`-complex example::
656652
657653
sage: s5 = delta_complexes.Sphere(5)
658-
sage: s5.cohomology(base_ring=GF(7))[5] # needs sage.modules
654+
sage: s5.cohomology(base_ring=GF(7))[5]
659655
Vector space of dimension 1 over Finite Field of size 7
660656
"""
661657
return self.homology(dim=dim, cohomology=True, base_ring=base_ring,
@@ -689,23 +685,23 @@ def betti(self, dim=None, subcomplex=None):
689685
two-point space with itself::
690686
691687
sage: S = SimplicialComplex([[0], [1]])
692-
sage: (S*S*S).betti() # needs sage.modules
688+
sage: (S*S*S).betti()
693689
{0: 1, 1: 0, 2: 1}
694-
sage: (S*S*S).betti([1,2]) # needs sage.modules
690+
sage: (S*S*S).betti([1,2])
695691
{1: 0, 2: 1}
696-
sage: (S*S*S).betti(2) # needs sage.modules
692+
sage: (S*S*S).betti(2)
697693
1
698694
699695
Or build the two-sphere as a `\Delta`-complex::
700696
701697
sage: S2 = delta_complexes.Sphere(2)
702-
sage: S2.betti([1,2]) # needs sage.modules
698+
sage: S2.betti([1,2])
703699
{1: 0, 2: 1}
704700
705701
Or as a cubical complex::
706702
707703
sage: S2c = cubical_complexes.Sphere(2)
708-
sage: S2c.betti(2) # needs sage.modules
704+
sage: S2c.betti(2)
709705
1
710706
"""
711707
dic = {}
@@ -733,9 +729,9 @@ def is_acyclic(self, base_ring=ZZ) -> bool:
733729
EXAMPLES::
734730
735731
sage: RP2 = simplicial_complexes.RealProjectivePlane()
736-
sage: RP2.is_acyclic() # needs sage.modules
732+
sage: RP2.is_acyclic()
737733
False
738-
sage: RP2.is_acyclic(QQ) # needs sage.modules
734+
sage: RP2.is_acyclic(QQ)
739735
True
740736
741737
This first computes the Euler characteristic: if it is not 1,
@@ -779,12 +775,12 @@ def n_chains(self, n, base_ring=ZZ, cochains=False):
779775
EXAMPLES::
780776
781777
sage: S2 = simplicial_complexes.Sphere(2)
782-
sage: S2.n_chains(1, QQ) # needs sage.modules
778+
sage: S2.n_chains(1, QQ)
783779
Free module generated by {(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)}
784780
over Rational Field
785-
sage: list(S2.n_chains(1, QQ, cochains=False).basis()) # needs sage.modules
781+
sage: list(S2.n_chains(1, QQ, cochains=False).basis())
786782
[(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)]
787-
sage: list(S2.n_chains(1, QQ, cochains=True).basis()) # needs sage.modules
783+
sage: list(S2.n_chains(1, QQ, cochains=True).basis())
788784
[\chi_(0, 1), \chi_(0, 2), \chi_(0, 3), \chi_(1, 2), \chi_(1, 3), \chi_(2, 3)]
789785
"""
790786
from sage.homology.chains import Chains, Cochains
@@ -847,7 +843,6 @@ def homology_with_basis(self, base_ring=QQ, cohomology=False):
847843
848844
EXAMPLES::
849845
850-
sage: # needs sage.modules
851846
sage: K = simplicial_complexes.KleinBottle()
852847
sage: H = K.homology_with_basis(QQ); H
853848
Homology module of Minimal triangulation of the Klein bottle
@@ -863,12 +858,12 @@ def homology_with_basis(self, base_ring=QQ, cohomology=False):
863858
The homology is constructed as a graded object, so for
864859
example, you can ask for the basis in a single degree::
865860
866-
sage: H.basis(1) # needs sage.modules
861+
sage: H.basis(1)
867862
Finite family {(1, 0): h_{1,0}, (1, 1): h_{1,1}}
868863
869864
sage: S3 = delta_complexes.Sphere(3)
870-
sage: H = S3.homology_with_basis(QQ, cohomology=True) # needs sage.modules
871-
sage: list(H.basis(3)) # needs sage.modules
865+
sage: H = S3.homology_with_basis(QQ, cohomology=True)
866+
sage: list(H.basis(3))
872867
[h^{3,0}]
873868
"""
874869
from sage.homology.homology_vector_space_with_basis import \
@@ -914,7 +909,6 @@ def cohomology_ring(self, base_ring=QQ):
914909
915910
EXAMPLES::
916911
917-
sage: # needs sage.modules
918912
sage: K = simplicial_complexes.KleinBottle()
919913
sage: H = K.cohomology_ring(QQ); H
920914
Cohomology ring of Minimal triangulation of the Klein bottle
@@ -928,23 +922,22 @@ def cohomology_ring(self, base_ring=QQ):
928922
[h^{0,0}, h^{1,0}, h^{1,1}, h^{2,0}]
929923
930924
sage: X = delta_complexes.SurfaceOfGenus(2)
931-
sage: H = X.cohomology_ring(QQ); H # needs sage.modules
925+
sage: H = X.cohomology_ring(QQ); H
932926
Cohomology ring of Delta complex with 3 vertices and 29 simplices
933927
over Rational Field
934-
sage: sorted(H.basis(1), key=str) # needs sage.modules
928+
sage: sorted(H.basis(1), key=str)
935929
[h^{1,0}, h^{1,1}, h^{1,2}, h^{1,3}]
936930
937-
sage: H = simplicial_complexes.Torus().cohomology_ring(QQ); H # needs sage.modules
931+
sage: H = simplicial_complexes.Torus().cohomology_ring(QQ); H
938932
Cohomology ring of Minimal triangulation of the torus
939933
over Rational Field
940-
sage: x = H.basis()[1,0]; x # needs sage.modules
934+
sage: x = H.basis()[1,0]; x
941935
h^{1,0}
942-
sage: y = H.basis()[1,1]; y # needs sage.modules
936+
sage: y = H.basis()[1,1]; y
943937
h^{1,1}
944938
945939
You can compute cup products of cohomology classes::
946940
947-
sage: # needs sage.modules
948941
sage: x.cup_product(y)
949942
-h^{2,0}
950943
sage: x * y # alternate notation
@@ -956,13 +949,12 @@ def cohomology_ring(self, base_ring=QQ):
956949
957950
Cohomology operations::
958951
959-
sage: # needs sage.groups
960952
sage: RP2 = simplicial_complexes.RealProjectivePlane()
961953
sage: K = RP2.suspension()
962954
sage: K.set_immutable()
963-
sage: y = K.cohomology_ring(GF(2)).basis()[2,0]; y # needs sage.modules
955+
sage: y = K.cohomology_ring(GF(2)).basis()[2,0]; y
964956
h^{2,0}
965-
sage: y.Sq(1) # needs sage.modules
957+
sage: y.Sq(1)
966958
h^{3,0}
967959
968960
To compute the cohomology ring, the complex must be
@@ -976,12 +968,12 @@ def cohomology_ring(self, base_ring=QQ):
976968
sage: T = S1.product(S1)
977969
sage: T.is_immutable()
978970
False
979-
sage: T.cohomology_ring() # needs sage.modules
971+
sage: T.cohomology_ring()
980972
Traceback (most recent call last):
981973
...
982974
ValueError: this simplicial complex must be immutable; call set_immutable()
983975
sage: T.set_immutable()
984-
sage: T.cohomology_ring() # needs sage.modules
976+
sage: T.cohomology_ring()
985977
Cohomology ring of Simplicial complex with 9 vertices and
986978
18 facets over Rational Field
987979
"""

src/sage/topology/cubical_complex.py

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# sage.doctest: needs sage.graphs
21
r"""
32
Finite cubical complexes
43
@@ -46,11 +45,11 @@
4645
segment in the plane from `(0,2)` to `(0,3)`. We could form a
4746
topologically equivalent space by inserting some degenerate simplices::
4847
49-
sage: S1.homology() # needs sage.modules
48+
sage: S1.homology()
5049
{0: 0, 1: Z}
5150
sage: X = CubicalComplex([([0,0], [2,3], [2]), ([0,1], [3,3], [2]),
5251
....: ([0,1], [2,2], [2]), ([1,1], [2,3], [2])])
53-
sage: X.homology() # needs sage.modules
52+
sage: X.homology()
5453
{0: 0, 1: Z}
5554
5655
Topologically, the cubical complex ``X`` consists of four edges of a
@@ -797,26 +796,26 @@ class :class:`Cube`, or lists or tuples suitable for conversion to
797796
sage: S1 = CubicalComplex([([0,0], [2,3]), ([0,1], [3,3]),
798797
....: ([0,1], [2,2]), ([1,1], [2,3])]); S1
799798
Cubical complex with 4 vertices and 8 cubes
800-
sage: S1.homology() # needs sage.modules
799+
sage: S1.homology()
801800
{0: 0, 1: Z}
802801
803802
A set of five points and its product with ``S1``::
804803
805804
sage: pts = CubicalComplex([([0],), ([3],), ([6],), ([-12],), ([5],)])
806805
sage: pts
807806
Cubical complex with 5 vertices and 5 cubes
808-
sage: pts.homology() # needs sage.modules
807+
sage: pts.homology()
809808
{0: Z x Z x Z x Z}
810809
sage: X = S1.product(pts); X
811810
Cubical complex with 20 vertices and 40 cubes
812-
sage: X.homology() # needs sage.modules
811+
sage: X.homology()
813812
{0: Z x Z x Z x Z, 1: Z^5}
814813
815814
Converting a simplicial complex to a cubical complex::
816815
817816
sage: S2 = simplicial_complexes.Sphere(2)
818817
sage: C2 = CubicalComplex(S2)
819-
sage: all(C2.homology(n) == S2.homology(n) for n in range(3)) # needs sage.modules
818+
sage: all(C2.homology(n) == S2.homology(n) for n in range(3))
820819
True
821820
822821
You can get the set of maximal cells or a dictionary of all cells::
@@ -853,14 +852,14 @@ class :class:`Cube`, or lists or tuples suitable for conversion to
853852
854853
sage: T = S1.product(S1); T
855854
Cubical complex with 16 vertices and 64 cubes
856-
sage: T.chain_complex() # needs sage.modules
855+
sage: T.chain_complex()
857856
Chain complex with at most 3 nonzero terms over Integer Ring
858-
sage: T.homology(base_ring=QQ) # needs sage.modules
857+
sage: T.homology(base_ring=QQ)
859858
{0: Vector space of dimension 0 over Rational Field,
860859
1: Vector space of dimension 2 over Rational Field,
861860
2: Vector space of dimension 1 over Rational Field}
862861
sage: RP2 = cubical_complexes.RealProjectivePlane()
863-
sage: RP2.cohomology(dim=[1, 2], base_ring=GF(2)) # needs sage.modules
862+
sage: RP2.cohomology(dim=[1, 2], base_ring=GF(2))
864863
{1: Vector space of dimension 1 over Finite Field of size 2,
865864
2: Vector space of dimension 1 over Finite Field of size 2}
866865
@@ -1191,7 +1190,6 @@ def chain_complex(self, subcomplex=None, augmented=False,
11911190
11921191
EXAMPLES::
11931192
1194-
sage: # needs sage.modules
11951193
sage: S2 = cubical_complexes.Sphere(2)
11961194
sage: S2.chain_complex()
11971195
Chain complex with at most 3 nonzero terms over Integer Ring
@@ -1210,7 +1208,6 @@ def chain_complex(self, subcomplex=None, augmented=False,
12101208
12111209
Check that :issue:`32203` has been fixed::
12121210
1213-
sage: # needs sage.modules
12141211
sage: Square = CubicalComplex([([0,1],[0,1])])
12151212
sage: EdgesLTR = CubicalComplex([([0,0],[0,1]),([0,1],[1,1]),([1,1],[0,1])])
12161213
sage: EdgesLBR = CubicalComplex([([0,0],[0,1]),([0,1],[0,0]),([1,1],[0,1])])
@@ -1507,7 +1504,7 @@ def disjoint_union(self, other):
15071504
15081505
sage: S1 = cubical_complexes.Sphere(1)
15091506
sage: S2 = cubical_complexes.Sphere(2)
1510-
sage: S1.disjoint_union(S2).homology() # needs sage.modules
1507+
sage: S1.disjoint_union(S2).homology()
15111508
{0: Z, 1: Z, 2: Z}
15121509
"""
15131510
embedded_left = len(tuple(self.maximal_cells()[0]))
@@ -1545,7 +1542,7 @@ def wedge(self, other):
15451542
15461543
sage: S1 = cubical_complexes.Sphere(1)
15471544
sage: S2 = cubical_complexes.Sphere(2)
1548-
sage: S1.wedge(S2).homology() # needs sage.modules
1545+
sage: S1.wedge(S2).homology()
15491546
{0: 0, 1: Z, 2: Z}
15501547
"""
15511548
embedded_left = len(tuple(self.maximal_cells()[0]))
@@ -1582,12 +1579,12 @@ def connected_sum(self, other):
15821579
15831580
sage: T = cubical_complexes.Torus()
15841581
sage: S2 = cubical_complexes.Sphere(2)
1585-
sage: T.connected_sum(S2).cohomology() == T.cohomology() # needs sage.modules
1582+
sage: T.connected_sum(S2).cohomology() == T.cohomology()
15861583
True
15871584
sage: RP2 = cubical_complexes.RealProjectivePlane()
1588-
sage: T.connected_sum(RP2).homology(1) # needs sage.modules
1585+
sage: T.connected_sum(RP2).homology(1)
15891586
Z x Z x C2
1590-
sage: RP2.connected_sum(RP2).connected_sum(RP2).homology(1) # needs sage.modules
1587+
sage: RP2.connected_sum(RP2).connected_sum(RP2).homology(1)
15911588
Z x Z x C2
15921589
"""
15931590
# connected_sum: first check whether the complexes are pure
@@ -1703,7 +1700,6 @@ def algebraic_topological_model(self, base_ring=None):
17031700
17041701
EXAMPLES::
17051702
1706-
sage: # needs sage.modules
17071703
sage: RP2 = cubical_complexes.RealProjectivePlane()
17081704
sage: phi, M = RP2.algebraic_topological_model(GF(2))
17091705
sage: M.homology()
@@ -1764,7 +1760,7 @@ def _simplicial_(self):
17641760
17651761
sage: Ts = T._simplicial_(); Ts
17661762
Simplicial complex with 16 vertices and 32 facets
1767-
sage: T.homology() == Ts.homology() # needs sage.modules
1763+
sage: T.homology() == Ts.homology()
17681764
True
17691765
17701766
Each `n`-dimensional cube produces `n!` `n`-simplices::

0 commit comments

Comments
 (0)