Your example has several problems :

1) You don’t define your polynomial indeterminates ; you should 
Rx.inject_variables().

2) The syntax you use to substitute values in f is questionable…

3) f(v) is a polynomial in x0..x9 over GF(7), *not* a symbolic expression. 
Therefore f(v)==1 is *not* a symbolic equation ; it just tests if f(v) is 
equal to 1, which isFalse`. Hence the “error” you get.

4) solve_modis a function working on *symbolic equations systems*. Passing 
a (list of) polynomial(s) as its first argument will fail. If you want to 
use this function, us it on *symbolic equation systems*.

5) “Solving” polynomial systems use other methods. Perusing the 
documentation and the source the latter points to is *highly* recommended.

HTH,
​
Le mardi 10 mai 2022 à 09:40:48 UTC+2, Ha a écrit :

> Hi,
> I need to solve a system of linear equations [over finite fields] which 
> are obtained from system of polynomials by l substitution   of some 
> variables.   
> For example:   If we start with F[x1,x2,x3] = x1*x2+x3+1 and let x1 = 1 
> then we get
> L[x2,x3] = F(1,x2,x3) = x2+x3+1 --> a linear equation. 
> Need to solve L == constant over a finite field Fp.
>
> I tried the following method. But no luck.
>
> ##--------------------------------------------------------
> n=10
> F = GF(7)
> Rx=PolynomialRing(F,n,'x')
> X=Rx.gens()
> f = x2+ x1 * x5 - 1
> print(f)
> v=list(X)
> v[1]=1
> v[2]=5
> print(f(v))
> eqns = [f(v) == 1]
> sol = solve_mod(eqns, 7)
> print(sol)
> ##------------------------------------------------------
> Getting error:
>
>    - AttributeError: 'bool' object has no attribute 'lhs' 
>
>

-- 
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 sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/eaf5db10-0e69-4fc9-8938-8475e1bebeb2n%40googlegroups.com.

Reply via email to