I am trying to implement index calculus algorithm for discrete logarithm problem. In general the algorithm works like this : Input: Zp, order d, generator a, b element of Z Output: log_ab
1- find a set Factor_Base = {p1,...,ph}
2- find random number k and compute a^k
3- factorize a^k= f1^x*f2^y*...*fn^o
4- if factors of a^k belong in Factor_Base then find a relation k = x*logaf1 + y*logaf2 + ...+ o*logafn
5- repeat steps 2 - 4 until we have enough relations
6 - Solve the linear equation system for the unknown logs
7 - compute y= logab ( Involving more steps )
My problem is in step 6 . How to solve the system of linear equations?
In specific I use python with numpy. Is there an easy way to solve this system?