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.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07d3010a53510d4e52f911aeacbf47569ddee20c894a02ffccc707b2eb569ae1 |
|
MD5 | 245bf73aacff15c939a3f6d668d5bc56 |
|
BLAKE2b-256 | c6124b95af7b6b7f215e4fc52dd20a6254382962de6b79b32f023933b0439c64 |
Hashes for dimod-0.10.4-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cf2922f6b32af86a9d73ea75cda8139c924375d8eef3df532b2d1e6ace73e17 |
|
MD5 | 20a3f4599bcf2d0103000365336d2f27 |
|
BLAKE2b-256 | 0b24e3adff6a96a90cb24f66f077ddf977954646b4d27b8078080045b15a9867 |
Hashes for dimod-0.10.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7045d8d7e01d60c412ffb3da2fa189b5bb0825e4bd129d386765b865811a129c |
|
MD5 | 04fec93defad4789c55d1ba898ad168b |
|
BLAKE2b-256 | a948d859b79f970774c9a2b3b05ba5eb097a54239671024e49f4880871630063 |
Hashes for dimod-0.10.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acda29bab47fcdcefd39302142ee0dce806c9458bf51166c637385be34555d20 |
|
MD5 | 099906b307c935e6b39370b0d5883bb2 |
|
BLAKE2b-256 | 2b35ddfb327a35473d52d4ad382a9fd74a72858830457f3b4d9e1461495d8abc |
Hashes for dimod-0.10.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a691251241183803a5081baea6e93de725873ad60e0785721f928f4ae86e905a |
|
MD5 | a9c829dd109af488cc81e610b8d5738c |
|
BLAKE2b-256 | 976c5faca6175963c21d0da68f9243cfaeb490a038fe3622eefef86bccdb8e22 |
Hashes for dimod-0.10.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 190776bdaa22375dceaf11bf0bb988cca3ab8f5d9214948d732c76fccbafa5d0 |
|
MD5 | 8d8f39f54340ec58da7119d0b1ad5f3f |
|
BLAKE2b-256 | b212554123347e21cae86e9c60fd28b1b7c0e74880ebf4183dcedeeafe6293e8 |
Hashes for dimod-0.10.4-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 787e54685e7c2959d6fb6d44dd46ebe2266e406722c89ed2c83a49965f644996 |
|
MD5 | ef36d2cf758c0437d097408963818873 |
|
BLAKE2b-256 | 853fc4a02c097268a87348f946be275d0e09c1ba3265b9a4f7a74523b85bc61e |
Hashes for dimod-0.10.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e17207c3369b1b1333c989be04317b24e0ae702e59c90795493de8aa8b17fbf3 |
|
MD5 | 27d74c0fcc011c0110cd6e603ce18818 |
|
BLAKE2b-256 | 404ed8d9378ed3b609d79244186865724dd8635e9e4d92f03ea61484dd512fa2 |
Hashes for dimod-0.10.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dc97599665fcd8a69e09a53b09be5a68e46596237ecdc18e8637c5fe075ac87 |
|
MD5 | 42b0239736fd5b43f438af952fa3151c |
|
BLAKE2b-256 | 4363804ecf877cde1066122d98885d1e0db09e851c90f6005569b71b12350820 |
Hashes for dimod-0.10.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28a2f8741b484ee74dd77d8d998743dd9ac10bdb68a0002f92c9355bba57d8d2 |
|
MD5 | 650f18b57845339fc5ce29e1ce76e507 |
|
BLAKE2b-256 | ce38d385361426f66559b3b21b72d6a0e15b451a5224c0df89cf64644536193b |
Hashes for dimod-0.10.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 488a6c6582dfa746b9cc612b7c360d65a957b20a638f36aba6668dd9fc200c00 |
|
MD5 | 981501ee2c6200023a5423cdaf3abac6 |
|
BLAKE2b-256 | 471a535d862590b047fc0fd00aa220943a90096cacadccb0e01904f291987f5c |
Hashes for dimod-0.10.4-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 623a7df5070cc892c39374e74d3419de8d91094ff2338440de32c34f02d524a2 |
|
MD5 | a2bdb94568b39b61373c432be8345e4b |
|
BLAKE2b-256 | 93ca6fe918875567bf88b96d93789d365331dc096466af0530a6b2b5118fd24f |
Hashes for dimod-0.10.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ea9031e644585b7e9d2b5a88da57853171a5c672e4915b067b474d05ae81e9f |
|
MD5 | 577bf8a8892dc65e3f30e69e6479511e |
|
BLAKE2b-256 | 7998c46c737e623d2340833a0285a9c38941bec3ff0ea6d3c21902963f92d04b |
Hashes for dimod-0.10.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfb4cf51800803cb86547827ad17f1c59ebafb66a4bde301614c260b77e05108 |
|
MD5 | 3e6cce04c3ee5064e2be5c0caf770fe2 |
|
BLAKE2b-256 | ef9141a8513dabd4ac7cc775ab6a09d4ccfaa6be669e6f45ef8cbbdc5d85c10a |
Hashes for dimod-0.10.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f72c14cd9e6c6330a221a1a5943109f5a49dd93f9a797c92cbc7dfd7a70ca83 |
|
MD5 | 916eed2c55577ad0245a4d39348743cf |
|
BLAKE2b-256 | 31fa1c9408b2cf2c7361e26e56988cb706328ac62a73e132ce3c022b94571e67 |
Hashes for dimod-0.10.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2491d6334f36e1daf59926505ac3cf34175ff79080522593a562f2d8d8dfb881 |
|
MD5 | 4f350e107e626276061c8c0b78195c2b |
|
BLAKE2b-256 | 7e632bd22d04042da1fc4fdd3e79ab861241d49969f4827818aabd21c09d35e5 |
Hashes for dimod-0.10.4-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa0ff18fde828819c8905ae38c8c2dc4308554a7c68081da43c76758321beb4c |
|
MD5 | c4e25f2e969e0a95870efd67f08375a6 |
|
BLAKE2b-256 | b5c1ca41cf96688e80e2eead39fe290e0c67194ad6bae12330ac19bee523f04a |
Hashes for dimod-0.10.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84afcd59cd849eddf7ee051db0b48283240a345faa24fe4ae3292bf1a7c0b0d6 |
|
MD5 | 8749aaee08cb54e6d2b02d1923e1ef99 |
|
BLAKE2b-256 | 08acb006eeb0c8f7133bde92cae14f429d8072011f0d830334e133ea9b8acf45 |
Hashes for dimod-0.10.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f8e68667d25d55c76826ee2c8d48e27d51663d546622b8de6305b2d56ff1041 |
|
MD5 | fa70d996663055221c234a83cf58007e |
|
BLAKE2b-256 | b92e6574c37077f15b6461d5d5098f8f85af917305b0d648f54746982e99ef3c |
Hashes for dimod-0.10.4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53efebd52b50a4294bdeedd7f987bd5ef3b9d8b0133428360ff8cb5fd9afccac |
|
MD5 | 577a58d21568739b118ca8899b82484b |
|
BLAKE2b-256 | e9e04791f4a00bf1fefcacad11e6d9726c1b26622265368ffc9ad98d68af1e5b |