I confirm that the error occurs on CoCalc <https://cocalc.com/> (with the 
9.1 or Development kernel), so there certainly seems to be a bug somewhere, 
even though I do not get an error on my own computer (MacOS 10.15.5).

F.<x> = GF(2 ^ 64)
Matrix(F, 5, 5)
---------------------------------------------------------------------------
OverflowError                             Traceback (most recent call last)
<ipython-input-1-9d9a316b9fa1> in <module>()
      1 F = GF(Integer(2) ** Integer(64), names=('x',)); (x,) = 
F._first_ngens(1)
----> 2 Matrix(F, Integer(5), Integer(5))

/ext/sage/sage-dev/local/lib/python3.7/site-packages/sage/matrix/constructor.pyx
 
in sage.matrix.constructor.matrix 
(build/cythonized/sage/matrix/constructor.c:2479)()
    634     """
    635     immutable = kwds.pop('immutable', False)
--> 636     M = MatrixArgs(*args, **kwds).matrix()
    637     if immutable:
    638         M.set_immutable()
/ext/sage/sage-dev/local/lib/python3.7/site-packages/sage/matrix/args.pyx 
in sage.matrix.args.MatrixArgs.matrix 
(build/cythonized/sage/matrix/args.c:7846)()
    660                     break
    661         else:
--> 662             M = self.space(self, coerce=convert)
    663 
    664         # Also store the matrix to support multiple calls of 
matrix()
/ext/sage/sage-dev/local/lib/python3.7/site-packages/sage/matrix/matrix_space.py
 
in __call__(self, entries, coerce, copy)
    829             [t]
    830         """
--> 831         return self.element_class(self, entries, copy, coerce)
    832 
    833     def change_ring(self, R):
/ext/sage/sage-dev/local/lib/python3.7/site-packages/sage/matrix/matrix_gf2e_dense.pyx
 
in sage.matrix.matrix_gf2e_dense.Matrix_gf2e_dense.__cinit__ 
(build/cythonized/sage/matrix/matrix_gf2e_dense.c:3774)()
    171 
    172         cdef long i
--> 173         cdef m4ri_word poly = sum(((<m4ri_word>c) << i) for (i, c) 
in enumerate(f))
    174 
    175         if alloc and self._nrows and self._ncols:
OverflowError: Python int too large to convert to C unsigned long


On Thursday, August 13, 2020 at 3:59:11 PM UTC-6 maxime...@inria.fr wrote:

> On 13/8/20 8:02 pm, Zihan Zheng wrote:
>
> Hi developers, 
>
> I think I found a bug of SageMath 9.1
>
> *F.<x> = GF(2 ^ 64)*
> *Matrix(F, 5, 5)*
>
> This piece of code runs without error on SageMath 8.9 and 9.0, but throws 
> error on 9.1
>
> (reproducible on cocalc.com)
>
> *OverflowError: Python int too large to convert to C unsigned long*
>
> Best,
> Zihan
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/366187ef-d6bf-4dbf-a55a-9db2a243d9cen%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/sage-devel/366187ef-d6bf-4dbf-a55a-9db2a243d9cen%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> Hi, 
>
> it works very well for me, even for (much) larger fields.
>
> sage: F.<x> = GF(2^16384)
> sage: Matrix(F, 5, 5)
> [0 0 0 0 0]
> [0 0 0 0 0]
> [0 0 0 0 0]
> [0 0 0 0 0]
> [0 0 0 0 0]
>
> Can you be more specific ? What version of python are you using ? And on 
> which OS ?
>
> Best,
>
> -- 
> Maxime
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/3e84ee0a-b997-4d9c-8c63-c4c51b3fbcdcn%40googlegroups.com.

Reply via email to