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

more user friendly finite field extensions #24526

Open
videlec opened this issue Jan 11, 2018 · 11 comments
Open

more user friendly finite field extensions #24526

videlec opened this issue Jan 11, 2018 · 11 comments

Comments

@videlec
Copy link
Contributor

videlec commented Jan 11, 2018

GF(p).extension(xxx) does not accept symbolic polynomials... and the error is cryptic

sage: Fp = GF(3)
sage: Fp2.<i> = Fp.extension(x^2+1)
Traceback (most recent call last):
...
UnboundLocalError: local variable 'E' referenced before assignment

We make it more user friendly by allowing the above in some duck typing fashion.

Component: number theory

Work Issues: merge conflict

Author: Vincent Delecroix

Branch/Commit: u/vdelecroix/24526 @ ba84546

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

@videlec videlec added this to the sage-8.2 milestone Jan 11, 2018
@videlec
Copy link
Contributor Author

videlec commented Jan 11, 2018

Author: Vincent Delecroix

@videlec

This comment has been minimized.

@videlec
Copy link
Contributor Author

videlec commented Jan 11, 2018

New commits:

ba8454624526: more user friendly finite field extension

@videlec
Copy link
Contributor Author

videlec commented Jan 11, 2018

Commit: ba84546

@videlec
Copy link
Contributor Author

videlec commented Jan 11, 2018

Branch: u/vdelecroix/24526

@mezzarobba
Copy link
Member

comment:3

It may be better to keep the branch dealing with tuples/lists for speed reasons... Perhaps it doesn't matter (I don't know how much it is used or what alternatives exist for constructing extensions without too much overhead), but your patch makes the call to extension() in GF(3).extension([1, 0, 1], 'a') 70% slower on my system.

@darijgr
Copy link
Contributor

darijgr commented Apr 1, 2018

comment:4

Should this ducktyping really all be happening under the hood without notifying the user? I think a more readable error message would be better, or at least a warning. We don't want people to use SR for polynomials in their code, do we?

Also, is this

+                else:
+                    modulus = modulus.change_ring(self)

necessary? The GF constructor already does modulus = R(modulus).monic(), where R = PolynomialRing(FiniteField(p), 'x').

@dkrenn
Copy link
Contributor

dkrenn commented Mar 28, 2019

comment:5

Does not apply anymore.

@dkrenn
Copy link
Contributor

dkrenn commented Mar 28, 2019

Work Issues: merge conflict

@slel
Copy link
Member

slel commented Mar 24, 2021

comment:6

Recent user report for the same problem:

@slel
Copy link
Member

slel commented Mar 24, 2021

comment:7

Please rebase, and I can review.

@mkoeppe mkoeppe removed this from the sage-8.2 milestone Dec 29, 2022
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

6 participants