Question about solving polynomial system over RR in sage

43 views
Skip to first unread message

Juan Grados

unread,
Aug 22, 2021, 9:49:28 AM8/22/21
to sage-s...@googlegroups.com
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
(http://www.lncc.br/)
http://juaninf.blogspot.com
---------------------------------------------------------------------

Emmanuel Charpentier

unread,
Aug 23, 2021, 10:59:44 AM8/23/21
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…

HTH,

Reply all
Reply to author
Forward
0 new messages