The SumsOfSquares package works with two coefficient rings: the rational numbers $\QQ$ and the real numbers $\RR$. Almost all operations in this package rely on a numerical semidefinite programming 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 sumofsquares decomposition exists or not. In case of failure, a real result is returned. The following example of Scheiderer is a sum of squares, but does not admit any rational decomposition. Consequently the package must return a real solution.



Given a sumofsquares decomposition with real coefficients, it is often useful to ignore the squares with very small coefficients. The function clean(RR,SOSPoly) removes the squares whose coefficients are smaller than a given tolerance.
