Opened 3 years ago

Closed 3 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 3 years ago by chapoton

Branch: u/chapoton/28694
Commit: d72dcf79b3b992d87dfe5a953d13c64e018c2d6b
Status: newneeds_review

New commits:

d72dcf7rich comparison for matrices

comment:2 Changed 3 years ago by tscrim

Reviewers: Travis Scrimshaw
Status: needs_reviewneeds_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 3 years ago by git

Commit: d72dcf79b3b992d87dfe5a953d13c64e018c2d6b95eacb01b65918cc27a2d75ae87fc8140010cbbd

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 3 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 3 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 3 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 3 years ago by chapoton

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

comment:8 Changed 3 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 3 years ago by chapoton

Status: needs_workneeds_review

comment:10 Changed 3 years ago by tscrim

Status: needs_reviewpositive_review

Let it be so.

comment:11 Changed 3 years ago by vbraun

Branch: u/chapoton/2869495eacb01b65918cc27a2d75ae87fc8140010cbbd
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.