Ticket #13244: trac_13244-simplicial.patch

File trac_13244-simplicial.patch, 30.4 KB (added by jhpalmieri, 9 years ago)
  • sage/homology/cell_complex.py

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1342122482 18000
    # Node ID f7d0ae454ee8a7622a73a99ea9e315c2a831b0d0
    # Parent  de6f14276102335ca8fac50d8ddca70ef76c05f9
    Make some simplicial complexes faster by defining them explicitly.
    
    diff --git a/sage/homology/cell_complex.py b/sage/homology/cell_complex.py
    a b class GenericCellComplex(SageObject): 
    180180        EXAMPLES::
    181181
    182182            sage: simplicial_complexes.KleinBottle().f_vector()
    183             [1, 9, 27, 18]
     183            [1, 8, 24, 16]
    184184            sage: delta_complexes.KleinBottle().f_vector()
    185185            [1, 1, 3, 2]
    186186            sage: cubical_complexes.KleinBottle().f_vector()
    class GenericCellComplex(SageObject): 
    197197        EXAMPLES::
    198198
    199199            sage: simplicial_complexes.KleinBottle()._f_dict()[1]
    200             27
     200            24
    201201            sage: delta_complexes.KleinBottle()._f_dict()[1]
    202202            3
    203203        """
  • sage/homology/examples.py

    diff --git a/sage/homology/examples.py b/sage/homology/examples.py
    a b def matching(A, B): 
    8484                    answer.append(new)
    8585    return answer
    8686
     87def facets_for_RP4():
     88    """
     89    Return the list of facets for a minimal triangulation of 4-dimensional
     90    real projective space. We use vertices numbered 1 through 16, define two
     91    facets, and define a certain subgroup `G` of the symmetric group `S_{16}`.
     92    Then the set of all facets is the `G`-orbit of the two given facets.
     93    See the description in Example 3.12 in Datta [Da2007]_.
     94
     95    EXAMPLES::
     96
     97        sage: from sage.homology.examples import facets_for_RP4
     98        sage: A = facets_for_RP4()   # long time (1 or 2 seconds)
     99        sage: SimplicialComplex(A) == simplicial_complexes.RealProjectiveSpace(4) # long time
     100        True
     101    """
     102    # Define the group:
     103    from sage.groups.perm_gps.permgroup import PermutationGroup
     104    g1 = '(2,7)(4,10)(5,6)(11,12)'
     105    g2 = '(1, 2, 3, 4, 5, 10)(6, 8, 9)(11, 12, 13, 14, 15, 16)'
     106    G = PermutationGroup([g1, g2])
     107    # Define the two simplices:
     108    t1 = (1, 2, 4, 5, 11)
     109    t2 = (1, 2, 4, 11, 13)
     110    # Apply the group elements to the simplices:
     111    facets = []
     112    for g in G:
     113        d = g.dict()
     114        for t in [t1, t2]:
     115            new = tuple([d[j] for j in t])
     116            if new not in facets:
     117                facets.append(new)
     118    return facets
     119
     120def facets_for_K3():
     121    """
     122    Returns the facets for a minimal triangulation of the K3
     123    surface. This is a pure simplicial complex of dimension 4 with 16
     124    vertices and 288 facets. The facets are obtained by constructing a
     125    few facets and a permutation group `G`, and then computing the
     126    `G`-orbit of those facets. See Casella and Kühnel in [CK2001]_ and
     127    Spreer and Kühnel [SK2011]_; the construction here uses the
     128    labeling from Spreer and Kühnel.
     129
     130    EXAMPLES::
     131
     132        sage: from sage.homology.examples import facets_for_K3
     133        sage: A = facets_for_K3()   # long time (a few seconds)
     134        sage: SimplicialComplex(A) == simplicial_complexes.K3Surface()  # long time
     135        True
     136    """
     137    from sage.groups.perm_gps.permgroup import PermutationGroup
     138    G = PermutationGroup([[(1,3,8,4,9,16,15,2,14,12,6,7,13,5,10)],
     139                         [(1,11,16),(2,10,14),(3,12,13),(4,9,15),(5,7,8)]])
     140    return ([tuple([g(i) for i in (1,2,3,8,12)]) for g in G]
     141            +[tuple([g(i) for i in (1,2,5,8,14)]) for g in G])
     142   
     143
    87144# for backwards compatibility:
    88145SimplicialSurface = SimplicialComplex
    89146
    class SimplicialComplexExamples(): 
    216273
    217274    def KleinBottle(self):
    218275        """
    219         A triangulation of the Klein bottle, formed by taking the
    220         connected sum of a real projective plane with itself.  (This is not
    221         a minimal triangulation.)
     276        A minimal triangulation of the Klein bottle, as presented for example
     277        in Davide Cervone's thesis [Ce1994]_.
    222278
    223279        EXAMPLES::
    224280
    225281            sage: simplicial_complexes.KleinBottle()
    226             Simplicial complex with 9 vertices and 18 facets
     282            Simplicial complex with vertex set (0, 1, 2, 3, 4, 5, 6, 7) and 16 facets
     283
     284        REFERENCES:
     285
     286        .. [Ce1994] D. P. Cervone, "Vertex-minimal simplicial immersions of the Klein
     287           bottle in three-space", Geom. Ded. 50 (1994) 117-141,
     288           http://www.math.union.edu/~dpvc/papers/1993-03.kb/vmkb.pdf.
    227289        """
    228         P = simplicial_complexes.RealProjectivePlane()
    229         return P.connected_sum(P)
     290        return SimplicialComplex([[2,3,7], [1,2,3], [1,3,5], [1,5,7],
     291                                  [1,4,7], [2,4,6], [1,2,6], [1,6,0],
     292                                  [1,4,0], [2,4,0], [3,4,7], [3,4,6],
     293                                  [3,5,6], [5,6,0], [2,5,0], [2,5,7]])
    230294
    231295    def SurfaceOfGenus(self, g, orientable=True):
    232296        """
    class SimplicialComplexExamples(): 
    331395        """
    332396        A minimal triangulation of the complex projective plane.
    333397
    334         This was constructed by Kühnel and Banchoff.
     398        This was constructed by Kühnel and Banchoff [KB1983]_.
    335399
    336400        REFERENCES:
    337401
    338         - W. Kühnel and T. F. Banchoff, "The 9-vertex complex
    339           projective plane", Math. Intelligencer 5 (1983), no. 3,
    340           11-22.
     402        .. [KB1983] W. Kühnel and T. F. Banchoff, "The 9-vertex complex
     403           projective plane", Math. Intelligencer 5 (1983), no. 3,
     404           11-22.
    341405
    342406        EXAMPLES::
    343407
    class SimplicialComplexExamples(): 
    370434        This is a manifold whose integral homology is identical to the
    371435        ordinary 3-sphere, but it is not simply connected.  The
    372436        triangulation given here has 16 vertices and is due to Björner
    373         and Lutz.
     437        and Lutz [BL2000]_.
    374438
    375439        REFERENCES:
    376440
    377         - Anders Björner and Frank H. Lutz, "Simplicial manifolds,
    378           bistellar flips and a 16-vertex triangulation of the
    379           Poincaré homology 3-sphere", Experiment. Math. 9 (2000),
    380           no. 2, 275-289.
     441        .. [BL2000] Anders Björner and Frank H. Lutz, "Simplicial
     442           manifolds, bistellar flips and a 16-vertex triangulation of
     443           the Poincaré homology 3-sphere", Experiment. Math. 9
     444           (2000), no. 2, 275-289.
    381445
    382446        EXAMPLES::
    383447
    class SimplicialComplexExamples(): 
    432496          triangles.
    433497
    434498        - `\Bold{R}P^3`: any triangulation has at least 11 vertices by
    435           a result of Walkup; this function returns a
    436           triangulation with 11 vertices, as given by Lutz.
     499          a result of Walkup [Wa1970]_; this function returns a
     500          triangulation with 11 vertices, as given by Lutz [Lu2005]_.
    437501
    438502        - `\Bold{R}P^4`: any triangulation has at least 16 vertices by
    439503          a result of Walkup; this function returns a triangulation
    440           with 16 vertices as given by Lutz; see also Datta, Example
    441           3.12.
     504          with 16 vertices as given by Lutz; see also Datta [Da2007]_,
     505          Example 3.12.
    442506
    443507        - `\Bold{R}P^n`: Lutz has found a triangulation of
    444508          `\Bold{R}P^5` with 24 vertices, but it does not seem to have
    445           been published.  Kühnel has described a triangulation of
     509          been published.  Kühnel [Ku1987]_ has described a triangulation of
    446510          `\Bold{R}P^n`, in general, with `2^{n+1}-1` vertices; see
    447511          also Datta, Example 3.21.  This triangulation is presumably
    448512          not minimal, but it seems to be the best in the published
    class SimplicialComplexExamples(): 
    453517        listing the facets.  For `n = 4`, this is constructed by
    454518        specifying 16 vertices, two facets, and a certain subgroup `G`
    455519        of the symmetric group `S_{16}`.  Then the set of all facets
    456         is the `G`-orbit of the two given facets.
     520        is the `G`-orbit of the two given facets.  This is implemented
     521        here by explicitly listing all of the facets; the facets
     522        can be computed by the function :func:`facets_for_RP4`, but
     523        running the function takes a few seconds.
    457524
    458525        For `n > 4`, the construction is as follows: let `S` denote
    459526        the simplicial complex structure on the `n`-sphere given by
    class SimplicialComplexExamples(): 
    475542
    476543        REFERENCES:
    477544
    478         - Basudeb Datta, "Minimal triangulations of manifolds",
    479           J. Indian Inst. Sci. 87 (2007), no. 4, 429-449.
     545        .. [Da2007] Basudeb Datta, "Minimal triangulations of manifolds",
     546           J. Indian Inst. Sci. 87 (2007), no. 4, 429-449.
    480547
    481         - W. Kühnel, "Minimal triangulations of Kummer varieties",
    482           Abh. Math. Sem. Univ. Hamburg 57 (1987), 7-20.
     548        .. [Ku1987] W. Kühnel, "Minimal triangulations of Kummer varieties",
     549           Abh. Math. Sem. Univ. Hamburg 57 (1987), 7-20.
    483550
    484         - Frank H. Lutz, "Triangulated Manifolds with Few Vertices:
    485           Combinatorial Manifolds", preprint (2005),
    486           arXiv:math/0506372.
     551        .. [Lu2005] Frank H. Lutz, "Triangulated Manifolds with Few Vertices:
     552           Combinatorial Manifolds", preprint (2005),
     553           arXiv:math/0506372.
    487554
    488         - David W. Walkup, "The lower bound conjecture for 3- and
    489           4-manifolds", Acta Math. 125 (1970), 75-107.
     555        .. [Wa1970] David W. Walkup, "The lower bound conjecture for 3- and
     556           4-manifolds", Acta Math. 125 (1970), 75-107.
    490557
    491558        EXAMPLES::
    492559
    class SimplicialComplexExamples(): 
    495562            [1, 11, 51, 80, 40]
    496563            sage: P3.homology()
    497564            {0: 0, 1: C2, 2: 0, 3: Z}
    498             sage: P4 = simplicial_complexes.RealProjectiveSpace(4) # long time (2s on sage.math, 2011)
    499             sage: P4.f_vector() # long time
     565            sage: P4 = simplicial_complexes.RealProjectiveSpace(4)
     566            sage: P4.f_vector()
    500567            [1, 16, 120, 330, 375, 150]
    501568            sage: P4.homology() # long time
    502569            {0: 0, 1: C2, 2: 0, 3: C2, 4: 0}
    class SimplicialComplexExamples(): 
    543610                 [2, 5, 7, 8], [3, 5, 9, 10], [4, 6, 7, 10], [1, 3, 7, 10],
    544611                 [1, 6, 8, 9], [2, 5, 7, 9], [3, 6, 7, 8], [5, 6, 7, 8]])
    545612        if n == 4:
    546             # The facets in RP^4 are constructed by specifying two
    547             # simplices on 16 vertices, and then finding their orbit
    548             # under a certain subgroup of the permutation group on 16
    549             # letters.  See the description in Example 3.12 in Datta.
    550             #
    551             # Define the group:
    552             from sage.groups.perm_gps.permgroup import PermutationGroup
    553             g1 = '(2,7)(4,10)(5,6)(11,12)'
    554             g2 = '(1, 2, 3, 4, 5, 10)(6, 8, 9)(11, 12, 13, 14, 15, 16)'
    555             G = PermutationGroup([g1, g2])
    556             # Define the two simplices:
    557             t1 = (1, 2, 4, 5, 11)
    558             t2 = (1, 2, 4, 11, 13)
    559             # Apply the group elements to the simplices:
    560             facets = []
    561             for g in G:
    562                 d = g.dict()
    563                 for t in [t1, t2]:
    564                     new = tuple([d[j] for j in t])
    565                     if new not in facets:
    566                         facets.append(new)
    567             return SimplicialComplex(facets)
     613            return SimplicialComplex(
     614                [(1, 3, 8, 12, 13), (2, 7, 8, 13, 16), (4, 8, 9, 12, 14),
     615                 (2, 6, 10, 12, 16), (5, 7, 9, 10, 13), (1, 2, 7, 8, 15),
     616                    (1, 3, 9, 11, 16), (5, 6, 8, 13, 16), (1, 3, 8, 11, 13),
     617                    (3, 4, 10, 13, 15), (4, 6, 9, 12, 15), (2, 4, 6, 11, 13),
     618                    (2, 3, 9, 12, 16), (1, 6, 9, 12, 15), (2, 5, 10, 11, 12),
     619                    (1, 7, 8, 12, 15), (2, 6, 9, 13, 16), (1, 5, 9, 11, 15),
     620                    (4, 9, 10, 13, 14), (2, 7, 8, 15, 16), (2, 3, 9, 12, 14),
     621                    (1, 6, 7, 10, 14), (2, 5, 10, 11, 15), (1, 2, 4, 13, 14),
     622                    (1, 6, 10, 14, 16), (2, 6, 9, 12, 16), (1, 3, 9, 12, 16),
     623                    (4, 5, 7, 11, 16), (5, 9, 10, 11, 15), (3, 5, 8, 12, 14),
     624                    (5, 6, 9, 13, 16), (5, 6, 9, 13, 15), (1, 3, 4, 10, 16),
     625                    (1, 6, 10, 12, 16), (2, 4, 6, 9, 13), (2, 4, 6, 9, 12),
     626                    (1, 2, 4, 11, 13), (7, 9, 10, 13, 14), (1, 7, 8, 12, 13),
     627                    (4, 6, 7, 11, 12), (3, 4, 6, 11, 13), (1, 5, 6, 9, 15),
     628                    (1, 6, 7, 14, 15), (2, 3, 7, 14, 15), (2, 6, 10, 11, 12),
     629                    (5, 7, 9, 10, 11), (1, 2, 4, 5, 14), (3, 5, 10, 13, 15),
     630                    (3, 8, 9, 12, 14), (5, 9, 10, 13, 15), (2, 6, 8, 13, 16),
     631                    (1, 2, 7, 13, 14), (1, 7, 10, 12, 13), (3, 4, 6, 13, 15),
     632                    (4, 9, 10, 13, 15), (2, 3, 10, 12, 16), (1, 2, 5, 14, 15),
     633                    (2, 6, 8, 10, 11), (1, 3, 10, 12, 13), (4, 8, 9, 12, 15),
     634                    (1, 3, 8, 9, 11), (4, 6, 7, 12, 15), (1, 8, 9, 11, 15),
     635                    (4, 5, 8, 14, 16), (1, 2, 8, 11, 13), (3, 6, 8, 11, 13),
     636                    (3, 6, 8, 11, 14), (3, 5, 8, 12, 13), (3, 7, 9, 11, 14),
     637                    (4, 6, 9, 13, 15), (2, 3, 5, 10, 12), (4, 7, 8, 15, 16),
     638                    (1, 2, 7, 14, 15), (3, 7, 9, 11, 16), (3, 6, 7, 14, 15),
     639                    (2, 6, 8, 11, 13), (4, 8, 9, 10, 14), (1, 4, 10, 13, 14),
     640                    (4, 8, 9, 10, 15), (2, 7, 9, 13, 16), (1, 6, 9, 12, 16),
     641                    (2, 3, 7, 9, 14), (4, 8, 10, 15, 16), (1, 5, 9, 11, 16),
     642                    (1, 5, 6, 14, 15), (5, 7, 9, 11, 16), (4, 5, 7, 11, 12),
     643                    (5, 7, 10, 11, 12), (2, 3, 10, 15, 16), (1, 2, 7, 8, 13),
     644                    (1, 6, 7, 10, 12), (1, 3, 10, 12, 16), (7, 9, 10, 11, 14),
     645                    (1, 7, 10, 13, 14), (1, 2, 4, 5, 11), (3, 4, 6, 7, 11),
     646                    (1, 6, 7, 12, 15), (1, 3, 4, 10, 13), (1, 4, 10, 14, 16),
     647                    (2, 4, 6, 11, 12), (5, 6, 8, 14, 16), (3, 5, 6, 8, 13),
     648                    (3, 5, 6, 8, 14), (1, 2, 8, 11, 15), (1, 4, 5, 14, 16),
     649                    (2, 3, 7, 15, 16), (8, 9, 10, 11, 14), (1, 3, 4, 11, 16),
     650                    (6, 8, 10, 14, 16), (8, 9, 10, 11, 15), (1, 3, 4, 11, 13),
     651                    (2, 4, 5, 12, 14), (2, 4, 9, 13, 14), (3, 4, 7, 11, 16),
     652                    (3, 6, 7, 11, 14), (3, 8, 9, 11, 14), (2, 8, 10, 11, 15),
     653                    (1, 3, 8, 9, 12), (4, 5, 7, 8, 16), (4, 5, 8, 12, 14),
     654                    (2, 4, 9, 12, 14), (6, 8, 10, 11, 14), (3, 5, 6, 13, 15),
     655                    (1, 4, 5, 11, 16), (3, 5, 6, 14, 15), (2, 4, 5, 11, 12),
     656                    (4, 5, 7, 8, 12), (1, 8, 9, 12, 15), (5, 7, 8, 13, 16),
     657                    (2, 3, 5, 12, 14), (3, 5, 10, 12, 13), (6, 7, 10, 11, 12),
     658                    (5, 7, 9, 13, 16), (6, 7, 10, 11, 14), (5, 7, 10, 12, 13),
     659                    (1, 2, 5, 11, 15), (1, 5, 6, 9, 16), (5, 7, 8, 12, 13),
     660                    (4, 7, 8, 12, 15), (2, 3, 5, 10, 15), (2, 6, 8, 10, 16),
     661                    (3, 4, 10, 15, 16), (1, 5, 6, 14, 16), (2, 3, 5, 14, 15),
     662                    (2, 3, 7, 9, 16), (2, 7, 9, 13, 14), (3, 4, 6, 7, 15),
     663                    (4, 8, 10, 14, 16), (3, 4, 7, 15, 16), (2, 8, 10, 15, 16)])
    568664        if n >= 5:
    569665            # Use the construction given by Datta in Example 3.21.
    570666            V = set(range(0, n+2))
    class SimplicialComplexExamples(): 
    586682        Returns a minimal triangulation of the K3 surface. This is
    587683        a pure simplicial complex of dimension 4 with 16 vertices
    588684        and 288 facets. It was constructed by Casella and Kühnel
    589         in [CK2001]_.  The construction here uses the labeling from
     685        in [CK2001]_. The construction here uses the labeling from
    590686        Spreer and Kühnel [SK2011]_.
    591687
    592688        REFERENCES:
    class SimplicialComplexExamples(): 
    605701            Simplicial complex with 16 vertices and 288 facets
    606702            sage: K3.f_vector()
    607703            [1, 16, 120, 560, 720, 288]
     704
     705        This simplicial complex is implemented just by listing all 288
     706        facets. The list of facets can be computed by the function
     707        :func:`facets_for_K3`, but running the function takes a few
     708        seconds.
    608709        """
    609         from sage.groups.perm_gps.permgroup import PermutationGroup
    610         G = PermutationGroup([[(1,3,8,4,9,16,15,2,14,12,6,7,13,5,10)],[(1,11,16),(2,10,14),(3,12,13),(4,9,15),(5,7,8)]])
    611         return SimplicialComplex([tuple([g(i) for i in (1,2,3,8,12)]) for g in G]+[tuple([g(i) for i in (1,2,5,8,14)]) for g in G])
     710        return SimplicialComplex(
     711            [(2, 10, 13, 15, 16), (2, 8, 11, 15, 16), (2, 5, 7, 8, 10),
     712             (1, 9, 11, 13, 14), (1, 2, 8, 10, 12), (1, 3, 5, 6, 11),
     713                (1, 5, 6, 9, 12), (1, 2, 6, 13, 16), (1, 4, 10, 13, 14),
     714                (1, 9, 10, 14, 15), (2, 4, 7, 8, 12), (3, 4, 6, 10, 12),
     715                (1, 6, 7, 8, 9), (3, 4, 5, 7, 15), (1, 7, 12, 15, 16),
     716                (4, 5, 7, 13, 16), (5, 8, 11, 12, 15), (2, 4, 7, 12, 14),
     717                (1, 4, 5, 14, 16), (2, 5, 6, 10, 11), (1, 6, 8, 12, 14),
     718                (5, 8, 9, 14, 16), (5, 10, 11, 12, 13), (2, 4, 8, 9, 12),
     719                (7, 9, 12, 15, 16), (1, 2, 6, 9, 15), (1, 5, 14, 15, 16),
     720                (2, 3, 4, 5, 9), (6, 8, 10, 11, 15), (1, 5, 8, 10, 12),
     721                (1, 3, 7, 9, 10), (6, 7, 8, 9, 13), (1, 2, 9, 11, 15),
     722                (2, 8, 11, 14, 16), (2, 4, 5, 13, 16), (1, 4, 8, 13, 15),
     723                (4, 7, 8, 10, 11), (2, 3, 9, 11, 14), (2, 3, 4, 9, 13),
     724                (2, 8, 10, 12, 13), (1, 2, 4, 11, 15), (2, 3, 9, 11, 15),
     725                (3, 5, 10, 13, 15), (3, 4, 5, 9, 11), (6, 10, 13, 15, 16),
     726                (8, 10, 11, 15, 16), (6, 7, 11, 13, 15), (1, 5, 7, 15, 16),
     727                (4, 5, 7, 9, 15), (3, 4, 6, 7, 16), (2, 3, 11, 14, 16),
     728                (3, 4, 9, 11, 13), (1, 2, 5, 14, 15), (2, 3, 9, 13, 14),
     729                (1, 2, 5, 13, 16), (2, 3, 7, 8, 12), (2, 9, 11, 12, 14),
     730                (1, 9, 11, 15, 16), (4, 6, 9, 14, 16), (1, 4, 9, 13, 14),
     731                (1, 2, 3, 12, 16), (8, 11, 12, 14, 15), (2, 4, 11, 12, 14),
     732                (1, 4, 10, 12, 13), (1, 2, 6, 7, 13), (1, 3, 6, 10, 11),
     733                (1, 6, 8, 9, 12), (1, 4, 5, 6, 14), (3, 9, 10, 12, 15),
     734                (5, 8, 11, 12, 16), (5, 9, 10, 14, 15), (3, 9, 12, 15, 16),
     735                (3, 6, 8, 14, 15), (2, 4, 9, 10, 16), (5, 8, 9, 13, 15),
     736                (2, 3, 6, 9, 15), (6, 11, 12, 14, 16), (2, 3, 10, 13, 15),
     737                (2, 8, 9, 10, 13), (3, 4, 8, 11, 13), (3, 4, 5, 7, 13),
     738                (5, 7, 8, 10, 14), (4, 12, 13, 14, 15), (6, 7, 10, 14, 16),
     739                (5, 10, 11, 13, 14), (3, 4, 7, 13, 16), (6, 8, 9, 12, 13),
     740                (1, 3, 4, 10, 14), (2, 4, 6, 11, 12), (1, 7, 9, 10, 14),
     741                (4, 6, 8, 13, 14), (4, 9, 10, 11, 16), (3, 7, 8, 10, 16),
     742                (5, 7, 9, 15, 16), (1, 7, 9, 11, 14), (6, 8, 10, 15, 16),
     743                (5, 8, 9, 10, 14), (7, 8, 10, 14, 16), (2, 6, 7, 9, 11),
     744                (7, 9, 10, 13, 15), (3, 6, 7, 10, 12), (2, 4, 6, 10, 11),
     745                (4, 5, 8, 9, 11), (1, 2, 3, 8, 16), (3, 7, 9, 10, 12),
     746                (1, 2, 6, 8, 14), (3, 5, 6, 13, 15), (1, 5, 6, 12, 14),
     747                (2, 5, 7, 14, 15), (1, 5, 10, 11, 12), (3, 7, 8, 10, 11),
     748                (1, 2, 6, 14, 15), (1, 2, 6, 8, 16), (7, 9, 10, 12, 15),
     749                (3, 4, 6, 8, 14), (3, 7, 13, 14, 16), (2, 5, 7, 8, 14),
     750                (6, 7, 9, 10, 14), (2, 3, 7, 12, 14), (4, 10, 12, 13, 14),
     751                (2, 5, 6, 11, 13), (4, 5, 6, 7, 16), (1, 3, 12, 13, 16),
     752                (1, 4, 11, 15, 16), (1, 3, 4, 6, 10), (1, 10, 11, 12, 13),
     753                (6, 9, 11, 12, 14), (1, 4, 7, 8, 15), (5, 8, 9, 10, 13),
     754                (1, 2, 5, 7, 15), (1, 7, 12, 13, 16), (3, 11, 13, 14, 16),
     755                (1, 2, 5, 7, 13), (4, 7, 8, 9, 15), (1, 5, 6, 10, 11),
     756                (6, 7, 10, 13, 15), (3, 4, 7, 14, 15), (7, 11, 13, 14, 16),
     757                (3, 4, 10, 12, 14), (3, 6, 8, 10, 16), (2, 7, 8, 14, 16),
     758                (2, 3, 4, 5, 13), (5, 8, 12, 13, 15), (4, 6, 9, 13, 14),
     759                (2, 4, 5, 6, 12), (1, 3, 7, 8, 9), (8, 11, 12, 14, 16),
     760                (1, 7, 12, 13, 15), (8, 12, 13, 14, 15), (2, 8, 9, 12, 13),
     761                (4, 6, 10, 12, 15), (2, 8, 11, 14, 15), (2, 6, 9, 11, 12),
     762                (8, 9, 10, 11, 16), (2, 3, 6, 13, 15), (2, 3, 12, 15, 16),
     763                (1, 3, 5, 9, 12), (2, 5, 6, 9, 12), (2, 10, 12, 13, 14),
     764                (2, 6, 13, 15, 16), (2, 3, 11, 15, 16), (3, 5, 6, 8, 15),
     765                (2, 4, 5, 9, 12), (5, 6, 8, 11, 15), (6, 8, 12, 13, 14),
     766                (1, 2, 3, 8, 12), (1, 4, 7, 8, 11), (3, 5, 7, 14, 15),
     767                (3, 5, 7, 13, 14), (1, 7, 10, 11, 14), (6, 7, 11, 12, 15),
     768                (3, 4, 6, 7, 12), (1, 2, 4, 7, 11), (6, 9, 10, 14, 16),
     769                (4, 10, 12, 15, 16), (5, 6, 7, 12, 16), (3, 9, 11, 13, 14),
     770                (5, 9, 14, 15, 16), (4, 5, 6, 7, 12), (1, 3, 9, 10, 15),
     771                (4, 7, 8, 9, 12), (5, 9, 10, 13, 15), (1, 3, 8, 13, 16),
     772                (2, 9, 12, 13, 14), (6, 7, 10, 12, 15), (2, 6, 8, 14, 15),
     773                (3, 5, 6, 8, 11), (3, 4, 7, 12, 14), (1, 3, 10, 14, 15),
     774                (7, 11, 12, 13, 16), (3, 11, 12, 13, 16), (3, 4, 5, 8, 15),
     775                (2, 4, 7, 8, 10), (2, 4, 7, 14, 15), (1, 2, 10, 12, 16),
     776                (1, 6, 8, 13, 16), (1, 7, 8, 13, 15), (3, 9, 11, 15, 16),
     777                (4, 6, 10, 11, 15), (2, 4, 11, 14, 15), (1, 3, 8, 9, 12),
     778                (1, 3, 6, 14, 15), (2, 4, 5, 6, 10), (1, 4, 9, 14, 16),
     779                (5, 7, 9, 12, 16), (1, 3, 7, 10, 11), (7, 8, 9, 13, 15),
     780                (3, 5, 10, 14, 15), (1, 4, 10, 12, 16), (3, 4, 5, 8, 11),
     781                (1, 2, 6, 7, 9), (1, 3, 11, 12, 13), (1, 5, 7, 13, 16),
     782                (5, 7, 10, 11, 14), (2, 10, 12, 15, 16), (3, 6, 7, 10, 16),
     783                (1, 2, 5, 8, 10), (4, 10, 11, 15, 16), (5, 8, 10, 12, 13),
     784                (3, 6, 8, 10, 11), (4, 5, 7, 9, 12), (6, 7, 11, 12, 16),
     785                (3, 5, 9, 11, 16), (8, 9, 10, 14, 16), (3, 4, 6, 8, 16),
     786                (1, 10, 11, 13, 14), (2, 9, 10, 13, 16), (1, 2, 5, 8, 14),
     787                (2, 4, 5, 10, 16), (1, 2, 7, 9, 11), (1, 3, 5, 6, 9),
     788                (5, 7, 11, 13, 14), (3, 5, 10, 13, 14), (2, 4, 8, 9, 10),
     789                (4, 11, 12, 14, 15), (2, 3, 7, 14, 16), (3, 4, 8, 13, 16),
     790                (6, 7, 9, 11, 14), (5, 6, 11, 13, 15), (4, 5, 6, 14, 16),
     791                (3, 4, 8, 14, 15), (4, 5, 8, 9, 15), (1, 4, 8, 11, 13),
     792                (5, 6, 12, 14, 16), (2, 3, 10, 12, 14), (1, 2, 5, 10, 16),
     793                (2, 5, 7, 10, 11), (2, 6, 7, 11, 13), (1, 4, 5, 10, 16),
     794                (2, 6, 8, 15, 16), (2, 3, 10, 12, 15), (7, 11, 12, 13, 15),
     795                (1, 3, 8, 11, 13), (4, 8, 9, 10, 11), (1, 9, 14, 15, 16),
     796                (1, 3, 6, 9, 15), (6, 9, 12, 13, 14), (2, 3, 10, 13, 14),
     797                (2, 5, 7, 11, 13), (2, 3, 5, 6, 13), (4, 6, 8, 13, 16),
     798                (6, 7, 9, 10, 13), (5, 8, 12, 14, 16), (4, 6, 9, 13, 16),
     799                (5, 8, 9, 11, 16), (2, 3, 5, 6, 9), (1, 3, 5, 11, 12),
     800                (3, 7, 8, 9, 12), (4, 6, 11, 12, 15), (3, 5, 9, 12, 16),
     801                (5, 11, 12, 13, 15), (1, 3, 4, 6, 14), (3, 5, 11, 12, 16),
     802                (1, 5, 8, 12, 14), (4, 8, 13, 14, 15), (1, 3, 7, 8, 11),
     803                (6, 9, 10, 13, 16), (2, 4, 9, 13, 16), (1, 6, 7, 8, 13),
     804                (1, 4, 12, 13, 15), (2, 4, 7, 10, 11), (1, 4, 9, 11, 13),
     805                (6, 7, 11, 14, 16), (1, 4, 9, 11, 16), (1, 4, 12, 15, 16),
     806                (1, 2, 4, 7, 15), (2, 3, 7, 8, 16), (1, 4, 5, 6, 10)])
    612807
    613808    ###############################################################
    614809    # examples from graph theory:
    class SimplicialComplexExamples(): 
    635830
    636831        -  ``n``, ``i`` - non-negative integers with `i` at most `n`
    637832
    638         See Dumas et al. for information on computing its homology by
    639         computer, and see Babson et al. for theory.  For example,
     833        See Dumas et al. [DHSW2003]_ for information on computing its homology by
     834        computer, and see Babson et al. [BBLSW1999]_ for theory.  For example,
    640835        Babson et al. show that when `i=2`, the reduced homology of
    641836        this complex is nonzero only in dimension `2n-5`, where it is
    642837        free abelian of rank `(n-2)!`.
    class SimplicialComplexExamples(): 
    650845
    651846        REFERENCES:
    652847
    653         - Babson, Bjorner, Linusson, Shareshian, and Welker,
    654           "Complexes of not i-connected graphs," Topology 38 (1999),
    655           271-299
     848        .. [BBLSW1999] Babson, Bjorner, Linusson, Shareshian, and Welker,
     849           "Complexes of not i-connected graphs," Topology 38 (1999),
     850           271-299
    656851
    657         - Dumas, Heckenbach, Saunders, Welker, "Computing simplicial
    658           homology based on efficient Smith normal form algorithms,"
    659           in "Algebra, geometry, and software systems" (2003),
    660           177-206.
     852        .. [DHSW2003] Dumas, Heckenbach, Saunders, Welker, "Computing simplicial
     853           homology based on efficient Smith normal form algorithms,"
     854           in "Algebra, geometry, and software systems" (2003),
     855           177-206.
    661856        """
    662857        G_list = range(1,n+1)
    663858        G_vertices = Set(G_list)
    class SimplicialComplexExamples(): 
    699894
    700895        -  ``n`` - positive integer.
    701896   
    702         See Dumas et al. for information on computing its homology by
    703         computer, and see Wachs for an expository article about the
     897        See Dumas et al. [DHSW2003]_ for information on computing its homology by
     898        computer, and see Wachs [Wa2003]_ for an expository article about the
    704899        theory.  For example, the homology of these complexes seems to
    705900        have only mod 3 torsion, and this has been proved for the
    706901        bottom non-vanishing homology group for the matching complex
    class SimplicialComplexExamples(): 
    719914
    720915        REFERENCES:
    721916
    722         - Dumas, Heckenbach, Saunders, Welker, "Computing simplicial
    723           homology based on efficient Smith normal form algorithms,"
    724           in "Algebra, geometry, and software systems" (2003),
    725           177-206.
    726 
    727         - Wachs, "Topology of Matching, Chessboard and General Bounded
    728           Degree Graph Complexes" (Algebra Universalis Special Issue
    729           in Memory of Gian-Carlo Rota, Algebra Universalis, 49 (2003)
    730           345-385)
     917        .. [Wa2003] Wachs, "Topology of Matching, Chessboard and General Bounded
     918           Degree Graph Complexes" (Algebra Universalis Special Issue
     919           in Memory of Gian-Carlo Rota, Algebra Universalis, 49 (2003)
     920           345-385)
    731921        """
    732922        G_vertices = Set(range(1,n+1))
    733923        E_list = []
    class SimplicialComplexExamples(): 
    792982
    793983        -  ``n, i`` - positive integers.
    794984   
    795         See Dumas et al. for information on computing its homology by
    796         computer, and see Wachs for an expository article about the
    797         theory.
     985        See Dumas et al. [DHSW2003]_ for information on computing its homology
     986        by computer, and see Wachs [Wa2003]_ for an expository article about
     987        the theory.
    798988
    799989        EXAMPLES::
    800990
    class SimplicialComplexExamples(): 
    803993            [1, 25, 200, 600, 600, 120]
    804994            sage: simplicial_complexes.ChessboardComplex(3,3).homology()
    805995            {0: 0, 1: Z x Z x Z x Z, 2: 0}
    806 
    807         REFERENCES:
    808 
    809         - Dumas, Heckenbach, Saunders, Welker, "Computing simplicial
    810           homology based on efficient Smith normal form algorithms,"
    811           in "Algebra, geometry, and software systems" (2003),
    812           177-206.
    813 
    814         - Wachs, "Topology of Matching, Chessboard and General Bounded
    815           Degree Graph Complexes" (Algebra Universalis Special Issue
    816           in Memory of Gian-Carlo Rota, Algebra Universalis, 49 (2003)
    817           345-385)
    818996        """
    819997        A = range(n)
    820998        B = range(i)
    class SimplicialComplexExamples(): 
    8461024           (optional, default 0.5)
    8471025
    8481026        A random `d`-dimensional simplicial complex on `n` vertices,
    849         as defined for example by Meshulam and Wallach, is constructed
    850         as follows: take `n` vertices and include all of the simplices
    851         of dimension strictly less than `d`, and then for each
     1027        as defined for example by Meshulam and Wallach [MW2009]_, is
     1028        constructed as follows: take `n` vertices and include all of
     1029        the simplices of dimension strictly less than `d`, and then for each
    8521030        possible simplex of dimension `d`, include it with probability
    8531031        `p`.
    8541032
    class SimplicialComplexExamples(): 
    8661044
    8671045        REFERENCES:
    8681046
    869         - Meshulam and Wallach, "Homological connectivity of random
    870           `k`-dimensional complexes", preprint, math.CO/0609773.
     1047        .. [MW2009] Meshulam and Wallach, "Homological connectivity of random
     1048           `k`-dimensional complexes", preprint, math.CO/0609773.
    8711049        """
    8721050        if d > n+1:
    8731051            return simplicial_complexes.Simplex(n+1)
  • sage/homology/simplicial_complex.py

    diff --git a/sage/homology/simplicial_complex.py b/sage/homology/simplicial_complex.py
    a b class SimplicialComplex(GenericCellCompl 
    11611161            sage: T = simplicial_complexes.Torus(); T
    11621162            Simplicial complex with vertex set (0, 1, 2, 3, 4, 5, 6) and 14 facets
    11631163            sage: K = simplicial_complexes.KleinBottle(); K
    1164             Simplicial complex with 9 vertices and 18 facets
     1164            Simplicial complex with vertex set (0, 1, 2, 3, 4, 5, 6, 7) and 16 facets
    11651165            sage: T.product(K)      # long time: 5 or 6 seconds
    1166             Simplicial complex with 63 vertices and 1512 facets
     1166            Simplicial complex with 56 vertices and 1344 facets
    11671167        """
    11681168        vertices = []
    11691169        for v in self.vertices():
  • sage/homology/simplicial_complex_homset.py

    diff --git a/sage/homology/simplicial_complex_homset.py b/sage/homology/simplicial_complex_homset.py
    a b class SimplicialComplexHomset(sage.categ 
    158158            sage: H = Hom(S,T)
    159159            sage: x = H.an_element()
    160160            sage: x
    161             Simplicial complex morphism {0: 0, 1: 0, 2: 0, 'R3': 0, 'L4': 0, 'L5': 0, 'L3': 0, 'R5': 0, 'R4': 0} from Simplicial complex with 9 vertices and 18 facets to Simplicial complex with vertex set (0, 1, 2, 3, 4, 5, 6) and 7 facets
    162 
     161            Simplicial complex morphism {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0} from Simplicial complex with vertex set (0, 1, 2, 3, 4, 5, 6, 7) and 16 facets to Simplicial complex with vertex set (0, 1, 2, 3, 4, 5, 6) and 7 facets
    163162        """
    164163        X_vertices = self._domain.vertices().set()
    165164        try: