dimod
dimod copied to clipboard
A shared API for QUBO/Ising samplers.
These functions should be better documented, and possibly promoted to the top-level namespace. ~Further, it would be helpful for `unpack_samples()` to also accept an optional `num_variables` parameter.~ edit: that's the...
It would save on needing to do things like ```python qm.add_linear(qm.add_variable('BINARY'), 1.5) ``` and would improve performance for the `_from` methods, e.g. ```python qm.add_linear_from(((v, 0) for v in range(5)), 'BINARY')...
There are times where it would be convenient to add quadratic biases from a large dense array to a BQM or QM. There is currently an internal method [`.add_quadratic_from_dense()`](https://github.com/dwavesystems/dimod/blob/1bfbd3c66641b0121d077fca2002a7c6cd0941be/dimod/binary/cybqm/cybqm_template.pyx.pxi#L273) that...
Right now this can be done with ``` with open(.., 'wb') as f: shutil.copyfileobj(bqm.to_file(), f) ``` but it would be nice to be able to just do ``` with open(..,...
**Application** Enable easy construction of binary indicator variables with values set by other problem variables; for example, True when an integer variable is above a threshold **Proposed Solution**  **Additional...
**Application** This would allow inexperienced user to specify optimization problems at a high a level, without needing to worry about technical concerns such as making objectives and constraints quadratic' and...
**Description** Is it possible to add a method to specify the value domain of an integer variable while defining it in CQM? For example, I can define an integer variable...
**Description** The method [`to_numpy_matrix`](https://github.com/dwavesystems/dimod/blob/e125795f183954d60fd8c5316eacceac7b85e495/dimod/binary/binary_quadratic_model.py#L1841) raises a deprecation warning with the message `bqm.to_numpy_matrix() is deprecated since dimod 0.10.0`. This [note](https://github.com/dwavesystems/dimod/blob/6d1e4b1fccbfa556599533f934f15143db1a0ef6/dimod/core/bqm.py#L1063) in the `bqm.py` file suggests to use the `to_dense` method instead...
**Application** Currently, when one converts a cqm to bqm, labels of the constraints are discarded and generated from scratch, resulting in slack variables with the new label. Also, in case...
**Description** As detailed in the title and MWE example, this code is failing. **Steps To Reproduce** This is a MWE ``` import dimod import numpy as np N = 10...