Opened 5 years ago
Closed 5 years ago
#24865 closed defect (fixed)
Finite field elements should not have a _matrix_ method
Reported by:  Jeroen Demeyer  Owned by:  

Priority:  major  Milestone:  sage8.2 
Component:  linear algebra  Keywords:  
Cc:  Merged in:  
Authors:  Jeroen Demeyer  Reviewers:  Frédéric Chapoton 
Report Upstream:  N/A  Work issues:  
Branch:  bde1b85 (Commits, GitHub, GitLab)  Commit:  bde1b855b33d08186c2ae4d7d1f81728370c21c3 
Dependencies:  Stopgaps: 
Description (last modified by )
This is unexpected:
sage: k.<a> = GF(4) sage: matrix(a, nrows=2, ncols=2) [0 1] [1 1]
because one would typically expect a scalar matrix instead:
sage: R.<a> = EisensteinIntegers() sage: matrix(a, nrows=2, ncols=2) [a 0] [0 a]
This is because finite field elements implement _matrix_
and this takes priority in the matrix constructor.
Proposal: rename _matrix_
to matrix
to make it usable as ordinary method.
Change History (9)
comment:1 Changed 5 years ago by
Branch:  → u/jdemeyer/finite_field_elements_should_not_have_a__matrix__method 

comment:2 Changed 5 years ago by
Commit:  → a4ad0559b125cec96e28722046e8bd57d9771ef4 

Status:  new → needs_review 
comment:3 Changed 5 years ago by
Description:  modified (diff) 

comment:4 followup: 5 Changed 5 years ago by
Reviewers:  → Frédéric Chapoton 

the doc of the matrix method may need to start by r"""
comment:5 Changed 5 years ago by
Replying to chapoton:
the doc of the matrix method may need to start by
r"""
Is there are particular reason? The patchbot is green...
comment:6 Changed 5 years ago by
Status:  needs_review → positive_review 

I have seen a \dots in the doc. But ok, let it be..
comment:7 Changed 5 years ago by
Commit:  a4ad0559b125cec96e28722046e8bd57d9771ef4 → bde1b855b33d08186c2ae4d7d1f81728370c21c3 

Status:  positive_review → needs_review 
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. This was a forced push. New commits:
bde1b85  Finite field elements should not have a _matrix_ method

comment:8 Changed 5 years ago by
Status:  needs_review → positive_review 

I changed it anyway. I guess it doesn't hurt.
comment:9 Changed 5 years ago by
Branch:  u/jdemeyer/finite_field_elements_should_not_have_a__matrix__method → bde1b855b33d08186c2ae4d7d1f81728370c21c3 

Resolution:  → fixed 
Status:  positive_review → closed 
New commits:
Finite field elements should not have a _matrix_ method