|
18 | 18 | from itertools import combinations |
19 | 19 |
|
20 | 20 | from sage.categories.fields import Fields |
21 | | -from sage.homology.homology_group import HomologyGroup |
22 | 21 | from sage.misc.cachefunc import cached_method |
23 | 22 | from sage.misc.lazy_attribute import lazy_attribute |
| 23 | +from sage.misc.lazy_import import lazy_import |
24 | 24 | from sage.rings.integer_ring import ZZ |
25 | 25 | from sage.rings.rational_field import QQ |
26 | 26 | from sage.structure.sage_object import SageObject |
|
29 | 29 | from sage.topology.cubical_complex import CubicalComplex, cubical_complexes |
30 | 30 | from sage.topology.simplicial_complex import SimplicialComplex, copy |
31 | 31 |
|
| 32 | +lazy_import('sage.homology.homology_group', 'HomologyGroup') |
| 33 | + |
32 | 34 |
|
33 | 35 | def _cubical_complex_union(c1, c2): |
34 | 36 | """ |
@@ -130,11 +132,11 @@ class MomentAngleComplex(UniqueRepresentation, SageObject): |
130 | 132 | We can perform a number of operations, such as find the dimension or |
131 | 133 | compute the homology:: |
132 | 134 |
|
133 | | - sage: M.homology() |
| 135 | + sage: M.homology() # needs sage.modules |
134 | 136 | {0: 0, 1: 0, 2: 0, 3: Z} |
135 | 137 | sage: Z.dimension() |
136 | 138 | 6 |
137 | | - sage: Z.homology() |
| 139 | + sage: Z.homology() # needs sage.modules |
138 | 140 | {0: 0, 1: 0, 2: 0, 3: Z x Z, 4: Z, 5: Z, 6: Z} |
139 | 141 |
|
140 | 142 | If the associated simplicial complex is an `n`-simplex, then the |
@@ -403,9 +405,9 @@ def components(self): |
403 | 405 |
|
404 | 406 | sage: S3 = simplicial_complexes.Sphere(3) |
405 | 407 | sage: product_of_spheres = S3.product(S3) |
406 | | - sage: Z.cohomology() |
| 408 | + sage: Z.cohomology() # needs sage.modules |
407 | 409 | {0: 0, 1: 0, 2: 0, 3: Z x Z, 4: 0, 5: 0, 6: Z} |
408 | | - sage: Z.cohomology() == product_of_spheres.cohomology() # long time |
| 410 | + sage: Z.cohomology() == product_of_spheres.cohomology() # long time # needs sage.modules |
409 | 411 | True |
410 | 412 | """ |
411 | 413 | return self._components |
@@ -453,6 +455,7 @@ def _homology_group(self, i, base_ring, cohomology, algorithm, verbose, reduced) |
453 | 455 |
|
454 | 456 | TESTS:: |
455 | 457 |
|
| 458 | + sage: # needs sage.modules |
456 | 459 | sage: Z = MomentAngleComplex([[0,1,2], [1,2,3]]); Z |
457 | 460 | Moment-angle complex of Simplicial complex with vertex set |
458 | 461 | (0, 1, 2, 3) and facets {(0, 1, 2), (1, 2, 3)} |
@@ -550,6 +553,7 @@ def homology(self, dim=None, base_ring=ZZ, cohomology=False, |
550 | 553 |
|
551 | 554 | EXAMPLES:: |
552 | 555 |
|
| 556 | + sage: # needs sage.modules |
553 | 557 | sage: Z = MomentAngleComplex([[0,1,2], [1,2,3], [3,0]]); Z |
554 | 558 | Moment-angle complex of Simplicial complex with vertex set |
555 | 559 | (0, 1, 2, 3) and facets {(0, 3), (0, 1, 2), (1, 2, 3)} |
@@ -580,13 +584,14 @@ def homology(self, dim=None, base_ring=ZZ, cohomology=False, |
580 | 584 | (0, 1, 2) and facets {(0, 1), (0, 2), (1, 2)} |
581 | 585 | sage: Z.cubical_complex() |
582 | 586 | Cubical complex with 64 vertices and 729 cubes |
583 | | - sage: Z.cubical_complex().homology() == Z.homology() |
| 587 | + sage: Z.cubical_complex().homology() == Z.homology() # needs sage.modules |
584 | 588 | True |
585 | 589 |
|
586 | 590 | Meanwhile, the homology computation used here is quite efficient |
587 | 591 | and works well even with significantly larger underlying simplicial |
588 | 592 | complexes:: |
589 | 593 |
|
| 594 | + sage: # needs sage.modules |
590 | 595 | sage: Z = MomentAngleComplex([[0,1,2,3,4,5], [0,1,2,3,4,6], |
591 | 596 | ....: [0,1,2,3,5,7], [0,1,2,3,6,8,9]]) |
592 | 597 | sage: Z.homology() # long time |
@@ -656,6 +661,7 @@ def cohomology(self, dim=None, base_ring=ZZ, algorithm='pari', |
656 | 661 | to a product of two 3-spheres (which can be seen by looking at the |
657 | 662 | output of ``components()``):: |
658 | 663 |
|
| 664 | + sage: # needs sage.modules |
659 | 665 | sage: S3 = simplicial_complexes.Sphere(3) |
660 | 666 | sage: product_of_spheres = S3.product(S3) |
661 | 667 | sage: Z.cohomology() |
@@ -684,6 +690,7 @@ def betti(self, dim=None): |
684 | 690 |
|
685 | 691 | EXAMPLES:: |
686 | 692 |
|
| 693 | + sage: # needs sage.modules |
687 | 694 | sage: Z = MomentAngleComplex([[0,1], [1,2], [2,0], [1,2,3]]) |
688 | 695 | sage: Z.betti() |
689 | 696 | {0: 1, 1: 0, 2: 0, 3: 1, 4: 0, 5: 1, 6: 1, 7: 0} |
@@ -714,6 +721,7 @@ def euler_characteristic(self): |
714 | 721 |
|
715 | 722 | EXAMPLES:: |
716 | 723 |
|
| 724 | + sage: # needs sage.modules |
717 | 725 | sage: X = SimplicialComplex([[0,1,2,3,4,5], [0,1,2,3,4,6], |
718 | 726 | ....: [0,1,2,3,5,7], [0,1,2,3,6,8,9]]) |
719 | 727 | sage: M = MomentAngleComplex(X) |
|
0 commit comments