Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is allowed to build CQM object with quadratic interaction between real variables without any error raised #1305

Open
alexzucca90 opened this issue Dec 14, 2022 · 0 comments

Comments

@alexzucca90
Copy link

Quadratic interactions between continuous variables are not supported.
However, it is possible to build a CQM object with quadratic interaction between two real variables by "bypassing" some checks. This happens if we build a model from iterable

To reproduce

import dimod

cqm = dimod.CQM()

cqm.add_variable('REAL', 'x')
cqm.add_variable('REAL', 'y')
cqm.add_constraint([('x', 'y', 1)], ">=", -1, label="c")
print(cqm.constraints['c'].lhs)

We expect to have an error like ValueError: REAL variables (e.g. 'x') cannot have interactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant