> In part. But more importantly because LinearExtensionsOfPoset accepts > a list as input, and lists are not hashable. So class call needs to > transform it into a tuple before passing it down to > UniqueRepresentation. See the documentation of UniqueRepresentation > for details.
Ok, thank you! > Ok. Then don't we want instead to be able to specify a linear > extension to the Poset constructor? > > Say: > > sage: P = Poset(...., linear_extension = [1,2,3,4,5,6,7]) > > Which could be used as well to change the default linear extension: > > sage: Q = Poset(P, linear_extension = [1,3,2,5,4,6,7]) > > Also we might want to have Poset be clever enough to test if the list > of vertices provided by the user is a linear extension, and if it is > to use it as default linear extension rather than looking for some > random one? Having this as an input in Poset was my very first suggestion. But now my inclination is actual different. I think the real culprit that throws me off in the applications I have in mind are the methods def _vertex_to_element(self,vertex): and def _element_to_vertex(self,element): in /combinat/posets/posets.py, which assign the integers 0,1,2,....,n-1 to the elements in the poset. The linear extension of a given poset is in fact set to the identity (which is what I really want) sage: P = Poset(([1,2,3,4,5,6,7], [[1,2],[1,4],[2,3],[2,5],[3,6],[4,7],[5,6]]), cover_relations = True) sage: P._hasse_diagram.linear_extension() [0, 1, 2, 3, 4, 5, 6] sage: P.linear_extension() [1, 2, 3, 5, 6, 4, 7] So if I use ._hasse_diagram.linear_extension() and linear_extensions() and not use the assignment to the element of the poset, this would work much better. Also, I tend to think of linear extensions as permutations rather than lists of poset elements. In this light ... > I am a bit confused now. I guess part of the question is whether we > want to have a double use for P.linear_extension: > > sage: P.linear_extension() > returns the default linear extension of P (as a list or as a linear > extension?) > > sage: P.linear_extension([1,5,3]) > returns the linear extension [1,5,3] ... we could leave P.linear_extension() and P.linear_extensions() as is and have them return lists of elements of the poset, and then the new class LinearExtensionOfPoset represents its elements as permutations (in one line notation) of {1,2,...,n} for a poset of size n. Then I can get rid of the "order" input. What do you think? Best, Anne -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.