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 Pohlig-Hellman for generic discrete logarithm #5088
Comments
Attachment: trac-5088.patch.gz |
comment:1
My patch include the Pohlig-Hellman algorithm, and also modified the arguments of discrete_log, the "ord" argument wasn't used as announced but as a bound. I also wonder why we keep an old_discrete_log, but this another story... |
comment:2
Can you post some timings comparing your new code to sage before your new code...? |
comment:3
With a smooth order:
BEFORE:
AFTER:
|
comment:4
NICE! |
comment:5
and a not so smooth example
BEFORE:
AFTER:
|
comment:6
I am very pleased that someone is as interested as I am in improving this! The original discrete log was wriiten by Stin & Joiner i think; I rewrote it to work more generaically using the generic bsgs code; I left the old code in through squaemishness about deleting what other people have written, that's all. Can I clarify what the changes you have made are doing? You are still using BSGS to find dlogs in a cyclic group, but instead of doing one big computation in the whole group, you factor the order and do it in each p-primary subgroup separately. If so, that sounds very sensible, but I think it would be a good idea to cache the group order's factorization so that the factorization is not repeated on subsequent calls. The only way I can see of doing that is to have the base element (which might be additive or multiplicative) cache both its own order and the factorization of that order. The next improvement we need is to replace the BSGS by something which takes less memory, but that's not a reason for delaying this patch. I have not reviewed this yet, only looked at the patch code, but will do. |
comment:7
John: William already gave this a positive review. Merged in Sage 3.3.alpha2 Cheers, Michael |
comment:8
Replying to @sagetrac-mabshoff:
OK, I saw that after saying I would do it. I did have two doctest failures but they seem to be unrelated since they also fail in my unpatched main branch, and are probably due to the messed up upgrade.
|
Changed keywords from none to discrete logarithm, speedup |
Author: Yann Laigle-Chapuy |
comment:9
This ticket is mentioned in this video (from 00:17:00 to 00:22:27): |
Reviewer: William Stein, John Cremona |
Algorithm summary:
http://en.wikipedia.org/wiki/Pohlig-Hellman_algorithm
Component: basic arithmetic
Keywords: discrete logarithm, speedup
Author: Yann Laigle-Chapuy
Reviewer: William Stein, John Cremona
Issue created by migration from https://trac.sagemath.org/ticket/5088
The text was updated successfully, but these errors were encountered: