I don't know much about the design of Posets, I guess Travis knows much
more than I do. But from what I see, the problem comes specifically from
the relabel method, can you reproduce an equality error without using
relabel?

This, for instance, is working as it should:

sage: p1 = Poset(([1,2,3],[(2,1),(3,1)]))
sage: p2 = Poset(([1,3,2],[(2,1),(3,1)]))
sage: p1==p2
True



2014-09-29 13:57 GMT+02:00 Nathann Cohen <nathann.co...@gmail.com>:

> Hello everybody,
>
> Here is the current design of the Poset class:
>
> def Poset(an_acyclic_labelled_digraph):
>     ...
> FinitePoset(UniqueRepresentation):
>     def __init__(self, an_integer_labelled_hasse_diagram,
> list_of_vertex_labels):
>         ...
>
> As FinitePoset are UniqueRepresentation, two posets p1,p2 are equal if and
> only if they were created in the very same way, i.e. if the pairs
> (an_integer_labelled_hasse_diagram, list_of_vertex_labels) are equal in
> both cases.
>
> The problem, now, is the following: given a labelled digraph D, how can
> you associate to D in a unique way a pair
> (an_integer_labelled_hasse_diagram, list_of_vertex_labels) ?
>
> The answer, as far as I can tell, is that this is impossible because there
> is not necessarily a total order on the set of vertex labels.
>
> Apply any of the digraph automorphism to the list of labels and you get
> the very same graph, but the posets will be non-equal for
> UniqueRepresentation.
>
> This is one of the reasons behind the bug reported 2 years ago in #14019:
>
> sage: d = DiGraph({2:[1],3:[1]})
> sage: p1 = Poset(d)
> sage: p2 = p1.relabel({1:1,2:3,3:2})
> sage: p1.hasse_diagram() == p2.hasse_diagram()
> True
> sage: p1 == p2
> False
>
> We cannot have a UniqueRepresentation poset class which takes a list of
> vertices as arguments. It must only take a HasseDigraph. If you see another
> way, please enlighten me.
>
> Nathann
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to