Skip to content

Commit 14946cf

Browse files
author
Matthias Koeppe
committed
sage.{homology,topology}: Use more block tags
1 parent 8f30144 commit 14946cf

File tree

4 files changed

+45
-42
lines changed

4 files changed

+45
-42
lines changed

src/sage/homology/chain_complex_morphism.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@
1414
1515
EXAMPLES::
1616
17-
sage: S = simplicial_complexes.Sphere(1); S # needs sage.graphs
17+
sage: # needs sage.graphs
18+
sage: S = simplicial_complexes.Sphere(1); S
1819
Minimal triangulation of the 1-sphere
19-
sage: C = S.chain_complex() # needs sage.graphs
20-
sage: C.differential() # needs sage.graphs
20+
sage: C = S.chain_complex()
21+
sage: C.differential()
2122
{0: [], 1: [-1 -1 0]
2223
[ 1 0 -1]
2324
[ 0 1 1], 2: []}
2425
sage: f = {0: zero_matrix(ZZ,3,3), 1: zero_matrix(ZZ,3,3)}
25-
sage: G = Hom(C, C) # needs sage.graphs
26-
sage: x = G(f); x # needs sage.graphs
26+
sage: G = Hom(C, C)
27+
sage: x = G(f); x
2728
Chain complex endomorphism of
2829
Chain complex with at most 2 nonzero terms over Integer Ring
29-
sage: x._matrix_dictionary # needs sage.graphs
30+
sage: x._matrix_dictionary
3031
{0: [0 0 0]
3132
[0 0 0]
3233
[0 0 0],
@@ -92,21 +93,22 @@ def __init__(self, matrices, C, D, check=True):
9293
9394
EXAMPLES::
9495
95-
sage: S = simplicial_complexes.Sphere(1); S # needs sage.graphs
96+
sage: # needs sage.graphs
97+
sage: S = simplicial_complexes.Sphere(1); S
9698
Minimal triangulation of the 1-sphere
97-
sage: C = S.chain_complex() # needs sage.graphs
98-
sage: C.differential() # needs sage.graphs
99+
sage: C = S.chain_complex()
100+
sage: C.differential()
99101
{0: [],
100102
1: [-1 -1 0]
101103
[ 1 0 -1]
102104
[ 0 1 1],
103105
2: []}
104106
sage: f = {0:zero_matrix(ZZ,3,3),1:zero_matrix(ZZ,3,3)}
105-
sage: G = Hom(C,C) # needs sage.graphs
106-
sage: x = G(f); x # needs sage.graphs
107+
sage: G = Hom(C,C)
108+
sage: x = G(f); x
107109
Chain complex endomorphism of
108110
Chain complex with at most 2 nonzero terms over Integer Ring
109-
sage: x._matrix_dictionary # needs sage.graphs
111+
sage: x._matrix_dictionary
110112
{0: [0 0 0]
111113
[0 0 0]
112114
[0 0 0],

src/sage/topology/simplicial_complex.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# sage.doctest: needs sage.graphs
2-
# sage.doctest: needs sage.graphs
32
r"""
43
Finite simplicial complexes
54

src/sage/topology/simplicial_set.py

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,14 @@
201201
by taking an `n`-skeleton for an appropriate `n`, either implicitly or
202202
explicitly::
203203
204-
sage: G = groups.misc.MultiplicativeAbelian([3]) # needs sage.groups
205-
sage: B3 = simplicial_sets.ClassifyingSpace(G) # needs sage.groups
206-
sage: B3.disjoint_union(B3).n_skeleton(3) # needs sage.groups
204+
sage: # needs sage.groups
205+
sage: G = groups.misc.MultiplicativeAbelian([3])
206+
sage: B3 = simplicial_sets.ClassifyingSpace(G)
207+
sage: B3.disjoint_union(B3).n_skeleton(3)
207208
Disjoint union: (Simplicial set with 15 non-degenerate simplices
208209
u Simplicial set with 15 non-degenerate simplices)
209210
sage: S1 = simplicial_sets.Sphere(1)
210-
sage: B3.product(S1).homology(range(4)) # needs sage.groups sage.modules
211+
sage: B3.product(S1).homology(range(4)) # needs sage.modules
211212
{0: 0, 1: Z x C3, 2: C3, 3: C3}
212213
213214
Without the ``range`` argument, this would raise an error, since
@@ -1927,12 +1928,12 @@ def chain_complex(self, dimensions=None, base_ring=ZZ, augmented=False,
19271928
19281929
sage: C3 = groups.misc.MultiplicativeAbelian([3]) # needs sage.groups
19291930
sage: BC3 = simplicial_sets.ClassifyingSpace(C3) # needs sage.groups
1930-
sage: BC3.chain_complex(range(4), base_ring=GF(3)) # needs sage.groups sage.modules sage.rings.finite_rings
1931+
sage: BC3.chain_complex(range(4), base_ring=GF(3)) # needs sage.groups sage.modules
19311932
Chain complex with at most 4 nonzero terms over Finite Field of size 3
19321933
19331934
TESTS::
19341935
1935-
sage: BC3.chain_complex() # needs sage.groups sage.rings.finite_rings
1936+
sage: BC3.chain_complex() # needs sage.groups
19361937
Traceback (most recent call last):
19371938
...
19381939
NotImplementedError: this simplicial set may be infinite, so specify dimensions when computing its chain complex
@@ -1983,7 +1984,7 @@ def homology(self, dim=None, **kwds):
19831984
19841985
sage: C3 = groups.misc.MultiplicativeAbelian([3]) # needs sage.groups
19851986
sage: BC3 = simplicial_sets.ClassifyingSpace(C3) # needs sage.groups
1986-
sage: BC3.homology(range(4), base_ring=GF(3)) # needs sage.groups sage.modules sage.rings.finite_rings
1987+
sage: BC3.homology(range(4), base_ring=GF(3)) # needs sage.groups sage.modules
19871988
{0: Vector space of dimension 0 over Finite Field of size 3,
19881989
1: Vector space of dimension 1 over Finite Field of size 3,
19891990
2: Vector space of dimension 1 over Finite Field of size 3,
@@ -2155,11 +2156,13 @@ def n_chains(self, n, base_ring=ZZ, cochains=False):
21552156
sage: C = S3.n_chains(3, cochains=True) # needs sage.modules
21562157
sage: list(C.basis()) # needs sage.modules
21572158
[\chi_sigma_3]
2158-
sage: Sigma3 = groups.permutation.Symmetric(3) # needs sage.groups
2159-
sage: BSigma3 = simplicial_sets.ClassifyingSpace(Sigma3) # needs sage.groups
2160-
sage: list(BSigma3.n_chains(1).basis()) # needs sage.groups sage.modules
2159+
2160+
sage: # needs sage.groups
2161+
sage: Sigma3 = groups.permutation.Symmetric(3)
2162+
sage: BSigma3 = simplicial_sets.ClassifyingSpace(Sigma3)
2163+
sage: list(BSigma3.n_chains(1).basis()) # needs sage.modules
21612164
[(1,2), (1,2,3), (1,3), (1,3,2), (2,3)]
2162-
sage: list(BSigma3.n_chains(1, cochains=True).basis()) # needs sage.groups sage.modules
2165+
sage: list(BSigma3.n_chains(1, cochains=True).basis()) # needs sage.modules
21632166
[\chi_(1,2), \chi_(1,2,3), \chi_(1,3), \chi_(1,3,2), \chi_(2,3)]
21642167
"""
21652168
if self.is_finite():
@@ -2230,19 +2233,18 @@ def quotient(self, subcomplex, vertex_name='*'):
22302233
sage: RP5 = simplicial_sets.RealProjectiveSpace(5)
22312234
sage: RP2 = RP5.n_skeleton(2)
22322235
sage: RP5_2 = RP5.quotient(RP2)
2233-
sage: RP5_2.homology(base_ring=GF(2)) # needs sage.modules sage.rings.finite_rings
2236+
sage: RP5_2.homology(base_ring=GF(2)) # needs sage.modules
22342237
{0: Vector space of dimension 0 over Finite Field of size 2,
22352238
1: Vector space of dimension 0 over Finite Field of size 2,
22362239
2: Vector space of dimension 0 over Finite Field of size 2,
22372240
3: Vector space of dimension 1 over Finite Field of size 2,
22382241
4: Vector space of dimension 1 over Finite Field of size 2,
22392242
5: Vector space of dimension 1 over Finite Field of size 2}
2240-
2241-
sage: RP5_2.ambient() # needs sage.groups
2243+
sage: RP5_2.ambient()
22422244
RP^5
2243-
sage: RP5_2.subcomplex() # needs sage.groups
2245+
sage: RP5_2.subcomplex()
22442246
Simplicial set with 3 non-degenerate simplices
2245-
sage: RP5_2.quotient_map() # needs sage.groups
2247+
sage: RP5_2.quotient_map()
22462248
Simplicial set morphism:
22472249
From: RP^5
22482250
To: Quotient: (RP^5/Simplicial set with 3 non-degenerate simplices)
@@ -3641,16 +3643,17 @@ def chain_complex(self, dimensions=None, base_ring=ZZ, augmented=False,
36413643
36423644
EXAMPLES::
36433645
3646+
sage: # needs sage.modules
36443647
sage: from sage.topology.simplicial_set import AbstractSimplex, SimplicialSet
36453648
sage: v = AbstractSimplex(0)
36463649
sage: degen = v.apply_degeneracies(1, 0) # s_1 s_0 applied to v
36473650
sage: sigma = AbstractSimplex(3)
3648-
sage: S3 = SimplicialSet({sigma: (degen, degen, degen, degen)}) # the 3-sphere
3649-
sage: S3.chain_complex().homology() # needs sage.modules
3651+
sage: S3 = SimplicialSet({sigma: (degen, degen, degen, degen)}) # the 3-sphere
3652+
sage: S3.chain_complex().homology()
36503653
{0: Z, 3: Z}
3651-
sage: S3.chain_complex(augmented=True).homology() # needs sage.modules
3654+
sage: S3.chain_complex(augmented=True).homology()
36523655
{-1: 0, 0: 0, 3: Z}
3653-
sage: S3.chain_complex(dimensions=range(3), base_ring=QQ).homology() # needs sage.modules
3656+
sage: S3.chain_complex(dimensions=range(3), base_ring=QQ).homology()
36543657
{0: Vector space of dimension 1 over Rational Field}
36553658
36563659
sage: RP5 = simplicial_sets.RealProjectiveSpace(5) # needs sage.groups
@@ -3663,14 +3666,15 @@ def chain_complex(self, dimensions=None, base_ring=ZZ, augmented=False,
36633666
Convert some simplicial complexes and `\Delta`-complexes to
36643667
simplicial sets, and compare homology calculations::
36653668
3669+
sage: # needs sage.modules
36663670
sage: T = simplicial_complexes.Torus()
3667-
sage: T.homology() == SimplicialSet(T).homology() # needs sage.modules
3671+
sage: T.homology() == SimplicialSet(T).homology()
36683672
True
36693673
sage: RP2 = delta_complexes.RealProjectivePlane()
3670-
sage: RP2.homology() == SimplicialSet(RP2).homology() # needs sage.modules
3674+
sage: RP2.homology() == SimplicialSet(RP2).homology()
36713675
True
3672-
sage: cohoRP2 = RP2.cohomology(base_ring=GF(2)) # needs sage.modules
3673-
sage: cohoRP2 == SimplicialSet(RP2).cohomology(base_ring=GF(2)) # needs sage.modules
3676+
sage: cohoRP2 = RP2.cohomology(base_ring=GF(2))
3677+
sage: cohoRP2 == SimplicialSet(RP2).cohomology(base_ring=GF(2))
36743678
True
36753679
"""
36763680
from sage.homology.chain_complex import ChainComplex
@@ -3811,11 +3815,12 @@ def algebraic_topological_model(self, base_ring=None):
38113815
EXAMPLES::
38123816
38133817
sage: RP2 = simplicial_sets.RealProjectiveSpace(2) # needs sage.groups
3814-
sage: phi, M = RP2.algebraic_topological_model(GF(2)) # needs sage.groups sage.rings.finite_rings
3815-
sage: M.homology() # needs sage.groups sage.modules sage.rings.finite_rings
3818+
sage: phi, M = RP2.algebraic_topological_model(GF(2)) # needs sage.groups
3819+
sage: M.homology() # needs sage.groups sage.modules
38163820
{0: Vector space of dimension 1 over Finite Field of size 2,
38173821
1: Vector space of dimension 1 over Finite Field of size 2,
38183822
2: Vector space of dimension 1 over Finite Field of size 2}
3823+
38193824
sage: T = simplicial_sets.Torus()
38203825
sage: phi, M = T.algebraic_topological_model(QQ) # needs sage.modules
38213826
sage: M.homology() # needs sage.modules

src/sage/topology/simplicial_set_constructions.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,6 @@ def factors(self):
727727
728728
EXAMPLES::
729729
730-
sage:
731730
sage: S2 = simplicial_sets.Sphere(2)
732731
sage: S3 = simplicial_sets.Sphere(3)
733732
sage: S2.wedge(S3).factors() == (S2, S3)
@@ -952,7 +951,6 @@ def factor(self, i, as_subset=False):
952951
{0: 0, 1: 0, 2: Z}
953952
954953
sage: K.factor(0) is S2
955-
....:
956954
True
957955
sage: K.factor(0, as_subset=True) is S2
958956
False
@@ -1217,7 +1215,6 @@ def __init__(self, maps=None, vertex_name=None):
12171215
`\bar{f}_i: Y_i \to P`; the latter are only implemented in
12181216
Sage when each `Y_i` is finite. ::
12191217
1220-
sage:
12211218
sage: P.defining_map(0) == f0
12221219
True
12231220
sage: P.structure_map(1)

0 commit comments

Comments
 (0)