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.10-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f85a27f6984b100c49f8eddb3abed7849e3094339e0d51022b4a702c339624b4 |
|
MD5 | e54551061497a10cf908fcc2e40d9b7f |
|
BLAKE2b-256 | 88742fb480a33a84e09401fb02f07070f3d9560068ea1141545d7e514d5e1b6f |
Hashes for dimod-0.10.10-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 687ade02c644ff65c4a70628d697ac1f5f5d952faf85a457d83384377b324172 |
|
MD5 | 25764a7ed5aaad802b103ad8be9822e1 |
|
BLAKE2b-256 | 5a3829b70821d334e587d35e739b6eab33896173c292a634c9f4b5758060386b |
Hashes for dimod-0.10.10-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7ae548a454b9534c569758bd80feb8c2732c839141901ebfc74527782420a49 |
|
MD5 | 87b526af8b769aca3e06ac84763dc31c |
|
BLAKE2b-256 | c99014397d5607b4acfb5d8836fb7740df1f4c6ea9337c90f9373605453d1bf3 |
Hashes for dimod-0.10.10-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 973390051168ea2f2fff1ba7f51845cd96cd8abcd2cafc2d9566aa0f4fdf292a |
|
MD5 | d549742fa9e50a8927ec08252fc34636 |
|
BLAKE2b-256 | 616c968ebfc3abd79fff629c54bf202aaf2b8c493e092eebc73726daaeabca62 |
Hashes for dimod-0.10.10-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0d5a595af4c2fcde22ec069b336b2d05f19b6a9cd9d88555d2a79b7c4e3bdc5 |
|
MD5 | cf90fb98ab2ddf96960cbc5ebe2d35d1 |
|
BLAKE2b-256 | 5db0dff6c888be9f40f664fc84da2c00a59257853b66816a7b8021f878a77943 |
Hashes for dimod-0.10.10-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ef15a9e92e26ec1383b040e5a9fd0d5d080e68a8cadcd557968c0c4bcae5231 |
|
MD5 | 0deaa7668fcae6d5615d8514acf72ba1 |
|
BLAKE2b-256 | 0ce4ce0b40f758b2a57c4d865bdf17eadad175cc71157c3032b35193101b9c06 |
Hashes for dimod-0.10.10-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcf9f0d2039f02b005f52afe08f64481841f300a75ffd8362f5f73f65aca4025 |
|
MD5 | d14b1f2e593ef52b4c8403cbfb929db0 |
|
BLAKE2b-256 | 39a0f728a85b8f4f8a682d3fd4661a49783db3ddf118af775de7472d2a716943 |
Hashes for dimod-0.10.10-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5575abba030064bd80507e07c7398ffe62e98e0c41d5f2992150b3364d682113 |
|
MD5 | 7a8ac813a6ac65584dee20c4be6abfc2 |
|
BLAKE2b-256 | 03dd4c18279bc2c46ec50697af3bf0bdc590e3f47faa44abe600b0621822a688 |
Hashes for dimod-0.10.10-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cc3e1afc463df8d414caceeb35853ae15df09aca3d2efab66466a38323aae78 |
|
MD5 | 6c81c59297d17988272e960f3a09cbc4 |
|
BLAKE2b-256 | aa31c687b2b382a34e3acb89f8cf3e42d095accaa84f442f85860a7ccc31e099 |
Hashes for dimod-0.10.10-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa54e17d6573477757789e32271fc4dce3661875a5d5f2430bc4d4d82c98ffa0 |
|
MD5 | 857d09f4771b2cdc2865741c472e8079 |
|
BLAKE2b-256 | 16d7d52827739f6503a9a6dc20bb11dbb8a468d7316fa60f3ffe629a131df394 |
Hashes for dimod-0.10.10-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 081b700c610fbf25e197cf5f79ff8abb5adb754aa745f274299a0931b62332cc |
|
MD5 | e8592bc72290b918e84886ecf32cd30f |
|
BLAKE2b-256 | 27c29a332402025dc6f56d73b14745940a627276419f9fefc0d00b9069c4ca87 |
Hashes for dimod-0.10.10-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e74ac50a90ef6e509ec39f95a7fede7ff75bc7caee484757c4b97704e45b2bb |
|
MD5 | 65b4a56edf60b317c8779b85c52e691c |
|
BLAKE2b-256 | 82403dddde9afdfa469a893364c2970963f122d9244aab8b20cca37818763415 |
Hashes for dimod-0.10.10-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74669033440e76aa2fe8db7d3410dbe99790118ca5409877d3cc6ef48558b2c4 |
|
MD5 | 7d21a97beb5b0f9f6979305d32e7b465 |
|
BLAKE2b-256 | 6537aa72bc09c4d24e3820ecdb4196dcd0e887ee894ed26cfb067a171c50e8e4 |
Hashes for dimod-0.10.10-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03a7be4a70c3d9fd2c7c1a913ce0f754cf93a42538607cb71a3ea53ba47d4eed |
|
MD5 | a68826b90088a329f78562597cd508d1 |
|
BLAKE2b-256 | 48fabe78ef8d7c0d4b531b9f67b1f8e1d54de68d673eb950dfe40aa28beb56d0 |
Hashes for dimod-0.10.10-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 304a45ef5c25c9e2ed3f68ad791f099be145981a63c62a63dd86eb02b9663dd9 |
|
MD5 | 80add59db37854339423f40489c98c25 |
|
BLAKE2b-256 | 7d7f472164f56ccdafb9bac77b4ef8f05a97a61513bf37eaeded1ecffb9c3bf2 |
Hashes for dimod-0.10.10-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8144238e6c96201a544146540091e20da1efb2f45e4360dda5da04447191f6b |
|
MD5 | bc2df7b3a58e01b986fc51b788a422e7 |
|
BLAKE2b-256 | 0c1a05c49569daa3ec1c7c6b6ccae6730687a9d1e1198ec96936da85d73a1abd |
Hashes for dimod-0.10.10-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c5504df3aa6b017422e23cab92da6e7561e4fe4cf5615ad37f8ffb5ba95a39d |
|
MD5 | ca9a983b98dbe3c9df717d1b4514df39 |
|
BLAKE2b-256 | c8f50e9d315bcedce99263b3a66f3858434c8e8fc7565452a89bfcafaf28d62a |
Hashes for dimod-0.10.10-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c6b9c24b688834c4c27e9754b75815876953b8cf9dbb0ef3bd5f24d2c3c5fbc |
|
MD5 | e31291edb5e90fcd512661795803555b |
|
BLAKE2b-256 | 9e1b12b4c09d5b5cc16a8517dbe449b5bcc90c8217283bbf5d577b5259e4bf24 |
Hashes for dimod-0.10.10-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 219bd9c6b46b31764e63b650a0e1a6a5a39c78aa1651665b51a7965a78d24b65 |
|
MD5 | 0ebe3f406b9619b1cd90a7ac7e49619d |
|
BLAKE2b-256 | bfe5fc7383d61a5765b4c8f1ae1d53b6ff7cba41b22d8280a338ae8ea2121307 |
Hashes for dimod-0.10.10-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70196d60649c192965bc847bdd91bb744e275810342000afb0bb9d81ad46472c |
|
MD5 | be83a9a2933e78442edc7dd5c262d8f0 |
|
BLAKE2b-256 | 41a8baef9254f3c1a1aed2d8e2d90966bf438121dbdc228187d745a330bf3d27 |
Hashes for dimod-0.10.10-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99575e3d7d9d4ef59a168f035c0b3c0f6c36f71de9adf846c4ba7d281b24b5ca |
|
MD5 | cff5eb21d5695184de9c8f53b87785ce |
|
BLAKE2b-256 | 0b7f5b7e1fe06138436f885b2bb0594f6648f48d5d4982837209533181d7c3ee |
Hashes for dimod-0.10.10-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da7bf7af31b55c740db37c69a96554152f7151d244c12e598c433038ff50ecb3 |
|
MD5 | 70c913a62ed40a1a1a102c39bc5b2bc6 |
|
BLAKE2b-256 | 5f2f6fd902ef07e9c83d35cc20e5cc32766da7d9b253ddc041875e0c298dba6c |
Hashes for dimod-0.10.10-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99861c76f81a315989a52ef02b1fbc7777731be0a21b5b26737167fbf4b5b359 |
|
MD5 | 62bd1c583ac445b207fd0ab23294f875 |
|
BLAKE2b-256 | 6a92813278ffe56b276912558570ce127e2f3bfa98676d8d6df6a79a79487c03 |