#16116: Multiplication of dense cyclotomic matrices should be faster
-------------------------------------------------+-------------------------
Reporter: jipilab | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-7.0
Component: number fields | Resolution:
Keywords: cyclotomic field, matrix, | Merged in:
multiplication, benchmark, days57 | Reviewers:
Authors: | Work issues:
Report Upstream: N/A | Commit:
Branch: | Stopgaps:
Dependencies: |
-------------------------------------------------+-------------------------
Comment (by vdelecroix):
At least on sage-7.0.beta2, wrapping GAP matrices for the examples
mentioned in the ticket description will not bring any magic
{{{
sage: M = m._libgap_()
sage: %timeit A = M^2
1000 loops, best of 3: 181 µs per loop
sage: %timeit A = M^3
1000 loops, best of 3: 456 µs per loop
}}}
versus
{{{
sage: %timeit a = m^2
1000 loops, best of 3: 298 µs per loop
sage: %timeit a = m^3
1000 loops, best of 3: 690 µs per loop
}}}
We are below x2 speedup. But in this example the matrix is small and
coefficients relatively dense (~25 nonzero coefficients). Though, the gain
is significant with 10x10 dense matrices with small coefficients
{{{
sage: m1 = matrix(10, [E(randint(2,3)) for _ in range(100)])
sage: m2 = matrix(10, [E(randint(2,3)) for _ in range(100)])
sage: %timeit m1*m2
100 loops, best of 3: 4.51 ms per loop
sage: %timeit M1*M2
1000 loops, best of 3: 329 µs per loop
}}}
We might update the ticket description accordingly. Two concrete
propositions are:
- below a certain threshold (to be determined) use generic matrices for
cyclotomic fields
- wrap GAP matrices for UCF
What do you think?
--
Ticket URL: <http://trac.sagemath.org/ticket/16116#comment:18>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.