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

sosInIdeal -- Sum of squares polynomial in ideal

Synopsis

Description

This methods finds sum-of-squares in ideals. It accepts two types of inputs that are useful for different purposes. The first invocation is to give a one row matrix with polynomial entries and a degree bound. The method then tries to find an SOS polynomial in the generated ideal. More precisely, given equations h1(x),...,hm(x), the method looks for polynomial multipliers hi(x) such that i li(x) hi(x) is SOS.

i1 : R = QQ[x,y,z];
i2 : h = matrix {{x^2-4*x+2*y^2, 2*z^2-y^2+2}};

             1       2
o2 : Matrix R  <--- R
i3 : (sol,mult) = sosInIdeal (h, 2);
Executing CSDP
Input file: /tmp/M2-21503-0/4.dat-s
Output file: /tmp/M2-21503-0/5
Status: SDP solved, primal-dual feasible
Zero solution obtained. Trying again.
Executing CSDP
Input file: /tmp/M2-21503-0/8.dat-s
Output file: /tmp/M2-21503-0/9
Status: SDP solved, primal infeasible
Start rational rounding
i4 : sosPoly sol

o4 = coeffs:
      11  11
     {--, --}
       2   2
     gens:
        1
     {- -x + 1, z}
        2

o4 : SOSPoly
i5 : h * mult == sosPoly sol

o5 = true

The second invocation is on a quotient ring, also with a degree bound. This tries to decompose the zero of the quotient ring as a sum-of-squares.

i6 : S = R/ideal h;
i7 : sol = sosInIdeal (S, 2);
Executing CSDP
Input file: /tmp/M2-21503-0/12.dat-s
Output file: /tmp/M2-21503-0/13
Status: SDP solved, primal-dual feasible
Start rational rounding
i8 : sosPoly sol

o8 = coeffs:
      145  145
     {---, ---}
       2    2
     gens:
        1
     {- -x + 1, z}
        2

o8 : SOSPoly
i9 : sosPoly sol

o9 = coeffs:
      145  145
     {---, ---}
       2    2
     gens:
        1
     {- -x + 1, z}
        2

o9 : SOSPoly

Caveat

This implementation only works with the solvers "CSDP" and "MOSEK".

Ways to use sosInIdeal :