A shared API for binary quadratic model samplers.
Project description
dimod
dimod is a shared API for samplers. It provides:
a binary quadratic model (BQM) class that contains Ising and quadratic unconstrained binary optimization (QUBO) models used by samplers such as the D-Wave system.
a discrete quadratic model (DQM) class 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.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59b95d6d3a23b1ed0fe3b8f9f38129c642810d99e2d24cdc3443148309c90422 |
|
MD5 | 128e4f2aafb0dd221f6db4022208c4f9 |
|
BLAKE2b-256 | 7fc6c98ee862e10c99499b3bbc97cf48bcddc4057088a878e698a0a673407a36 |
Hashes for dimod-0.10.2-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53422ecdb76243eba95221fbff0d2e57a862f5620cda642a3dcae3533cae3309 |
|
MD5 | 4caaf57cee5098aedbef342231e2868a |
|
BLAKE2b-256 | 829d70a4a38e88478014184461c1d273d061663812bf76843bf5e550dbc59b56 |
Hashes for dimod-0.10.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a0b02029da076aaf75e59fda9319ee9b1bf4c6af3121e44bf3939bea8622502 |
|
MD5 | f96d432b06ed9a2eda4bb3125be62853 |
|
BLAKE2b-256 | da9cbbfd97cea895909bb25fb95b398d424c2b84c01ae1f43712eb1c23e9364e |
Hashes for dimod-0.10.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54508f7eb043383ad6767eb13f0f3086b17113b42b60ed2239e4d725bb824560 |
|
MD5 | c5019372bf158c1d11771bbf121b956e |
|
BLAKE2b-256 | ae6fbd297d5ad43cdc5dff260b646951c57731a2fd57bd64fe756cf9594d2f33 |
Hashes for dimod-0.10.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89785444c759e45867ce34dec05b5333a939d153b1fbc18716f1a154d503dd72 |
|
MD5 | dee53ec43fb281d0363285f1440a61bf |
|
BLAKE2b-256 | 6f902f7a4087ccbc65678c2d337824067fc79c0033dcad01098134c55fcd5c5d |
Hashes for dimod-0.10.2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0d46ea59c7ef7f25e91d17ea60df00e00ada334a82b0fa98e351c1ad994bf15 |
|
MD5 | 73b70a5d2ea71c633dd3f7d3eaff8385 |
|
BLAKE2b-256 | 2d0d14da1a5b16111f6f68b7f9f127d5d49d12fdad90e2556485ca16074bb4b3 |
Hashes for dimod-0.10.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75ba7abdbf82f00cbbc0c6873a57a92ef5be04423947dfc5c798ea5a3f2aee4d |
|
MD5 | 523f73a24229e6557e02dd6308295862 |
|
BLAKE2b-256 | f7e1d1cac027aecf6a17b4dd799227713ccb9648b3c1b6c6cd0a06220da5fe03 |
Hashes for dimod-0.10.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 874cc379c9576cef7a622a67575f444d08534a703ac57328453bb90f1510f0c8 |
|
MD5 | 4514efa396a6cdddcd77712b28ce37af |
|
BLAKE2b-256 | d1ca5ef7f99f4d5f4d7c6e463b709569ff991f58b823c0e1d6b8e356d7cd316c |
Hashes for dimod-0.10.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 953120e2e4a74392b482c0e507d5687ea08732685957c1676105ed3a020f2bef |
|
MD5 | 227c1b3aa5515671d8a322fea5e2b593 |
|
BLAKE2b-256 | 7b699ebcd97e9707878beded02c58c98eea803a69eb10884e7fc73825e0682f1 |
Hashes for dimod-0.10.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f852bebfd503102f42d8160d63ca2c775be27307aa2eddf6c5c31d28fe02be16 |
|
MD5 | 684917a346f5fcd11921c9e6afb2bf3a |
|
BLAKE2b-256 | b91bb7d2a9378a7051b2ae5d9e445a73673c0f6a3e9ef26fe078c6477cc083d1 |
Hashes for dimod-0.10.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d9ed8422940788a343bca98787535204a8256f1c1801b70ff8431cb57868789 |
|
MD5 | d971b61d92d6d9d0fc4762603d7dadc4 |
|
BLAKE2b-256 | af8badd1a673634ea950c7f44cbc1c175cd7d61be6c5d12d17e694d8f64e4460 |
Hashes for dimod-0.10.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69c853cc1389fa10635504f9058b64570cd9936a6c514bdf8611fb23cf7daad8 |
|
MD5 | 93cfaee2d754fb9d09791af98f6a0a66 |
|
BLAKE2b-256 | 890f581b227159600de0b4a211a717ff537eec4f7c195d942fd5ec51b553952e |
Hashes for dimod-0.10.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16afccc28e23c6f63fa9d51c03e189bc8e913c5a91dba5a85b11e88e288da132 |
|
MD5 | a1c766ad4e5c8365b452c69bb42c51e8 |
|
BLAKE2b-256 | 0e1363d83b94f186da235ebff737be21761e650bb5b06a70cba9398ea2e12233 |
Hashes for dimod-0.10.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dac90910d0efe5e767020b3fb21c976180bc776331583c6a04e229954df5854 |
|
MD5 | 075989437f66afff24bf28e344c2fe15 |
|
BLAKE2b-256 | d43b434c9e358101d72612cf3cee7569de7aa2d3df31b65c5adc94dfc68aa3ab |
Hashes for dimod-0.10.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13b876aa1bd83f0dcaf7ef7cd7c738ff6b19f3801046080f6a60ca0b3da97a29 |
|
MD5 | 9b047b0c1ec7c05df585b216ca7f76d8 |
|
BLAKE2b-256 | 2e3cd5dd229b7995af383978027d79d068d5a08f007b28f8327464da0e511495 |
Hashes for dimod-0.10.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f7d975a866a0fd60713ce1a6f9150d08838082e2a4010ba469948aa168c0ed2 |
|
MD5 | 85811b15df0be7909e493385ae092ee1 |
|
BLAKE2b-256 | 0221838fff1b02cc0fba5eb6b60c0333d381909648f9de6eecaa9750f9b54748 |