#10733: Faster echelon form code for matrix_modn_sparse
--------------------------------+-------------------------------------------
Reporter: tornaria | Owner: was
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.7
Component: linear algebra | Keywords:
Author: Gonzalo Tornaria | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
Comment(by was):
REVIEW:
Annoyingly, there are issues when the modulus is 2, e.g.:
{{{
sage -t sage/coding/linear_code.py
**********************************************************************
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/devel
/sage-main/sage/coding/linear_code.py", line 1523:
sage: C.is_permutation_automorphism(g)
Exception raised:
Traceback (most recent call last):
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_31[10]>", line 1, in <module>
C.is_permutation_automorphism(g)###line 1523:
sage: C.is_permutation_automorphism(g)
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/local/lib/python
/site-packages/sage/coding/linear_code.py", line 1532, in
is_permutation_automorphism
HGm = H*g.matrix()
File "element.pyx", line 2282, in
sage.structure.element.Matrix.__mul__ (sage/structure/element.c:15874)
File "coerce.pyx", line 709, in
sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:6368)
File "action.pyx", line 144, in
sage.matrix.action.MatrixMatrixAction._call_ (sage/matrix/action.c:2818)
File "matrix_modn_sparse.pyx", line 683, in
sage.matrix.matrix_modn_sparse.Matrix_modn_sparse.dense_matrix
(sage/matrix/matrix_modn_sparse.c:11767)
TypeError: Cannot convert
sage.matrix.matrix_mod2_dense.Matrix_mod2_dense to
sage.matrix.matrix_modn_dense.Matrix_modn_dense
**********************************************************************
}}}
and
{{{
sage -t sage/homology/cell_complex.py
**********************************************************************
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/devel
/sage-main/sage/homology/cell_complex.py", line 456:
sage: P.homology(base_ring=GF(2))
Exception raised:
Traceback (most recent call last):
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/local/bin/ncadoctest.py",
line 1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/local/bin/sagedoctest.py",
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/local/bin/ncadoctest.py",
line 1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_15[4]>", line 1, in <module>
P.homology(base_ring=GF(Integer(2)))###line 456:
sage: P.homology(base_ring=GF(2))
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/local/lib/python
/site-packages/sage/homology/cell_complex.py", line 552, in homology
dimensions=dims, **kwds)
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/local/lib/python
/site-packages/sage/homology/delta_complex.py", line 662, in chain_complex
return ChainComplex(data=differentials, degree=-1, **kwds)
File
"/tmp/wstein/sage-4.7.alpha3-sage.math.washington.edu-x86_64-Linux/local/lib/python
/site-packages/sage/homology/chain_complex.py", line 462, in __init__
raise TypeError, "The differentials d_{%s} and d_{%s} are not
compatible: their product is not defined." % (n, n+degree)
TypeError: The differentials d_{1} and d_{0} are not compatible: their
product is not defined.
}}}
The result of running the whole test suite:
{{{
}}}
Here is another style comment. In Cython now doing
{{{
for c from 0 <= c < self._ncols:
}}}
is *identical* to doing:
{{{
for c in range(self._ncols):
}}}
Otherwise, everything looks great, and this is going to be *extremeley*
useful for my research!!
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10733#comment:8>
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 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.