Multiplying two real variables in Dimod and D Wave
https://docs.ocean.dwavesys.com/en/stable/examples/hybrid_cqm_diet.html#example-cqm-diet-reals
Given above is a link to solving a mixed integer problem using dimod and d wave. According to this link, it is possible to multiply two real variables :
quantities[0] * quantities[1] QuadraticModel({'rice': 0.0, 'tofu': 0.0}, {('tofu', 'rice'): 1.0}, 0.0, ... {'rice': 'REAL', 'tofu': 'REAL'}, dtype='float64')
However, when I run the exact same code in my laptop i get the following error:
ValueError: REAL variables (e.g. 'rice') cannot have interactions
Anyway to resolve this? I also tried installing all the different versions of the dwave ocean sdk but none of them worked. Thankyou
Comments
Hello,
Thank you for bringing this to our attention.
You'll notice that in [2] on the following page, real valued variables can not have a quadratic interaction:
https://docs.ocean.dwavesys.com/en/latest/concepts/cqm.html#id2
We have created a ticket to correct the example to use non-real values:
https://github.com/dwavesystems/dwave-ocean-sdk/issues/292
If you reformulate the problem to use another variable type, it is possible to run the same code example.
Hopefully this was helpful. Please let us know if you have any questions.
Please sign in to leave a comment.