Opened 2 years ago

Closed 2 years ago

#28694 closed enhancement (fixed)

rich comparison for matrices

Reported by: chapoton Owned by:
Priority: major Milestone: sage-9.0
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Frédéric Chapoton Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 95eacb0 (Commits, GitHub, GitLab) Commit: 95eacb01b65918cc27a2d75ae87fc8140010cbbd
Dependencies: Stopgaps:

Status badges


from _cmp_ to _richcmp_

Change History (11)

comment:1 Changed 2 years ago by chapoton

  • Branch set to u/chapoton/28694
  • Commit set to d72dcf79b3b992d87dfe5a953d13c64e018c2d6b
  • Status changed from new to needs_review

New commits:

d72dcf7rich comparison for matrices

comment:2 Changed 2 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to needs_work

LGTM except you have a doctest failure in src/sage/categories/ So it seems like some order changed in a subtle way. It probably just is a doctest that we need to update.

comment:3 Changed 2 years ago by git

  • Commit changed from d72dcf79b3b992d87dfe5a953d13c64e018c2d6b to 95eacb01b65918cc27a2d75ae87fc8140010cbbd

Branch pushed to git repo; I updated commit sha1. New commits:

95eacb0trac 28694 fix doctest in Cayley table for SL(2,2)

comment:4 Changed 2 years ago by chapoton

I have replaced the doctest. This change comes from a change of sorting for matrices in SL(2,F2). I think. May need to be checked ?

comment:5 Changed 2 years ago by chapoton


sage: sorted(SL(2,2))
[0 1]  [0 1]  [1 0]  [1 0]  [1 1]  [1 1]
[1 0], [1 1], [0 1], [1 1], [0 1], [1 0]


sage: sorted(SL(2,2))
[1 0]  [1 0]  [0 1]  [0 1]  [1 1]  [1 1]
[0 1], [1 1], [1 0], [1 1], [1 0], [0 1]

So indeed there is a change here.

comment:6 Changed 2 years ago by tscrim

I actually like the sorting after a little better since the identity comes first and it follows the iteration order. I just don't understand why the iteration order did change. It really looks like equivalent code and tests. Unfortunately, I don't think it matches the docstring. Ah, perhaps there is a _cmp_ in the group code that gets used and gets used instead of the _richcmp_ since these are matrix group elements?

comment:7 Changed 2 years ago by chapoton

Do you think one needs to investigate further, or one could proceed as it is ?

comment:8 Changed 2 years ago by tscrim

It is okay to proceed as-is, it might just be something that we will again have to change later on.

comment:9 Changed 2 years ago by chapoton

  • Status changed from needs_work to needs_review

comment:10 Changed 2 years ago by tscrim

  • Status changed from needs_review to positive_review

Let it be so.

comment:11 Changed 2 years ago by vbraun

  • Branch changed from u/chapoton/28694 to 95eacb01b65918cc27a2d75ae87fc8140010cbbd
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.