NCisCycConvex

description:

[iscConvex,g,sohs,h] = NCisCycConvex(f,precision) checks if the second directional derivative of a polynomial is cyclically equivalent to a sum of hermitian squares.

arguments:

f is an NCpoly representing a polynomial.

With precision we can set the smallest value that is considered to be nonzero in numerical calculations; if the command is called without it, we assume the precision set with the command NCsetPrecision or the value set in NCparam.m.

output:

iscConvex equals 1 if the second directional derivative of a polynomial f is cyclically equivalent to a sum of hermitian squares and 0 otherwise

g is an NCpoly representing the second derivative of the polynomial f

sohs is the SOHS decomposition of the polynomial cyclically equivalent to the second derivative of the polynomial f

h is the NCpoly representing sum_i m_i^*m_i cyclically equivalent to the second derivative of the polynomial f

possible usage:

NCisCycConvex(f), NCisCycConvex(f,precision)

example:

>>f = 1+2*x^2+x*y+2*y^2;

>> [iscConvex,g,sohs,h] = NCisCycConvex(f,10e-5)

iscConvex = 1

g = 4*h1^2+2*h1*h2+4*h2^2

sohs = 0.5*h1+2*h2

       1.937*h1

h = 4.00003225*h1^2+h1*h2+h2*h1+4*h2^2