dimod
dimod copied to clipboard
A shared API for QUBO/Ising samplers.
It would be useful to merge several BQM/DQMs. At the moment one can do ``` bqm.update(other_bqm) ``` to merge two BQM objects. We should add a `DQM.update` as well. Further,...
#788 removes `AdjArrayBQM` and `AdjMapBQM`. We should test that BQMs of those types that were saved to files are loaded as `AdjVectorBQM` and the correct warning is raised.
Ported all the dqm code to C++. Not making any attempt to rebase with upstream/main since there is a lot of divergence now.
Right now `bqm = dimod.BQM(vartype='SPIN')` works but `bqm = dimod.BQM(offset=5, vartype='SPIN')` does not. The arguments are (largely) determined by position.
Something like ``` def dqm_to_bqm(dqm, strength): case_starts, linear, quadratic, _ = dqm.to_numpy_vectors() bqm = dimod.AdjVectorBQM.from_numpy_vectors(linear, quadratic, 0.0, dimod.BINARY) for i in range(len(case_starts)-1): cases = range(case_starts[i], case_starts[i+1]) bqm.update(dimod.generators.combinations(cases, 1, strength=strength)) if...
**Description** bqm offsets are not appearing in .coo files **Steps To Reproduce** ``` import itertools import dimod bqm = dimod.BQM.from_ising({}, {c: 1 for c in itertools.combinations(range(4), 2)}, offset=42) with open("inputs/{}.coo".format("test_1"),...
See https://github.com/dwavesystems/dwave-ocean-sdk/pull/21 Also see #298
If there is interest in merging info when concatenating samplesets since right now all info is ignored. This preserves conflicts by listing them, but squeezes unique values.
https://github.com/dwavesystems/dimod/blob/434f75d0fc958a6bc3e2658ec9bc758346a39f00/dimod/higherorder/utils.py#L102 That function does not lead to a correct sample set. Here is a simple test case (factoring). I want to factor 15 to 3 and 5 and I know...
**Description** When we have tried initializing `BinaryQuadraticModel` using all the keyword arguments, we got an empty model. However, if we use `linear`, `quadratic` and `offset` as positional arguments, it works...