Opened 2 years ago
Closed 2 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 2 years ago by
 Branch set to u/chapoton/28694
 Commit set to d72dcf79b3b992d87dfe5a953d13c64e018c2d6b
 Status changed from new to needs_review
comment:2 Changed 2 years ago by
 Reviewers set to Travis Scrimshaw
 Status changed from needs_review to 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 2 years ago by
 Commit changed from d72dcf79b3b992d87dfe5a953d13c64e018c2d6b to 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 2 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 2 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 2 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 2 years ago by
Do you think one needs to investigate further, or one could proceed as it is ?
comment:8 Changed 2 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 2 years ago by
 Status changed from needs_work to needs_review
comment:11 Changed 2 years ago by
 Branch changed from u/chapoton/28694 to 95eacb01b65918cc27a2d75ae87fc8140010cbbd
 Resolution set to fixed
 Status changed from positive_review to closed
New commits:
rich comparison for matrices