= The state of dense linear algebra in Sage = == Standard as of Version 5.0 == |||||||||| '''Finite Rings''' || ||<10%:>'''Base Ring''' ||<15%> '''Libraries''' ||<40%> '''Overview''' ||<25%> '''Known Limitations''' ||<10%:> '''Tickets''' || ||<:> $\mathbb{F}_2$ || [[http://m4ri.sagemath.org|M4RI]] || Sage has the fastest known implementation. Matrix-matrix multiplication is either as fast as Magma 2.17 or slightly faster. Gaussian elimination is faster than Magma 2.17. || Some functions might fall back to their generic implementations because M4RI either does not implement it or its implementation is not wrapped || || ||<:> $\mathbb{F}_{2^e}$ for $2 \leq e \leq 10$ || [[http://m4ri.sagemath.org|M4RIE]] || Sage has by far the fastest known implementation. || Many functions might fall back to their generic implementations because M4RIE either does not implement it or its implementation is not wrapped. Sage uses M4RIE's {{{mzed_t}}} but using {{{mzd_slice_t}}} would be slightly faster and save memory. || || ||<:> $\mathbb{Z}_p$, $2
$\mathbb{Z}_p$, $p<2^{22}$ || [[http://www.linalg.org|LinBox]] || Sage achieves decent performance on par with Magma 2.17. Performance differences likely come down to the BLAS used in both systems. || Some functions fall back to their generic implementations because LinBox either does not implement it, or the implementation was not wrapped yet. Also, {{{echelonize}}} uses way too much memory because it copies the matrix being worked on due to a function missing in LinBox.|| || |||||||||| '''Infinite Rings''' || ||<:> $\mathbb{Q}$ || [[http://www.linalg.org|LinBox]], [[http://pari.math.u-bordeaux.fr/|Pari]], [[http://www.cs.uwaterloo.ca/~astorjoh/iml.html|IML]] || Decent || || || ||<:> $\mathbb{Z}$ || [[http://www.linalg.org|LinBox]], [[http://pari.math.u-bordeaux.fr/|Pari]], [[http://www.cs.uwaterloo.ca/~astorjoh/iml.html|IML]], [[http://www.shoup.net/ntl/|NTL]], custom code || Decent. Fastest known Hermite Normal Form. || || || ||<:> $\mathbb{R}$, $\mathbb{C}$, 53-bit || `SciPy`, `NumPy`, `CVXOPT` || Rings `RDF` and `CDF` in Sage are floating point doubles. Performance comes from standard underlying libraries through Sage wrappers of `SciPy`/`NumPy` wrappers and interfaces. There there are no dedicated wrappers to `CVXOPT`, which sometimes offers better performance via [[http://www.cise.ufl.edu/research/sparse/SuiteSparse/|SuiteSparse]] || Not every desirable function has been implemented, but coverage is steadily increasing. || || ||<:> $\mathbb{R}$, $\mathbb{C}$, arbitrary precision || generic || Rings `RealField(prec)` and `ComplexField(prec)` in Sage support arbitrary precision, but default to 53-bit when used as `RR` and `CC`. Implementation often (always?) defaults to exact algorithms. || Using exact algorithms for approximate entries can provide misleading results if not interpreted properly. || || ||<:> $\mathbb{Q}(\zeta_n)$ || special code || Optimized multi-modular algorithms for arithmetic, charpoly, echelon form over cyclotomic fields. || || || |||||||||| '''Symbolic Rings''' || ||<:> $\mathbb{K}[x]$ || generic || || || || ||<:> $\mathbb{K}[x_0,\dots,x_{n-1}]$ || generic,[[http://singular.uni-kil.de|Singular]] || Generic matrices with some routines ({{{det}}}, {{{echelon_form}}}) calling libSingular. Poor performance, but apparently comparable to what other systems offer. || This implementation is not a serious attempt to implement matrices over $\mathbb{K}[x_0,\dots,x_{n-1}]$. || || ||<:> Symbols || generic,[[http://maxima.sourceforge.net/|Maxima]] || Generic matrices with some routines calling Maxima. Poor performance, but apparently comparable to what other systems offer. || || || == Provided by Optional Packages == ||<10%:>'''Base Ring''' ||<15%> '''Libraries''' ||<40%> '''Overview''' ||<25%> '''Known Limitations''' ||<10%:> '''Tickets''' || ||<:> $\mathbb{F}_{p^k}$, $p^k<255$ || [[http://www.math.rwth-aachen.de/~MTX/|MeatAxe]] fork || The fork adds Winograd-Strassen multiplication to the original `MeatAxe`. The computation of echelon forms is not asymptotically fast, but is faster than the generic implementation in Sage. || Patch needs review || [[http://trac.sagemath.org/sage_trac/ticket/12103|#12103]] || == In the Pipeline == ||<10%:>'''Base Ring''' ||<15%> '''Libraries''' ||<40%> '''Overview''' ||<25%> '''Known Limitations''' ||<10%:> '''Tickets''' || ||<:> $\mathbb{F}_{p^k}$ || Custom code || Matrices over extension fields are represented as tuples of matrices over the prime subfield. Then, using polynomial multiplication with matrix coefficients allows to multiply matrices. Other algorithms are implemented by reducing to matrix-matrix multiplication. || Only matrix-matrix multiplication is implemented so far. || [[http://trac.sagemath.org/sage_trac/ticket/12177|#12177]] || ||<:> $\mathbb{Z_p}$ for $p < 2^{64}$ || [[http://www.flintlib.org/|FLINT 2.3]] || Decent, not fully optimised. || || || ||<:> $\mathbb{Z}[x]$ || [[http://www.flintlib.org/|FLINT 2.3]] || Decent, not fully optimised. || || || ||<:> $\mathbb{Z_p}[x]$ for $p < 2^{64}$ || [[http://www.flintlib.org/|FLINT 2.3]] || Decent, not fully optimised. || || ||