You can explore the inbuilt function `solve_mod`...

You will have to input your system in the form of equations and not in
form of a matrix.
The function also accepts system of non-linear congruences!

VInay





On 4 August 2016 at 22:50, Juan Grados <[email protected]> wrote:
> I need a operator, or function, to found all solutions of a linear system
> over the finite field F_2. For example in the next code I have generated a
> random linear system of the form Ax=b, where A=[[1,1,1], [0,1,1]] and b =
> [0,1], but when I used the operator \ I have only one solution [1,1,0], but
> there is another solution that is [1,0,1].
>
>     def generateRandVector(kk,r):
>         v = vector(kk,r)
>         for i in range(r):
>             v[i] = kk.random_element()
>         return v
>     q = 2
>     pot = 1
>     kk = GF(q**pot,"t")
>     r=2
>     n=3
>     w=2
>     M2 = random_matrix(kk, r, n)
>     while(M2.rank()!=w):
>         #print M2.rank()
>         M2 = random_matrix(kk, r, n)
>     print M2.str()
>     v = generateRandVector(kk,r)
>     print v
>     print M2\v
>
>
> --
> ---------------------------------------------------------------------
> MSc. Juan del Carmen Grados Vásquez
> Laboratório Nacional de Computação Científica
> Tel: +55 21 97633 3228
> (http://www.lncc.br/)
> http://juaninf.blogspot.com
> ---------------------------------------------------------------------
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to