SumOfSquares.jl icon indicating copy to clipboard operation
SumOfSquares.jl copied to clipboard

Unclear Documentation on Creating SOS Polynomials

Open mohammedehab2002 opened this issue 1 year ago • 1 comments

The documentation says creating SOS polynomials is the same as creating free polynomials but replacing Poly(basis) with SOSPoly(basis), but that doesn't seem to be true. The constraint seems to create a GramMatrix rather than a polynomial, and while the documentation claims a polynomial p is set to x'Qx, I can't find how to access that polynomial. I tried manually creating the polynomial as x'Qx, but in my case, I need x to be a Chebyshev basis. I tried using the MultivariateBases package for that, but I get an error saying ChebyshevBasisFirstKind doesn't support adjoint.

mohammedehab2002 avatar Jun 17 '24 21:06 mohammedehab2002

The GramMatrix is a polynomial in the form s = b' * Q * b where b is some polynomial basis. If you want to convert it to a polynomial, you can do polynomial(s). About Chebyshev basis, the support is being improved in https://github.com/jump-dev/SumOfSquares.jl/pull/355 but it's till a work in progress.

blegat avatar Jun 18 '24 07:06 blegat