-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
add a fast gcd algorithm for univariate polynomials over absolute number fields #8558
Comments
Attachment: 13911.patch.gz |
comment:2
The pari algorithm is not fast enough. I have implemented a modular algorithm using ntl. The patch needs doctest and integration in sage (it is, right now, a separate function). It adds a new function modular_gcd To test it, apply the patch and from sage.rings.polynomial.polynomial_absolute_number_field import modular_gcd Some timmings: (800 Mhz i386 linux, 1Gb ram)
|
Changed keywords from gcd, pari to gcd, pari, ntl |
comment:3
Here there is a cleaner patch. The patch adds a new class of univariate polynomials whose ground field is an absolute number field. There is a new _gcd method for this class. It actually implements several approaches to the modular gcd algorithm: Langemyr-McCallum algorithm moreover, a call to pari method and the old Euclidean method. I think that there should be only one modular algorithm, but, as usual, there are cases in which any of them beats the others. So suggestions are welcome. It should probably be Encarnacion or the mixture of boths some timmings for harder problems:
This example with the old implementation or even pari is unfeasible. |
comment:4
|
Author: Luis Felipe Tabera Alonso |
comment:5
Added the method also for number fields of degree 1 using Flint in this special case |
comment:6
Attachment: 14371.patch.gz Now that #4000 has possitive review, I raise the priority of this one. Updated patch to work in 4.5.3 Now, it works also for relative number fields, passing to an absolute representation and performing there the computations. This is not optimal but it is usable. If the extension of the field is one, then the gcd of QQ[x] is used wich is faster. |
Attachment: trac-5885.patch.gz |
comment:7
I can confirm that the patch applies fine to 4.6.rc0 and all tests (including long) pass. There are some minor problems with the documentation (just punctuation) -- now I am studying the code, since this looks like very useful functionality! |
comment:8
Some clean in the documentation, reorder of the methods (methods after the classes of the file) and a couple of small bugs (honor the method option for relative fields and duplicated code for degree 1 extensions). Rename correctly the patch. Apply: trac-8558.patch Try new buildbot :) |
comment:9
Apply trac-8558.patch (I think such messages have to come after the patch is uploaded) |
avoid next_prime, better exceptions |
This comment has been minimized.
This comment has been minimized.
comment:10
Attachment: trac-8558.patch.gz |
comment:11
Hi, I don't know much about fast computation in polynomial rings over number fields. However, I'm wondering why you have this bias towards functions as opposed to methods? For example, |
comment:71
Ticket retargeted after milestone closed |
comment:72
Batch modifying tickets that will likely not be ready for 9.1, based on a review of the ticket title, branch/review status, and last modification date. |
comment:73
The branch has conflict with the sage develop branch since at least 9.1.beta7 according to the patchbot reports. |
comment:75
Setting new milestone based on a cursory review of ticket status, priority, and last modification date. |
comment:76
Setting a new milestone for this ticket based on a cursory review. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Question arised here,
http://groups.google.com/group/sage-devel/browse_thread/thread/0f5b029970e1a4e2/fcec7d0e35474fbd#fcec7d0e35474fbd
univariate gcd is performed using euclidean algorithm, which causes explosion of coefficients and is slow but for trivial examples.
For relative number fields, pass to an absolute representation. This may be slow. But for the cases where this is slow the current implementation may be unfeasible.
Depends on #14186
Depends on #15803
Depends on #15804
CC: @slel
Component: algebra
Keywords: gcd, pari, ntl, days94
Author: Luis Felipe Tabera Alonso
Branch/Commit: u/lftabera/ticket/8558 @
f16a49b
Reviewer: Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/8558
The text was updated successfully, but these errors were encountered: