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.17-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9039dc9da6a6c0c6859a95bb72be095c010af788de3d8307d4123ecd093b3865 |
|
MD5 | 251172c28a6f0120f16551409adaaa89 |
|
BLAKE2b-256 | a2b5a4159f3d17502cb4b27594450b0fcb89581b99e99898397f5f1078a459b4 |
Hashes for dimod-0.10.17-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3e8a282f21d9abb0f3bf74c2adad2f158ce623eb82e0baedb8ab54757d081dc |
|
MD5 | e80262f21e2ebffcfc68274ae9d87ac6 |
|
BLAKE2b-256 | be367b74040f07ba723ce7cde741e9d56d929767b9ea9867bba675610832ec0b |
Hashes for dimod-0.10.17-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09a0b2ab51a26df9b1778590543efa094b4c4ac224ae9d79738d5a80f999e240 |
|
MD5 | b1eb175f25730c4705eeef954167fc0e |
|
BLAKE2b-256 | a026b7c7b4a66ac5b21bddd2fffce25eaafb5991c685a81e24758b509e373e70 |
Hashes for dimod-0.10.17-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef79a2fad076cf391bb0555aa8b9140678627fcde6b3cd4641e9bc7dbdb5a0bf |
|
MD5 | f9130c0cfa8ec7916880c00e9c8e5839 |
|
BLAKE2b-256 | a1f435b1d915785159deaf11e32216b085922c1d564d23fa113519e2ed32d844 |
Hashes for dimod-0.10.17-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6905cd9f618f596be7fbde191fb5faf0c4a5c3cfd0973616cb5238acceaa6ed |
|
MD5 | aa1cbe988c8a414508865b6292a2fa41 |
|
BLAKE2b-256 | 5fb9ebc0b05c93c27d254298cf3fab4efc877926da3c9af5cbeaa00faa632420 |
Hashes for dimod-0.10.17-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aab9345dbe5c5cddc3cbef181ce7ec239cefd38c0ed11c673016916ddac317ba |
|
MD5 | 05ba9442b30cf1b32f096be60759e40d |
|
BLAKE2b-256 | bd9000a9faa31234b57ab32eccea3d38e2d4f1e32759fbfec4747694b82c4d39 |
Hashes for dimod-0.10.17-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9297ae696e3ca294aaabb6608049d6348d918ef302a833fa30963c5d75b1f476 |
|
MD5 | d02210bda871175aba1473d467461068 |
|
BLAKE2b-256 | 7a8ed710959f93ec0d41c1bddb5b784bd8c6148ae3a7b83d3ec14c4162b08461 |
Hashes for dimod-0.10.17-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2d79ef012eb76a3172dc674f8b6aabc53a6833a985b851996bd97b6c18910d5 |
|
MD5 | 228bd028f23f07b026e0c15f6438c10a |
|
BLAKE2b-256 | 2150435718a8958f7aa35502806d06ba6accdd8b3bc9f3ab18bef969787283c1 |
Hashes for dimod-0.10.17-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24e01d57f87cc90f829274cb3e91411e7305f46bf6e27473afe3792d330d1899 |
|
MD5 | f70bd3cf6f686ae53753326a35ca05f0 |
|
BLAKE2b-256 | 1602b1fce8be28315b04e03e005c089d5bf949f78a926e93fe496c23bd995f53 |
Hashes for dimod-0.10.17-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e219404383ffb085e9971c9190bba7be755bd8435c8a3176cb1333aba5db1930 |
|
MD5 | 424fdd10b911e7e56d261f2ea7c6fce1 |
|
BLAKE2b-256 | 6f57cac8602a9b831aac06ffaee404b075bec3d1f5e5813675b4ff6211f2e2b1 |
Hashes for dimod-0.10.17-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2154e25982dcdb0516e480e519b3e885ee10cdd682da3b8404acae8c623ce922 |
|
MD5 | 5fe0b02e1ab249ea169e8e28a7021ea3 |
|
BLAKE2b-256 | 0c3a515c94dae7faa3a07e551e93a1bda5629ee45b942d0c5762df6d363c5a79 |
Hashes for dimod-0.10.17-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65e947dd5378760f137b7c6dec3eb5678db074cf7240b5d64dd739ee1d93d020 |
|
MD5 | 61b6f85649dc99a216a54efc3908cd5b |
|
BLAKE2b-256 | cbd71d3e43fdd2a4994a4868ae4e968f71d436b9b4ff4cecbcc80f644c88f9d1 |
Hashes for dimod-0.10.17-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90a021037413037d7672b4dcece95aafd356dcaa462e6a4ab44bf882431dde93 |
|
MD5 | d3dee044b5800b4f30ebcddc5de6d097 |
|
BLAKE2b-256 | b1de30093e063b74535763fd8a3773586a028a951ac2cc3c07b97e104838fb09 |
Hashes for dimod-0.10.17-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b02cc56334585ba8286679be23cd6b002541c657c7f7c22d1f67df7a13725ab3 |
|
MD5 | f096a06475d585dbd950e5c64a699472 |
|
BLAKE2b-256 | 61dfffba41aac7273fc6252cf49314dbdfb7237f53cc6b4769374bb01164d387 |
Hashes for dimod-0.10.17-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1be0121387b643ec62c2a9c353f38ff85938a2d374144881f8833691a6e89aea |
|
MD5 | 9b792c964c2d9e7f91bf0f8936f7f6bf |
|
BLAKE2b-256 | 0ada17826429902fbb4ae062695e85d601bbf8186f071c6bd162898c55932702 |
Hashes for dimod-0.10.17-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c936bf332331580b480958ca67c48ab3c75b5047b470d65487a9b8482f581df2 |
|
MD5 | 37ae592fd7eeccace649ae0564353cfd |
|
BLAKE2b-256 | 9457e0fceb99f62127d69eaaed4fd5b0dde244f59da9d98f026d5619ce8e1d29 |
Hashes for dimod-0.10.17-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b73a3848b49216863f0ad5b2b336c433cfe1b236b91f1ad941768afd0c780073 |
|
MD5 | 0308818c06d096717adda01f21f35247 |
|
BLAKE2b-256 | 93cfce2e7cd7ba8b950252a812b9efe42afc8c19bc740b32e7787e82bada1ba5 |
Hashes for dimod-0.10.17-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23801a1325ee04edb8f320ab5eb0d01c0e41741535a218ed1f97663fb3d63d9b |
|
MD5 | df7b384ed8d33bc569eadc40cedfc661 |
|
BLAKE2b-256 | d6f404cee2b381af3df51597bfad46735c45105407cba61fc85bf4758947c098 |
Hashes for dimod-0.10.17-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3625e6ae26ae4d48d4254da401d7486a7de3767b508a49c1fa2c44f7218cd2f0 |
|
MD5 | 1943b89cece0203d5e52ba0aa8a98d19 |
|
BLAKE2b-256 | ed791488a6a67a5d66b93dfabb45438c6d703aeaa084a9980916155923e0ea85 |