Given a nonnegative ternary form f, this method uses Hilbert’s algorithm to compute a decomposition of f as f=(∏ipi)/(∏iqi) where each factor pi and qi is a sum of squares. The method returns null if f is not nonnegative. As an example, consider the homogeneous Motzkin polynomial.
i1 : R = RR[x,y,z]; |
i2 : f = library ("Motzkin", {x,y,z}); |
i3 : (p,q) = sosdecTernary (f); -- warning: experimental computation over inexact field begun -- results not reliable (one warning given per session) |
The result, in this case, is a quotient of two sums of squares.
i4 : (#p, #q) o4 = (1, 1) o4 : Sequence |
i5 : clean(1e-4, f * value q#0 - value p#0) o5 = 0 o5 : R |
References: Products of positive forms, linear matrix inequalities, and Hilbert 17th problem for ternary forms, E. de Klerk, and D.V. Pasechnik, European J. Oper. Res. (2004), pp. 39-45.
• This implementation only works with the solvers "CSDP" and "MOSEK".
• Due to the iterative nature of the algorithm, it could happen that some of the the output sums of squares are rational while some are real.