Question about solving polynomial system over RR in sage

Skip to first unread message

Juan Grados

Aug 22, 2021, 9:49:28 AMAug 22
I would like to solve a polynomial system over RR in sage. See the toy example below

    >>> var_names = ['xor_0_7_x0', 'xor_0_7_x12', 'xor_0_7_y0']
    >>> nvars = 3
    >>> R=PolynomialRing(RealField(53), nvars, var_names, order="degneglex")
    >>> a=R.gens()[0]+R.gens()[1]+R.gens()[2]
    >>> b=R.gens()[0]-R.gens()[1]*R.gens()[2]
    >>> s=[a,b]
    >>> s=Sequence([a,b])
    >>> s.solve()

I just defined two polynomial from $R$. But when I tried to solve this system I get AttributeError: 'Sequence_generic' object has no attribute 'solve'
D.Sc. Juan del Carmen Grados Vásquez
Laboratório Nacional de Computação Científica 
Tel: +55 21 97633 3228

Emmanuel Charpentier

Aug 23, 2021, 10:59:44 AMAug 23
to sage-support

solve is a function working on symbolic expressions. Polynomials on RR as defined in your example, are not symbolic expressions. The set of operations applicable to them is different. And, BTW, symbolic expressions do have a method solve (not to be confused with the function solve), but not lists nor sequences…

Your question will find (a lot of) answer elements in chapter 9 of this excellent book, which I recommend to anyone aiming at non-trivial Sagemath use…


Reply all
Reply to author
0 new messages