#9888: matrix multiplication over integer mod ring is slow
-------------------------------+-------------------
Reporter: dmharvey | Owner: tbd
Type: defect | Status: new
Priority: major | Milestone:
Component: performance | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-------------------------------+-------------------
Comment (by kedlaya):
I just tried the timings again:
{{{
sage: sage: M1 = Matrix([[randrange(3^20) for i in range(100)] for j in
range(100)])
sage: sage: M2 = Matrix([[randrange(3^20) for i in range(100)] for j in
range(100)])
sage: sage: timeit("M3 = M1 * M2")
125 loops, best of 3: 5.62 ms per loop
sage: sage: R = Integers(3^20)
sage: sage: M1 = Matrix([[R.random_element() for i in range(100)] for j in
range(100)])
sage: sage: M2 = Matrix([[R.random_element() for i in range(100)] for j in
range(100)])
sage: sage: timeit("M3 = M1 * M2")
5 loops, best of 3: 530 ms per loop
}}}
so now the discrepancy is up to a factor of 100!
My recollection is that lifting the multiplication up to Z is in fact the
correct algorithmic approach. In practice, this hands the problem off to
FLINT, where (in this size range) the multiplication is done multimodular.
--
Ticket URL: <http://trac.sagemath.org/ticket/9888#comment:2>
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.