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

use NTL's MinPolyMod() #34906

Closed
yyyyx4 opened this issue Jan 11, 2023 · 17 comments
Closed

use NTL's MinPolyMod() #34906

yyyyx4 opened this issue Jan 11, 2023 · 17 comments

Comments

@yyyyx4
Copy link
Member

yyyyx4 commented Jan 11, 2023

NTL implements Shoup's algorithm https://shoup.net/papers/mpol.pdf for minimal polynomials of algebraic elements over finite fields.

This patch adds call paths from PolynomialQuotientRingElement.minpoly() and RingExtensionWithBasisElement.minpoly() to NTL's MinPolyMod() function, yielding massive speedups in some important special cases.

Example code:

sage: K.<u> = GF((23,5))
....: L.<v> = K.extension(42)
....: LK = L.over(K)
....: _ = LK(L.random_element()).minpoly()  # warm up
....: %timeit LK(L.random_element()).minpoly()

Sage 9.7:

2.47 s ± 25.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

This branch:

49.6 ms ± 546 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

Component: algebra

Author: Lorenz Panny

Branch/Commit: d230ff8

Reviewer: Frédéric Chapoton

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

@yyyyx4 yyyyx4 added this to the sage-9.8 milestone Jan 11, 2023
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 11, 2023

Changed commit from 1a1e4a4 to 33171a8

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 11, 2023

Branch pushed to git repo; I updated commit sha1. New commits:

f29f31efix reference
33171a8avoid detour through multivariate polynomial ring

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 11, 2023

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

23f2c2dexpose NTL's MinPolyMod() and use it
0e9a4e2avoid detour through multivariate polynomial ring

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 11, 2023

Changed commit from 33171a8 to 0e9a4e2

@yyyyx4

This comment has been minimized.

@fchapoton
Copy link
Contributor

comment:4

you could add the doi to the reference

https://doi.org/10.1145/309831.309859

so :doi:`10.1145/309831.309859`

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 11, 2023

Branch pushed to git repo; I updated commit sha1. New commits:

8eba4ebadd DOI to reference

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 11, 2023

Changed commit from 0e9a4e2 to 8eba4eb

@yyyyx4
Copy link
Member Author

yyyyx4 commented Jan 11, 2023

comment:6

Sure, why not. Done.

@fchapoton
Copy link
Contributor

comment:7

one failing doctest, see patchbot, that seems to be related to the changes done here

@yyyyx4
Copy link
Member Author

yyyyx4 commented Jan 12, 2023

comment:8

Sorry, that's a new test I added (and promptly got wrong). Fixing shortly.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 12, 2023

Branch pushed to git repo; I updated commit sha1. New commits:

d230ff8fix doctest

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 12, 2023

Changed commit from 8eba4eb to d230ff8

@fchapoton
Copy link
Contributor

comment:10

ok, I will give a positive review, unless you want to ask some more qualified expert in the domain

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@yyyyx4
Copy link
Member Author

yyyyx4 commented Jan 13, 2023

comment:11

Thank you!

@vbraun
Copy link
Member

vbraun commented Jan 21, 2023

Changed branch from public/use_NTL_MinPolyMod to d230ff8

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