Discussion:
[Axiom-math] Why does large power of Matrix Fraction Integer take so long in Axiom?
Bill Page
2007-12-03 22:48:23 UTC
Permalink
Axiom Developers;

Recent discussion in the Sage email list lead me to try this in FriCAS:

(1) -> )set message time on

(1) -> m:=matrix([[1/20,-1/10,1/20],[-1/10,-37/15,47/30],[1/20,67/30,-77/60]]);

Type: Matrix Fraction Integer
Time: 0 sec

(2) -> a:=m^20000;
Type: Matrix Fraction Integer
Time: 26.56 (EV) + 10.06 (GC) = 36.62 sec

----------

Reports on the Sage list putting the timing of this operation on other
CAS approximately as follows:


***@sage:~$ ./sage*/sage
----------------------------------------------------------------------
| SAGE Version 2.8, Release Date: 2007-08-12 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
Loading SAGE library. Current Mercurial branch is: test

sage: n = [[1/20, -1/10, 1/20], [-1/10, -37/15, 47/30],[1/20, 67/30,-77/60]]
sage: n = matrix ([[1/20, -1/10, 1/20], [-1/10, -37/15, 47/30],[1/20,
67/30,-77/60]])
sage: time a = n^20000
CPU times: user 0.20 s, sys: 0.01 s, total: 0.20 s
Wall time: 0.20

sage: m = maple('Matrix([[1/20,-1/10,1/20],[-1/10,-37/15,47/30],[1/20,67/30,-77/60]])')
sage: time a = m^20000
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 1.71

sage: M = mathematica('{{1/20, -1/10, 1/20}, {-1/10, -37/15,
47/30},{1/20, 67/30,-77/60}}')
sage: M.name()
'sage0'
sage: time a = mathematica('MatrixPower[sage0,20000]')
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 0.81

sage: N = axiom('matrix [[1/20, -1/10, 1/20], [-1/10, -37/15,
47/30],[1/20, 67/30,-77/60]]')
sage: time AA = N^20000
CPU times: user 29.45 s, sys: 0.38 s, total: 29.83 s
Wall time: 41.45

sage:

Regards,
Bill Page.

Loading...