The index calculus algorithm can be used for computing discrete logarithms. The basic idea is that you search for a set of linear independent vectors. When you solve the corresponding matrix, you find the solutions for the discrete log problem of all the prime factors in your factor base. These can be used to solve the original discrete log problem.
I decided to make an implementation of it just for fun. However, when solving the corresponding matrix, I sometimes run into solutions for the factors that are incorrect. Let me show an example. Assume we have generator $g = 5$ and $h=543$ with $p = 2003$. Using the factor base $\mathcal{F} = \{2,3,5,7,11,13\}$, we want to find a solution for $$g^x \equiv h \mod(p)$$
Lets say we find the following relations which are $\mathcal{F}$-smooth: \begin{align*} 5^{790} &= 3^2 \cdot 11^2 \\ 5^{729} &= 2^5 \cdot 5 \cdot 11 \\ 5^{1162} &= 3^3 \cdot 5 \cdot 7 \\ 5^{919} &= 2^2 \cdot 5 \cdot 7^2 \\ 5^{150} &= 2 \cdot 3^2 \cdot 7 \\ 5^{953} &= 2 \cdot 5 \cdot 7 \cdot 13 \end{align*}
This leaves us with the following matrix: $M = $ \begin{pmatrix} 0 & 2 & 0 & 0 & 2 & 0 & 790\\ 5 & 0 & 1 & 0 & 1 & 0 & 729\\ 0 & 3 & 1 & 1 & 0 & 0 & 1162\\ 2 & 0 & 1 & 2 & 0 & 0 & 919\\ 1 & 2 & 0 & 1 & 0 & 0 & 150\\ 1 & 0 & 1 & 1 & 0 & 1 & 953 \end{pmatrix}
Using Gauss-Jordan Eliminiation, we get the following solutions: \begin{align} \log_5(2) &= -93 \equiv 1909 \mod(2002)\\ \log_5(3) &= 60 \\ \log_5(5) &= 859 \\ \log_5(7) &= 123 \\ \log_5(11) &= 335 \\ \log_5(13) &= 64 \end{align} We can check the only the $\log_5(7)$ is correct. My question is: how is it possible that the solutions for the factors in the factor base are (mostly) incorrect, although the relations we found are linear independent?