peterwittek / ncpol2sdpa

Solve global polynomial optimization problems of either commutative variables or noncommutative operators through a semidefinite programming (SDP) relaxation
http://ncpol2sdpa.readthedocs.org/
GNU General Public License v3.0
50 stars 19 forks source link

RuntimeError: The requested monomial ___ could not be found #42

Open grupot3 opened 4 years ago

grupot3 commented 4 years ago

I'm getting the error RuntimeError: The requested monomial ___ could not be found

For instance, in this code

from ncpol2sdpa import *

X = generate_variables('x', 2)
obj = X[0]
inequalities = [X[1]]
sdp = SdpRelaxation(X)
sdp.get_relaxation(2, objective=obj, inequalities=inequalities,
                   chordal_extension=True)

the error appears, saying The requested monomial x0*x1 could not be found

However, in this other code (note that I've simply swiched X[1] and X[0]) the error does not appear

from ncpol2sdpa import *

X = generate_variables('x', 2)
obj = X[1]
inequalities = [X[0]]
sdp = SdpRelaxation(X)
sdp.get_relaxation(2, objective=obj, inequalities=inequalities,
                   chordal_extension=True)
nnnnmj commented 1 year ago

Did you solve this problem? I came across the similar problem as well.