Alexander Condello
Alexander Condello
Do we have an official recommendation in the mean time? AFAIK [python-mip](https://www.python-mip.com/) works pretty well. ```python import dimod import mip model = mip.Model() model.read('example.mps') model.write('example.lp') cqm = dimod.lp.load(open('example.lp', 'r')) ```...
That would be a constant, not a variable. At some point we'd like to add support for constants but it's not supported at the moment.
I am warming to this idea. Especially now that we treat discreteness [as a marker](https://github.com/dwavesystems/dimod/blob/main/dimod/include/dimod/constraint.h#L98-L99) rather than a true flag. And also because presolve [will remove invalid markers](https://github.com/dwavesystems/dwave-preprocessing/blob/bb77861614e3a7fd851f4fbe5b96e40cac1b62aa/dwave/preprocessing/include/dwave/presolve.h#L228-L265) and [will...
How would you expect ``` x = Binary('x') y = Binary('y') z = Binary('z') # 1 cqm.add_discrete([x+y, z+1]) # 2 cqm.add_discrete([2*x, y, z]) ``` to behave? Would you expect it...
FWIW numpy handles a similar case, `bool(np.asarray([0, 1]))`, with `ValueError: The truth value of an array with more than one element is ambiguous`.
At the very least we should probably update the docstring to make the current usage clearer (credit to @pau557 for the suggestion).
https://github.com/dwavesystems/dimod/pull/1089 adds support for ```python x, y, z = dimod.Binaries('xyz') cqm.add_discrete(sum((x, y, z))) cqm.add_discrete(x + y + z) cqm.add_discrete(x + y + z == 1) ``` and similar.
Duplicate of https://github.com/dwavesystems/dimod/issues/988
Updating my [comment](https://github.com/dwavesystems/dimod/issues/988#issuecomment-914477913) from https://github.com/dwavesystems/dimod/issues/988 and incorporating the [feedback](https://github.com/dwavesystems/dimod/issues/1217#issuecomment-1175349301) in https://github.com/dwavesystems/dimod/issues/1217. Adding the ability to symbolically manipulate higher order binary models is not especially difficult from an implementation perspective. However,...
For this specific issue, @gilirosenberg12, it would be helpful to understand what sort of models you're creating that need this feature. What sort of density of terms? How many variables/terms?...