File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 19
19
from typing import Iterator
20
20
21
21
from sage .combinat .posets .lattices import LatticePoset
22
+ from sage .graphs .digraph import DiGraph
22
23
from sage .topology .simplicial_complex import SimplicialComplex
23
24
24
25
@@ -84,12 +85,23 @@ def sommets(n) -> Iterator[tuple[int, ...]]:
84
85
for w in iterator_False (n - 1 ):
85
86
yield (1 ,) + w
86
87
87
- verts = list (sommets (n ))
88
-
89
- def compare (a , b ) -> bool :
90
- return all (ai <= bi for ai , bi in zip (a , b ))
91
-
92
- return LatticePoset ([verts , compare ])
88
+ verts = frozenset (sommets (n ))
89
+
90
+ def cover_relations (a ):
91
+ for i , ai in enumerate (a ):
92
+ if not ai :
93
+ continue
94
+ b = list (a )
95
+ for k in range (ai - 1 , - 1 , - 1 ):
96
+ b [i ] = k
97
+ tb = tuple (b )
98
+ if tb in verts :
99
+ yield tb
100
+ break
101
+
102
+ dg = DiGraph ({a : list (cover_relations (a )) for a in verts },
103
+ format = "dict_of_lists" )
104
+ return LatticePoset (dg .reverse (), cover_relations = True , check = False )
93
105
94
106
95
107
def hochschild_fan (n ):
You can’t perform that action at this time.
0 commit comments