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

faster GF(2^n) arithmetic for n >= 16 #416

Closed
malb opened this issue Aug 10, 2007 · 2 comments
Closed

faster GF(2^n) arithmetic for n >= 16 #416

malb opened this issue Aug 10, 2007 · 2 comments

Comments

@malb
Copy link
Member

malb commented Aug 10, 2007

Using a Python wrapper around Pari is too slow. ntl.GF2E on the other hand should be a lot faster.

Component: basic arithmetic

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

@malb
Copy link
Member Author

malb commented Oct 25, 2007

Attachment: gf2e.patch.gz

@malb
Copy link
Member Author

malb commented Oct 25, 2007

comment:3

The attached patch implements GF(2n) for n >= 16 using NTL's GF2E and also refactors FiniteField* such that writing GF(pn) for pn >= 216 should be easier. This patch also fixes an issue with ntl.GF2X and applies cleanly against 2.8.9. 'make test' passes.

Speed:

sage: F1 = FiniteField_givaro(2^15,'a')
sage: F2 = FiniteField_ntl_gf2e(2^15,'a')
sage: F3 = FiniteField_ext_pari(2^15,'a')

sage: F1.polynomial()
a^15 + a^5 + a^4 + a^2 + 1
sage: F2.polynomial()
a^15 + a^5 + a^4 + a^2 + 1
sage: F3.polynomial()
a^15 + a^5 + a^4 + a^2 + 1

sage: e1 = F1.random_element(); f1 = F1.random_element()
sage: e2 = F2.random_element(); f2 = F2.random_element()
sage: e3 = F3.random_element(); f3 = F3.random_element()

sage: %timeit e1*f1
1000000 loops, best of 3: 249 ns per loop
sage: %timeit e2*f2
1000000 loops, best of 3: 496 ns per loop
sage: %timeit e3*f3
10000 loops, best of 3: 36.9 µs per loop

sage: %timeit e1+f1
1000000 loops, best of 3: 255 ns per loop
sage: %timeit e2+f2
1000000 loops, best of 3: 391 ns per loop
sage: %timeit e3+f3
10000 loops, best of 3: 12.9 µs per loop

@malb malb added this to the sage-2.8.10 milestone Oct 25, 2007
@malb malb changed the title Faster GF(2^n) arithmetic for n >= 16 faster GF(2^n) arithmetic for n >= 16 Oct 25, 2007
@sagetrac-cwitty sagetrac-cwitty mannequin closed this as completed Oct 27, 2007
tobiasdiez pushed a commit to tobiasdiez/sage that referenced this issue Feb 22, 2024
* Add jupyter-client to quirks

* Fix :

Co-authored-by: Marcelo Duarte Trevisani <marcelotrevisani@users.noreply.github.com>

Co-authored-by: Marcelo Duarte Trevisani <marcelotrevisani@users.noreply.github.com>
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

1 participant