#14019: equality is broken for Posets
-------------------------------------+-------------------------------------
       Reporter:  ncohen             |        Owner:  sage-combinat
           Type:  defect             |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.4
      Component:  combinatorics      |   Resolution:
       Keywords:  posets             |    Merged in:
        Authors:  Travis Scrimshaw,  |    Reviewers:  Travis Scrimshaw,
  Anne Schilling                     |  Anne Schilling
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  public/combinat/poset/fix_equality-14019|  
8dddb16ee9bce94fab03989228cf83dd567f8ac0
   Dependencies:  #17059             |     Stopgaps:  #14185
-------------------------------------+-------------------------------------

Comment (by aschilling):

 Hi Nathann,

 > My mistake, I was convinced that I had displayed the poset with a
 `.show()` and looked at a path labelled with 0,1,2,3,... while the linear
 extension was 0,9,... There is nothing wrong with this example indeed.

 Ok. Why does the documentation say *unique* though? It does not make sense
 to me.

 > This being said, i still do not understand the code. Is the following
 behaviour correct ?
 >
 > {{{
 > sage: P =
 Poset(digraphs.Path(4),['a','b','c','d'],linear_extension=True)
 > sage: list(P.canonical_label())
 > [0, 1, 2, 3]
 > }}}

 I think so. The documentation says that `canonical_label` is supposed to
 label the poset with elements `\{0,1,\ldots,n-1\}`. I changed the code
 slightly, so that [0,1,2,...]
 is a linear extension of the canonical relabeled poset.

 > I do not understand what you do with the `elements` list in
 `canonical_label` given that the output is labelled with `0,1,2,3`.
 Especially when `linear_extension=False` `O_o`

 The documentation says that canonical relabeled means indexed by
 `0,1,\ldots,n-1`. I did not write this code, so am not sure what this is
 used for.

 Internally, now the poset code still stores `P._hasse_diagram` as a Hasse
 diagram on `0,1,\ldots,n-1` to make it light-weight and only compare
 integers internally. The elements are taken from the Hasse diagram, when
 `elements` is not specified. So passing a Hasse diagram that is on
 `0,1,\ldots,n-1` will automatically make the element set equal to this.

 Anne

 PS: I fixed the doc failures that John reported except the ones in
 `src/sage/modular/modform_hecketriangle`
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=8dddb16ee9bce94fab03989228cf83dd567f8ac0
 8dddb16]||{{{changes to canonical_label}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/14019#comment:63>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

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

Reply via email to