Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finite field elements should not have a _matrix_ method #24865

Closed
jdemeyer opened this issue Feb 28, 2018 · 12 comments
Closed

Finite field elements should not have a _matrix_ method #24865

jdemeyer opened this issue Feb 28, 2018 · 12 comments

Comments

@jdemeyer
Copy link

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.

Component: linear algebra

Author: Jeroen Demeyer

Branch/Commit: bde1b85

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/24865

@jdemeyer jdemeyer added this to the sage-8.2 milestone Feb 28, 2018
@jdemeyer
Copy link
Author

@jdemeyer
Copy link
Author

Commit: a4ad055

@jdemeyer
Copy link
Author

New commits:

a4ad055Finite field elements should not have a `_matrix_` method

@jdemeyer

This comment has been minimized.

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton
Copy link
Contributor

comment:4

the doc of the matrix method may need to start by r"""

@jdemeyer
Copy link
Author

comment:5

Replying to @fchapoton:

the doc of the matrix method may need to start by r"""

Is there are particular reason? The patchbot is green...

@fchapoton
Copy link
Contributor

comment:6

I have seen a \dots in the doc. But ok, let it be..

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2018

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. This was a forced push. New commits:

bde1b85Finite field elements should not have a `_matrix_` method

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2018

Changed commit from a4ad055 to bde1b85

@jdemeyer
Copy link
Author

comment:8

I changed it anyway. I guess it doesn't hurt.

@vbraun
Copy link
Member

vbraun commented Mar 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants