next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
SOS :: coefficients field

coefficients field -- the role of the coefficients field

The SOS package works with two coefficient rings: the rational numbers and the real numbers . Almost all operations in this package rely on a numerical SDP Solver. When calling such a solver, even if the input was a polynomial with rational coefficients, the result is numerical. The package makes some effort to round and return a rational result, but this can fail, independent of whether a rational SOS decomposition exists or not. In this case of failure, a real result is returned. The following example of Scheiderer is SOS, but does not admit any rational SOS decomposition. Consequently the package must return a real solution:

i1 : f = library("Scheiderer", QQ[x,y,z])

      4      3    4     2          2      2 2      3      3    4
o1 = x  + x*y  + y  - 3x y*z - 4x*y z + 2x z  + x*z  + y*z  + z

o1 : QQ[x, y, z]
i2 : sol = solveSOS (f);
Executing CSDP
Input file: /tmp/M2-2217946-0/4.dat-s
Output file: /tmp/M2-2217946-0/5
Status: SDP solved, primal-dual feasible
Start rational rounding
rounding failed, returning real solution
i3 : sosPoly sol

o3 = coeffs:
     {3.30451e-9, 5.71262e-9, .612612, .889189, 1.85689, 3.99241}
     gens:
              2                         2                                     2          2                          2                                       2            2                        2                                     2            2                       2                                     2          2                        2                                     2            2                        2                                     2
     {.347571x  - .0338167x*y + .768917y  + .336255x*z - .203872y*z + .363573z , .318116x  + .679504x*y - .00674294y  + .148906x*z + .644087y*z - .00320071z , - .489503x  + .515357x*y - .174266y  + .126103x*z - .330011y*z + .582766z , - .389147x  + .18471x*y + .191407y  + .590212x*z - .140294y*z - .640139z , .622038x  + .195424x*y - .441069y  + .199983x*z - .564971y*z - .145432z , .00407915x  - .446351x*y - .383632y  + .678612x*z + .309526y*z + .311866z }

o3 : SOSPoly

Once the rational world has been left, there is usually now way back. The package offers the function clean(RR,SOSPoly) which from an sosPoly removes all summands whose coefficient is smaller than a given tolerance. This can be useful sometimes and here is how to invoke it:

i4 : clean (0.001, sosPoly sol)

o4 = coeffs:
     {.612612, .889189, 1.85689, 3.99241}
     gens:
                2                        2                                     2            2                       2                                     2          2                        2                                     2            2                        2                                     2
     {- .489503x  + .515357x*y - .174266y  + .126103x*z - .330011y*z + .582766z , - .389147x  + .18471x*y + .191407y  + .590212x*z - .140294y*z - .640139z , .622038x  + .195424x*y - .441069y  + .199983x*z - .564971y*z - .145432z , .00407915x  - .446351x*y - .383632y  + .678612x*z + .309526y*z + .311866z }

o4 : SOSPoly

See also