From b1b2871e87057b93b444f35aef5ffcc44ac99786 Mon Sep 17 00:00:00 2001
From: Nao Pross <np@0hm.ch>
Date: Sat, 11 May 2024 16:15:49 +0200
Subject: Bugfix in CVXOpt interface when problem is QP

---
 sumofsquares/solver/cvxopt.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sumofsquares/solver/cvxopt.py b/sumofsquares/solver/cvxopt.py
index c4e1db3..7be4e0d 100644
--- a/sumofsquares/solver/cvxopt.py
+++ b/sumofsquares/solver/cvxopt.py
@@ -78,7 +78,7 @@ def solve_sos_cone(prob: Problem, verbose: bool = False,
 
     # cost quadratic term
     if is_qp:
-        n = len(prob.variables)
+        n = len(variable_indices)
         P = np.zeros((n, n))
         # This works because of how monomial indices are sorted
         # see also polymatrix.index.MonomialIndex.__lt__
-- 
cgit v1.2.1