Me struggling with the General Number Field Sieve : round 2 ! As usual : english is not my first langage so 'sorry for bad english'.
So : I'm trying to implement this algorithm and to do it I'm heavily relying on sympy.
But I'm also basing parts of my work on the code of Pr. William Stein (https://wstein.org/misc/aly-lll/gnfs.html), written in python/sympy/sage in 2007.
In it, there is this peice of code (which, of course, happens to be one of the most important) :
def find_kernel_vectors(M):
return M.kernel().basis_matrix().rows() [1]
It will be applied the matrix :
M = Matrix(GF(2), len(sel), ev) [2]
where sel
is a list and ev
the coefficients of the matrix, which are each either 0 or 1.
However, when I copy-paste it, adding from sympy import Matrix, GF
, I run in quite a lot of troubles.
Upon execution of [2], I get the error message GF(2) is not an integer
I looked up how to use matrices in sympy and from what I gathered, only the list of coefficients in an acceptable input.
So I decided to define M as follows in order to be able to test [1] :
M = Matrix(ev)
And upon execution of 1, I get the error message MutableDenseMatrix has no attribute kernel
The thing is, it's not the first time that things like this happen, because Pr. Stein was coding in a 2007 version of python/sympy/sage.
I don't really think that the issue with [2] is an actual issue because, as I said, the coefficients of my matrix are already 0 or 1 (i.e. elements of GF(2)), however I'm not sure about it. But I'm sure about the fact that [1] is a big issue that I don't have any idea to solve.
I beleive it all boils down to the translation between 2007 sage/sympy/python to modern day python, so if someone knows how to do it, it would save my code.
Thanks a lot !