A shared API for binary quadratic model samplers.
Project description
dimod
dimod is a shared API for samplers. It provides:
classes for quadratic models—such as the binary quadratic model (BQM) class that contains Ising and QUBO models used by samplers such as the D-Wave system—and higher-order (non-quadratic) models.
reference examples of samplers and composed samplers.
abstract base classes for constructing new samplers and composed samplers.
(For explanations of the terminology, see the Ocean glossary.)
Example Usage
>>> import dimod ... >>> # Construct a problem >>> bqm = dimod.BinaryQuadraticModel({0: -1, 1: 1}, {(0, 1): 2}, 0.0, dimod.BINARY) ... >>> # Use dimod's brute force solver to solve the problem >>> sampleset = dimod.ExactSolver().sample(bqm) >>> print(sampleset) 0 1 energy num_oc. 1 1 0 -1.0 1 0 0 0 0.0 1 3 0 1 1.0 1 2 1 1 2.0 1 ['BINARY', 4 rows, 4 samples, 2 variables]
See the documentation for more examples.
Installation
Compatible with Python 3.6+:
pip install dimod
To install from source (requires pip>=10.0.0):
pip install -r requirements.txt
python setup.py install
When developing on dimod, it is often convenient to build the extensions in place:
pip install -r requirements.txt
python setup.py build_ext --inplace
License
Released under the Apache License 2.0. See LICENSE file.
Contributing
Ocean’s contributing guide has guidelines for contributing to Ocean packages.
dimod includes some formatting customization in the .clang-format and setup.cfg files.
Release Notes
dimod makes use of reno to manage its release notes.
When making a contribution to dimod that will affect users, create a new release note file by running
reno new your-short-descriptor-here
You can then edit the file created under releasenotes/notes/. Remove any sections not relevant to your changes. Commit the file along with your changes.
See reno’s user guide for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for dimod-0.10.15-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ae5b3a9c12c7996a8ba4699cf9665c6c19843599757b6dbdc3cb937acb7834f |
|
MD5 | bd87a5771e4025c99337387a0a26f858 |
|
BLAKE2b-256 | 2f258ec0260d6da9dd4e274f5ea932b46f26e7b76d96131a9b956badfd9e8a9c |
Hashes for dimod-0.10.15-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f4a3545def08cbffbac72f91dc6dc580260b92705c452f3fc33b41addd4c12a |
|
MD5 | 365c8311b362b29bbf67a4b629e6aae5 |
|
BLAKE2b-256 | 16a7cac29db9e8af7fd0e67df3b6979cf5e5c67b2778a787233ebcb5e04a530c |
Hashes for dimod-0.10.15-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46e60c827e347d373d86761aafaf093c53addbf50d03ff846f2a72853da8c1c0 |
|
MD5 | 333ab9b091996dc4dacc5fd0b4decfa3 |
|
BLAKE2b-256 | 957f646f145a6d9c83278fc650f61bfaa9962da28bd0179641c642bd1e0f44cb |
Hashes for dimod-0.10.15-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0e2fff01f29567f6d2740a4f6bd8cfb6718392e821dd0f7c96463387538482d |
|
MD5 | 6967488b8c90513bdabfaedc44b05bd0 |
|
BLAKE2b-256 | 52e9af6d2da0375062e341f5e70876e77334853cd33d044f6d8ed86da8016843 |
Hashes for dimod-0.10.15-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fef2f242355065350a50440fd8f0b3feec71c499a9cfef7493f4f6d5176be94 |
|
MD5 | 29a2ac83cf8a9f9d204c94667eca5dce |
|
BLAKE2b-256 | d71767d6983e7d6d7c765b8c58e2b1c48f85e14da0949b93a70c2f69daa7321f |
Hashes for dimod-0.10.15-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8469b0829f537f50e0b31e04a41fb9b922b5c59e6aa56bf69957036933584fee |
|
MD5 | 660155c00b01e4f5c78c660b5b683bfa |
|
BLAKE2b-256 | 073ef824662ac6a123c343d84ef8c8da0d20928e0f1baa4b8bb53f668a9bed33 |
Hashes for dimod-0.10.15-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea907f97354d1afff1cbd67ba26cf66bb32b97dc9e7d11f7b6ec1d536a0e87f |
|
MD5 | f10ebbfae58e13e7143c530f8eb0f803 |
|
BLAKE2b-256 | abca8a670823d06d8fb461f644fe060f3ac0cde147009d9759e26819f15fbfba |
Hashes for dimod-0.10.15-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f27313232352dbc69c0fded0fad5a9bdedda4efdaabc19702e09c0bf700d83f |
|
MD5 | 767aa25d84482cf5ff732ce7402f6085 |
|
BLAKE2b-256 | 35152d2b5c6aecd47cb5c7a57fb5e6887b2f2242f4210c782e68917396559644 |
Hashes for dimod-0.10.15-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cfcbca02b3fc96bf333f9f258b42d519ed978a2ccef1ccc4920bca5ac5e201b |
|
MD5 | 6f221872dc27dee59606a8d7b29277be |
|
BLAKE2b-256 | b874231e871a149d0a0f751810b86fba80bfb47fbf38928443688bad960bad9c |
Hashes for dimod-0.10.15-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f656a1256feca12d383eee042038c418019f075d2c347548a4880d0c30061e6 |
|
MD5 | 6b3d2a9d3a554ce10794471c1fc80e78 |
|
BLAKE2b-256 | 21974c51be6b623000b01bb4c5dd0e3dfc9bcf08a1ed36c085d63491ff8f495c |
Hashes for dimod-0.10.15-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39e9ebc7a83126df9dcfce244ee31506f668ec5790ec9984205b359e583d1fdb |
|
MD5 | 83d42b9c5d5b2b4200b16134baa7ab1f |
|
BLAKE2b-256 | d170b7905ad656bcfa999942c78c132309efb4abb9ef003b233d6f213f28e1bf |
Hashes for dimod-0.10.15-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96a51ab50a3b6841d08bb3807f87e48170c7da67faf8bb55e230195248f7a3a7 |
|
MD5 | 1d63f5675dffde65f2f4cd8e0d6233da |
|
BLAKE2b-256 | 2a58f111b14185597456737fa8427e4b84e2aeb59f713424d4518b2da3a05c5b |
Hashes for dimod-0.10.15-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6984cc7054c80ba240123683e96ce9d374bbcbae2bf692df6c7860148e0ed2f7 |
|
MD5 | 4cfa6372b9c89b54e9670fc2c5c7e9cf |
|
BLAKE2b-256 | 52c855fc7945bf22871ca760c40fcd61e93860c713e8d3fae5c83a7942d663ce |
Hashes for dimod-0.10.15-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 548dd4d17325d6f39b2176c5f8bcf52ecc208572bec83b1b2a0096e0359b8a87 |
|
MD5 | b2fb3f2f8280867d3b26b52e2268b6bb |
|
BLAKE2b-256 | eaa00bd60981dd1622d6c4acbd0c34e280c05445754140c2315b4aa9237fa640 |
Hashes for dimod-0.10.15-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6222ed4469bb6fd2b1fa8653b9e5be7deead55dff82ba9b512847bbc7dd7f64f |
|
MD5 | 1c4bb6ed0f566f0ac5acb050c57f911d |
|
BLAKE2b-256 | b78f5704dc29611d21665c2d88cc12fed7a5b9607ee6815f340571b4852f3345 |
Hashes for dimod-0.10.15-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf250bb84dd1c9b35b039db5963477502e6c1dcefb3569d1424a61472dd3d8f3 |
|
MD5 | 5382f31612b3d7eb162e1641609d4d42 |
|
BLAKE2b-256 | 48a2773cfef45d84a3f6cd3824b871f436360b4bc423dec1ea595864d9ec3780 |
Hashes for dimod-0.10.15-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 554aafc35e21aa03a4281a29a431ba7c4f7d550758ab55f0f37557a5975c6245 |
|
MD5 | d1543f5647ffcc47ac48db15e1f3b419 |
|
BLAKE2b-256 | e0830a344022800d38193a1b3ed364a938bb0d34622c945ae32911626de00a7a |
Hashes for dimod-0.10.15-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56fb4c105d6e7e7e4bccbbd361a97bdbcd17c54611c368cdd09349d4fd884724 |
|
MD5 | aa1b4317dbc68e766dcaa69486ba2e47 |
|
BLAKE2b-256 | 88439ffa53b83477b4db27e08f80daca164f67cdf807107f7d5500568b75d1bb |
Hashes for dimod-0.10.15-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5caee9fdd83b1563475925152a58915badb94f8cd48d541858cb4dab4e4ef8df |
|
MD5 | 9bccef7389bf2286f032702551d6ad5d |
|
BLAKE2b-256 | e2dba86120b60f3b008d1785f8947324cc372306dbd0e4ebe6447f671f25e8e0 |