#6115: make symbolic matrices use pynac symbolics
----------------------------+-----------------------------------------------
Reporter: jason | Owner: was
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.0.1
Component: linear algebra | Keywords:
----------------------------+-----------------------------------------------
Currently, it looks like the symbolic matrix code in
{{{matrix/matrix_symbolic_dense.pyx}}} goes to maxima for everything.
This makes things **slow** and, at least in 3.4.2, it was easy to crash
Maxima by calculating a 6x6 determinant, for example.
Here is an example of how the current general algorithms in Sage can speed
things up (even before making the matrix be stored in Sage instead of
Maxima).
{{{
sage: var('x00,x01,x10,x11')
sage: a=matrix(2,[[x00,x01],[x10,x11]])
sage: %timeit a.det()
10 loops, best of 3: 218 ms per loop
}}}
I went into matrix/matrix_symbolic_dense.pyx and just commented out the
determinant routine. This way, it uses the generic determinant routine
for matrices. Note that we still have to get values from maxima for this,
but the multiplication and things are done in pynac.
Generic determinant algorithm:
{{{
sage: var('x00,x01,x10,x11')
(x00, x01, x10, x11)
sage: a=matrix(2,[[x00,x01],[x10,x11]])
sage: %timeit a.det()
100000 loops, best of 3: 5.85 µs per loop
sage: %timeit a.det()
100000 loops, best of 3: 6.15 µs per loop
}}}
So, the generic Sage code with pynac took about 3% of the time it took to
call maxima and ask it for the determinant.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6115>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---