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.13-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e62cfd0ab09524c8c7ce71faa1087723655bebf4d900b346e5c2d5699d54d757 |
|
MD5 | 917b49e9a1d12e523ef643cabbca8820 |
|
BLAKE2b-256 | d993fe3d2ba1daee12cfec4436c1e25eb4ef39b63d6c3bfa5ed50ab58c8cf50c |
Hashes for dimod-0.10.13-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 923b11b34ff0f5a9db29e0919a6b7d1d475530071084e7c2870eaca7adced5fe |
|
MD5 | 36bf25efed578848da97e8f055994f0e |
|
BLAKE2b-256 | 4dbe46a618671878e805f1fb2534ece05faeee6839a11ef431910d9e8325c3b6 |
Hashes for dimod-0.10.13-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | deff58b040e7e17f5b6bbc66de8f8ac55e73768ea8a112e0fa30a08eac722311 |
|
MD5 | 0943110907910390ccd8080d7f635afe |
|
BLAKE2b-256 | 529eb777810b49c0facbc2bf56719a21275116f1580f632c9bdcb7c82a0d141c |
Hashes for dimod-0.10.13-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | feca023658dd988eb7b1b1c75af23ea7f5ac726288a459680657f3fde7bd8376 |
|
MD5 | e13d83c31e4c91007181d99748c6f404 |
|
BLAKE2b-256 | 1fa5811bdd30f220ac4daa5a3c7e7f2083d6db977044b83a7cede84e0224977d |
Hashes for dimod-0.10.13-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09a4ba50dd35e4d85bfdd6b0911539776bd6c234e0635f4d88d944b7fbec67dc |
|
MD5 | cfe5c731f77c302d5684a58e2e2d5348 |
|
BLAKE2b-256 | 517cb9a7b71a9d902d12f080c3b9c6c6ceda3474e25d009fcad0d6d717d9a6f7 |
Hashes for dimod-0.10.13-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d831180219b4799c41f5816fa602e800a13ecac03fb9636e5b303833e512237f |
|
MD5 | eaff2d9d69cb1576a806218b81c96dc6 |
|
BLAKE2b-256 | e30a09cbcd7ba23afc82b07c5e94892614cf0085c368392144a96971f625b611 |
Hashes for dimod-0.10.13-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 649092e18daf3c8b6b61a825145a8abe1908ce860b8c59106774b43ca6675ff2 |
|
MD5 | c5b848a117c026d8a77f8001247a537e |
|
BLAKE2b-256 | 99cb4dee5e06faa1dff26b798bc04bf46a2b05b763c39ca96c12985c6e35142d |
Hashes for dimod-0.10.13-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 902252ce2ce39a64969a41bacc93db90514b0196176da7997661c0b148c8ee2a |
|
MD5 | 4aa985f8b3f606f0565243beccdf3719 |
|
BLAKE2b-256 | aa40ad2d93b28e1bdd7a028a7c83445a793ed512718ce652a78178b338c5f08f |
Hashes for dimod-0.10.13-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc5be607cacb676d965e4ed465622900e578b013d92fd307420c668e38d224b1 |
|
MD5 | b23485a88c10a26bc688730d856acd44 |
|
BLAKE2b-256 | 635150a67a3d44e33b5669bdbb84677607ab5c85d53fd6190459b555a1588902 |
Hashes for dimod-0.10.13-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfdc85fc215255a5e3176f055906e0e06232781d428a9b772fd45609a2065358 |
|
MD5 | 05224b64ec22c5124067603fcb30b42a |
|
BLAKE2b-256 | 0f13930fcf7b58acd4dc634a4d671107cc46f1e8ba105cab6e41481155c88827 |
Hashes for dimod-0.10.13-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29904aa133f9223c91d74bd700fe11c739d366b853f542bffbfbb6e1fbc069f0 |
|
MD5 | fa49cb45c435f66d65b06c41d00d7041 |
|
BLAKE2b-256 | b18078a0ef6dc6501f5265da81e181d2d6cfa827196524fafbf0afcb9f1b8c0a |
Hashes for dimod-0.10.13-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1507816d08c10e799f126ba5789dd97c7d887a50ddcc0a30b0acac66fd5a532 |
|
MD5 | 48082877ab1cb1d189721879ddffb75c |
|
BLAKE2b-256 | eb004720e702e95fbf8e21a3aeff447242ad94ed96c1ea8549f3b0c31ab8c5f5 |
Hashes for dimod-0.10.13-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eca4ad17b6242ff86849f9c6783bb8b970234afd092ec9b18024d881bfe9c661 |
|
MD5 | 6d266bbb46f4faf33851f4ddd082dd1c |
|
BLAKE2b-256 | ee8a9261d5701b8e9af59d5bee5edc357680c6366e659cfed2a9111547f38613 |
Hashes for dimod-0.10.13-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 125508f43e28b954d78ebbaf0a91e1572a3a161cce8ad88b4ad7960a0ea90111 |
|
MD5 | 62934434355eceeca6522a2b331fd3b1 |
|
BLAKE2b-256 | 5ee16d623fedb1218e7f7ca90e37ff4649d3386d578c1e5379d1723f4bbd37b1 |
Hashes for dimod-0.10.13-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 106c82876ea457705a9f92a55afe311d3279f079ce6ecafdac703f7bce380753 |
|
MD5 | 325f4744af91054d0f5567a4e32f8bc4 |
|
BLAKE2b-256 | bfb37a79cc9af8b1478155e8972503ed631e618f87f3f48fa220491563cf49b9 |
Hashes for dimod-0.10.13-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c386333f801fd78c17dc33d64cdb9935c8516b07bcdf950dc743a631b9c6c80 |
|
MD5 | 9d404b3d1c83b732eb4866db19deb2c6 |
|
BLAKE2b-256 | df565c2091087ffc606ed48b237d6db348e4fa1b580860b3486b9c98272053c6 |
Hashes for dimod-0.10.13-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d678169fbae1662501e9b9d836222e1ee523de2ae8d9bdbdd4ce3f29cae19a4b |
|
MD5 | 1f2698a2754527c033886382e0b90da7 |
|
BLAKE2b-256 | 231e4c632f153c5d11e1044f1889b1f9f906e21b84478c49b33f2ce9c13ec68d |
Hashes for dimod-0.10.13-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23ac2d1331c74a8a1fec89854b9d9432b289d79a48be92ef028f0c6bffa58843 |
|
MD5 | 07f72e35cd0ff555c9290aedf3fde416 |
|
BLAKE2b-256 | dbae521915d78bfedcf2d258dac395052692e9863d2bcb2bc2462d8f4859c287 |
Hashes for dimod-0.10.13-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f7daf04f43f9d952ef91212b7af81e2a49f4899a5537f143edd7c55f0184ab0 |
|
MD5 | 457faa44d0ecb74fe2b32f4724efa988 |
|
BLAKE2b-256 | 343341f0b93864062468ef2dafc14bcc1a342895f5566cf1f07e124273b5cf90 |