#6904: change ring broken over QQ and GF(2)
------------------------------+---------------------------------------------
Reporter: was | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-4.3.3
Component: linear algebra | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------------+---------------------------------------------
Changes (by was):
* upstream: => N/A
Comment:
Here's another bug that bit me while doing research today and might be
caused by the same problem:
{{{
sage: a = matrix(QQ,22,[0, 0, 0, -1, 1, -1, -1, 0, 0, 0, 0, 0, -1, 0, 0,
0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 1, 0, 0, 0, -1, 1, 0, -1, 0, 1, 0, 0, -1, 0, -2, 1, -1, -1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0,
0, -1, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, -1, 0, 0,
-1, 1, 0, 1, -1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, -1, 0, 0, 0, -1, 0,
0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0,
0, 1, -1, 0, 1, 0, -1, 0, 1, 1, 0, 2, 0, 0, 1, -1, 1, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 1, -1, 1, 0, 0, 1, 0, 0, 0, 0, 1, -2, 1, 1, 0,
0, 0, 0, 0, 1, -1, -1, 0, -1, 0, -1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1,
0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, -1, 1, 0, 0, 0, 0,
0, 0, 1, -1, -1, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 1, 0,
-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 1, -1, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0, 1, 0, 0,
0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0,
0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 1, -1, 0, -1, 1, 0, -1, 0, 0, 0, 0, 0,
0, -2, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, -1, 1, 0, -1, -1, 1, 0, 0, 0, 0,
-2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1, 0, -1, 0, 0, 0, 0, 0, -1,
0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0,
0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0,
1]).change_ring(GF(2))
sage: a^21
Traceback (click to the left of this block for traceback)
...
TypeError: Cannot convert
sage.matrix.matrix_modn_dense.Matrix_modn_dense to
sage.matrix.matrix_mod2_dense.Matrix_mod2_dense
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_79.py", line 9, in <module>
open("___code___.py","w").write("# -*- coding: utf-8 -*-\n" +
_support_.preparse_worksheet_cell(base64.b64decode("diA9IFsoYV5pKS5saXN0KCkgZm9yIGkgaW4gWzEuLjIxXV0="),globals())+"\n");
execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpVclvdc/___code___.py", line 3, in <module>
v = [(a**i).list() for i in (ellipsis_range(_sage_const_1
,Ellipsis,_sage_const_21 ))]
File "", line 1, in <module>
File "matrix0.pyx", line 3893, in sage.matrix.matrix0.Matrix.__pow__
(sage/matrix/matrix0.c:21527)
File "element.pyx", line 1409, in
sage.structure.element.RingElement.__pow__
(sage/structure/element.c:11201)
File "element.pyx", line 3264, in sage.structure.element.generic_power_c
(sage/structure/element.c:23714)
File "element.pyx", line 2134, in sage.structure.element.Matrix.__mul__
(sage/structure/element.c:14292)
File "matrix_mod2_dense.pyx", line 645, in
sage.matrix.matrix_mod2_dense.Matrix_mod2_dense._matrix_times_matrix_
(sage/matrix/matrix_mod2_dense.c:5144)
TypeError: Cannot convert sage.matrix.matrix_modn_dense.Matrix_modn_dense
to sage.matrix.matrix_mod2_dense.Matrix_mod2_dense
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6904#comment:1>
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.