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.8-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d97a2e01cb949a973ed16ae9da18f9b766a82ae91ce03502a270cf01ce5c66b6 |
|
MD5 | 4295c1c59fb58852ca50cd5314156a4a |
|
BLAKE2b-256 | bda034ef79e5299816f2d51f5c35e12d73e304d7f59e0b5ce6f94d725f5ec4c2 |
Hashes for dimod-0.10.8-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dec311111d3af645e04d138e6621a2e03b94a6a25669b0eb1e5eb73d04da1f04 |
|
MD5 | 86356af3583eace11337946bf2f02719 |
|
BLAKE2b-256 | 941c3bd3e945a744aee88cdef9b23bbaaf4ee01de836a168dd95944da588c44c |
Hashes for dimod-0.10.8-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be326901984f9ca7854cb70e15c05cf00e1bbb7ea1baa51f49c1b4cfdfda1573 |
|
MD5 | 5b702e6afc8ca448e95c18b7e3e683a5 |
|
BLAKE2b-256 | 0526ba63bbd38c298ee9b5cb36f7d03daed2bf7bffcba1de72c6d60dffb11ad8 |
Hashes for dimod-0.10.8-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 232563ee291be3475d040ebafda79391b33596c4144ab30eecdc3eabee42aea1 |
|
MD5 | d0aadc330021dc075694b170cc166ac6 |
|
BLAKE2b-256 | 0c5483c6323e70767aff70f1d232fe46a0459ce1d3ddfb721135f5b30dbc1a67 |
Hashes for dimod-0.10.8-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 958610aad47b7509bcd1370298eafa9a3bc548f6adcf6c7f3acf777e8a64a866 |
|
MD5 | 0c4fdcd5b5b90c36a4df1bbdbd549693 |
|
BLAKE2b-256 | 469d8bf3c7984c84a5b94706c6d1407075ad552f0899e690904ce397b11035ed |
Hashes for dimod-0.10.8-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e4756792e7f2d677abf5ab557f16ea8e6f43ae7a4877c9477084204fbc6e9c7 |
|
MD5 | 59ee6f56bfe9a2cbbb7b87d7ab8f5349 |
|
BLAKE2b-256 | 04619969dd2c0e52cccf215a88d296e4cf74a20b10f1a4a7b76800a81be595cb |
Hashes for dimod-0.10.8-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c18be8000af537c24e03ab6879c6839213a8e7a1b3225815b868ad2b9f1c85c0 |
|
MD5 | 05ee8f49c1a9bedd9595770676fdec04 |
|
BLAKE2b-256 | f497803ff6e5dbb589666b887b1a5fcb73ae3963707f7e7a25bb3adf204c1036 |
Hashes for dimod-0.10.8-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7105e2b2bfcc3fb3b60dff8d91c75907ea3357f5de25ae948bed9281276824ac |
|
MD5 | 657387b185de174fca585c295f8b20a3 |
|
BLAKE2b-256 | fb4a176e497fa2fd1c631f5125224bb1c9b7079a0dbb4cc26955090666815795 |
Hashes for dimod-0.10.8-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5aac9cbd94a84fa9ad344633c1ab3426691bd296a2294278e1a02e5af8f7139 |
|
MD5 | bbb40fc303adee81fb3e66c50ea9dfa1 |
|
BLAKE2b-256 | 4012b70a3d37264686e5ce39c9663bcb716f1833460dd526d7340392a1c62c94 |
Hashes for dimod-0.10.8-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7ecc551092a1471fd5ed8c2b7638ce0d4c69b5e5d1b65007d7327b62d097127 |
|
MD5 | f1c3492ed9c0267ca116da352da5250e |
|
BLAKE2b-256 | 0b19ae70c123f2d00eb2f0cd1911e1b6d27767bdb8256918428f1ecd1f49d395 |
Hashes for dimod-0.10.8-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7583ef3134b2acf56f3960bc1c000f7dc09ef97c6b1e5ab4badd6eafc6834d79 |
|
MD5 | 6269d1dba6f95d427cc22d6d1c2ef143 |
|
BLAKE2b-256 | 818b1285234e69ce9f986c00f0f5d2a552c808f2790d41a1674a5a79b96c0f05 |
Hashes for dimod-0.10.8-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a18b709dcae838d15f43fd38e2022a1a71fbf5a856b9af469cefac3c99db1be |
|
MD5 | 8fea8f300f5b524b545126c3fa78a3a2 |
|
BLAKE2b-256 | 992f19e87d225a87c5c06db975432365dd975350ee6a250d72cc7d43d6f8dfe4 |
Hashes for dimod-0.10.8-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71491808c7780c6af075e7bd8acee74ed1bf919c1f6476f4d6a46e09029655e4 |
|
MD5 | d5adc7546175548df385879cc5ab5e4a |
|
BLAKE2b-256 | 47d80f05fc40c19e58a805ffa9c4b04a5046d11bac1f66364d6d9fd53a81fc0a |
Hashes for dimod-0.10.8-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76c3f121e0de131700ccdf3c47f4675032a7de216ab9f78b93482f0f2c2625ca |
|
MD5 | 83e89a921fb994054a0e0de400344da1 |
|
BLAKE2b-256 | e1014d15acc48c1c9862950349eb789b2909b1fd9f94dda9b0dc38d56a75ccdd |
Hashes for dimod-0.10.8-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7a372ca2be62da6a076fdb1165f626b59efb8144b48e053f87ba07fa867e05d |
|
MD5 | 10011d56735b7a959bdc16bf4a81ab17 |
|
BLAKE2b-256 | 80e99434992ccb4aa2c69d53bd1512549adf79b601e9065bb4060b68c94b5e00 |
Hashes for dimod-0.10.8-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0524dc0ef6762fd08ef642b3e33d25a7d3a13826a4e96bd7d62516bfc10a806 |
|
MD5 | d0c277ed045720160e25180a616ea59a |
|
BLAKE2b-256 | de9ab070c6dabce563964cd2ed18179ca2e0b675eaf7175c4cf66aa30189d3e7 |
Hashes for dimod-0.10.8-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4ea0af190551ca4a9c96896943736cf1b968e1bf710b454efbbf90cb020c176 |
|
MD5 | 01f57cac96c35e0f3477f8bec118800d |
|
BLAKE2b-256 | 8710878e518297686d5d097ee61bfb6883214e310b65f7ff4b0a85337880b847 |
Hashes for dimod-0.10.8-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9296ba4a12402ed79fb5718fe2d9636a2b82992977b48e1b5ed98d7dab50e45a |
|
MD5 | 1ec3f95faac182bf51344feebbf7111d |
|
BLAKE2b-256 | df195db117f3da0c20d4383c39746533d1daee9b3b2f9bdf10ad13bab9f2d6b2 |
Hashes for dimod-0.10.8-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 200d9230a0a006c8023f945331dfc86340590d1e0d333da366291568c1c9518b |
|
MD5 | fc10b2efc2e74f2083d6e25b7906ab83 |
|
BLAKE2b-256 | 7c1b8bec3597bfad4d3a758c97b6e4fd312d784ccba1136bbe01b2ad7a877474 |
Hashes for dimod-0.10.8-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed0faa85162b875b52a955841ac3fa08216e75d901f656be61f8ba10e1a9d10d |
|
MD5 | 373c836c015495e7359192c02019f7d6 |
|
BLAKE2b-256 | f931821c774eaa4f5626a9c58603fac1b8bbe7dc5fd65c92a33b6c740e39d28d |
Hashes for dimod-0.10.8-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a727eeb7b95b945eb4ba7ff6179e5663f42d0a55983d1c02a17329d47a444e4a |
|
MD5 | b185b73900dfe4f34944c863435b681a |
|
BLAKE2b-256 | 19162e8d7ec77375bc3681a6d6066fa6eb2a1a6b44980408f842a9b924f4ea3a |
Hashes for dimod-0.10.8-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de1bdad5b2ef3c001831a8a7643c8d59c619bdc75158aff48f3f0d6c08520a26 |
|
MD5 | 9fcd729cbbe69da49d7b40ea757e5063 |
|
BLAKE2b-256 | 3808a3897a4042881fee09429be004bcc37a3f12e994bf7726a64fb6caac1b1c |
Hashes for dimod-0.10.8-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e087fd0b425d2535a16b0b3b139033aeb4cde5eb25e7abbed4fb2a6d45d993a6 |
|
MD5 | 84e6ae1118a18814e9ed101879495e2a |
|
BLAKE2b-256 | 09fdbe92f6cfdfc5b0d2a57e0a9c9065e26a13600bbaeb7897d46716c642d47f |