Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

""" 

Simplicial Complexes 

""" 

#***************************************************************************** 

# Copyright (C) 2015 Travis Scrimshaw <tscrim at ucdavis.edu> 

# 

# Distributed under the terms of the GNU General Public License (GPL) 

# http://www.gnu.org/licenses/ 

#****************************************************************************** 

 

from sage.misc.abstract_method import abstract_method 

from sage.misc.cachefunc import cached_method 

from sage.categories.category_singleton import Category_singleton 

from sage.categories.category_with_axiom import CategoryWithAxiom 

#from sage.categories.cw_complexes import CWComplexes 

from sage.categories.sets_cat import Sets 

 

class SimplicialComplexes(Category_singleton): 

r""" 

The category of abstract simplicial complexes. 

 

An abstract simplicial complex `A` is a collection of sets `X` 

such that: 

 

- `\emptyset \in A`, 

- if `X \subset Y \in A`, then `X \in A`. 

 

.. TODO:: 

 

Implement the category of simplicial complexes considered 

as :class:`CW complexes <sage.categories.cw_complexes.CWComplexes>` 

and rename this to the category of ``AbstractSimplicialComplexes`` 

with appropriate functors. 

 

EXAMPLES:: 

 

sage: from sage.categories.simplicial_complexes import SimplicialComplexes 

sage: C = SimplicialComplexes(); C 

Category of simplicial complexes 

 

TESTS:: 

 

sage: TestSuite(C).run() 

""" 

@cached_method 

def super_categories(self): 

""" 

EXAMPLES:: 

 

sage: from sage.categories.simplicial_complexes import SimplicialComplexes 

sage: SimplicialComplexes().super_categories() 

[Category of sets] 

""" 

return [Sets()] 

 

class Finite(CategoryWithAxiom): 

""" 

Category of finite simplicial complexes. 

""" 

class ParentMethods: 

@cached_method 

def dimension(self): 

""" 

Return the dimension of ``self``. 

 

EXAMPLES:: 

 

sage: S = SimplicialComplex([[1,3,4], [1,2],[2,5],[4,5]]) 

sage: S.dimension() 

2 

""" 

return max(c.dimension() for c in self.facets()) 

 

class ParentMethods: 

@abstract_method 

def facets(self): 

""" 

Return the facets of ``self``. 

 

EXAMPLES:: 

 

sage: S = SimplicialComplex([[1,3,4], [1,2],[2,5],[4,5]]) 

sage: S.facets() 

{(1, 2), (1, 3, 4), (2, 5), (4, 5)} 

""" 

 

@abstract_method 

def faces(self): 

""" 

Return the faces of ``self``. 

 

EXAMPLES:: 

 

sage: S = SimplicialComplex([[1,3,4], [1,2],[2,5],[4,5]]) 

sage: S.faces() 

{-1: {()}, 

0: {(1,), (2,), (3,), (4,), (5,)}, 

1: {(1, 2), (1, 3), (1, 4), (2, 5), (3, 4), (4, 5)}, 

2: {(1, 3, 4)}} 

"""