1- # sage.doctest: needs sage.graphs
21r"""
32Generic 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 """
0 commit comments