Opened 3 years ago
Closed 3 years ago
#28694 closed enhancement (fixed)
rich comparison for matrices
Reported by:  chapoton  Owned by:  

Priority:  major  Milestone:  sage9.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: 
Description
from _cmp_
to _richcmp_
Change History (11)
comment:1 Changed 3 years ago by
Branch:  → u/chapoton/28694 

Commit:  → d72dcf79b3b992d87dfe5a953d13c64e018c2d6b 
Status:  new → needs_review 
comment:2 Changed 3 years ago by
Reviewers:  → Travis Scrimshaw 

Status:  needs_review → needs_work 
LGTM except you have a doctest failure in src/sage/categories/groups.py
. 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
Commit:  d72dcf79b3b992d87dfe5a953d13c64e018c2d6b → 95eacb01b65918cc27a2d75ae87fc8140010cbbd 

Branch pushed to git repo; I updated commit sha1. New commits:
95eacb0  trac 28694 fix doctest in Cayley table for SL(2,2)

comment:4 Changed 3 years ago by
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
Before
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] ]
After
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
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
Do you think one needs to investigate further, or one could proceed as it is ?
comment:8 Changed 3 years ago by
It is okay to proceed asis, it might just be something that we will again have to change later on.
comment:9 Changed 3 years ago by
Status:  needs_work → needs_review 

comment:11 Changed 3 years ago by
Branch:  u/chapoton/28694 → 95eacb01b65918cc27a2d75ae87fc8140010cbbd 

Resolution:  → fixed 
Status:  positive_review → closed 
New commits:
rich comparison for matrices