From 8428ba70654869ccfd48259e56ce1ecdb26f38b9 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sun, 2 Jun 2024 16:06:09 +0200 Subject: Use sufficient set of candidates with Half Newton Polytope --- sumofsquares/canon.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sumofsquares/canon.py b/sumofsquares/canon.py index 295a892..94759f2 100644 --- a/sumofsquares/canon.py +++ b/sumofsquares/canon.py @@ -147,7 +147,10 @@ class PutinarPSatz(Canonicalization): # FIXME: need to check that there is not a \gamma_{i} already! # TODO: deterministically generate unique names - monomials = x.combinations(poly.arange(d + 1)) + # TODO: better documentation + # Generate monomials of up to degree d and take only monomials + # that are in half of the newton polytope + monomials = x.combinations(poly.arange(d + 1)).half_newton_polytope(x) c = opt_variable_from_name(rf"\gamma_{i}", shape=monomials.shape) multiplier = c.T @ monomials -- cgit v1.2.1