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.0.dev8-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2542ea599df40cafd4c00491e3e92c25658af372c5fdb05a00ad294f760a7603 |
|
MD5 | eb28f299f667973c30f0a5450027cc7a |
|
BLAKE2b-256 | 942607b842bbd58d8c817e55d2cd65f8a8625c388a88890b9bd17627c354bcf6 |
Hashes for dimod-0.10.0.dev8-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16aa055ef5eb037beed2d23b49c16a62b1009e32e524c6739b21f2bb754e29fb |
|
MD5 | 8e4ff31ecb892cb6e0401fa32557cace |
|
BLAKE2b-256 | be7e99b2001776ffb1794fe8ff8906a25a50c4034e69a4732ae552d9776fca6b |
Hashes for dimod-0.10.0.dev8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae2e338e6e5d45af573d382f05eb74e3850bbca1ec3aa0ec860885dcbe7e9cbf |
|
MD5 | b4ac09272a6573ff3b8f0b6e1084460f |
|
BLAKE2b-256 | 87ba1f37242b883464b33be475ad12f347d69881b42b2a440886d216c2013cab |
Hashes for dimod-0.10.0.dev8-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dea52659cfe66305f328f53dc1c312260a7c91db96e8debe771f2d94dce8bdbe |
|
MD5 | 604144872a685ec5962acc1691b324fd |
|
BLAKE2b-256 | 27a1799d9c3c045a6d25b3db5343be0d4fe01859ba3e3b5572c224f584210170 |
Hashes for dimod-0.10.0.dev8-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d55fd8845354fed3c2551d263af764cc09431c6d0fd62d8358f5ae6d77bb23a9 |
|
MD5 | e767e7ac75a229b1f5ecd943967990b2 |
|
BLAKE2b-256 | 054416c51d1d4da0c4eae6e3954463116d7c12e3fd16fb373669ae437551cfd9 |
Hashes for dimod-0.10.0.dev8-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 982469cfe9bafbeae6081e3212d5d237a3d700d2219a3a0c57aab0e46f6df963 |
|
MD5 | 353fc26d8a53d22b8e49fa0333907710 |
|
BLAKE2b-256 | 4afd0c41d3b1c4909839fefc74f7376f996c254c01fdbd61e07bac1c8185bdb6 |
Hashes for dimod-0.10.0.dev8-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dce34c223b0c8aba1a914ed004996d50456f407c20d388d19c9d809905d68162 |
|
MD5 | 8608f75e34ed96622db1c680bd5d7481 |
|
BLAKE2b-256 | 7a01c093c190e254a44fb0027c7cae3c119049b46d3541f075204ee3d7770657 |
Hashes for dimod-0.10.0.dev8-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40d5a714a89fb9227dae9ae13b9222f6079f431a9914346af809a053cd1aefda |
|
MD5 | 16480661fc5cd857e0faf78738013659 |
|
BLAKE2b-256 | d230ffb33b4bddd9a3d266510c078ea58c452330bbbd83151464f8230e6fe438 |
Hashes for dimod-0.10.0.dev8-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be704b3ec4bff8a6d3422a478ff0a1164977f9468ba8f55b908fc907fc3d77ff |
|
MD5 | f2394fc6523f865e832cc965968f17f0 |
|
BLAKE2b-256 | 943a17bd7468d090c2f8d16872ae5c480647adffa895c7ca0158df0092ff88cb |
Hashes for dimod-0.10.0.dev8-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19dc27d1d850884e250e35043885c52f4cee957d4b218a9f127d704766513c18 |
|
MD5 | 934099af3bc291cf29497fabb0b991b7 |
|
BLAKE2b-256 | 7fa5fa48a180db89e16d90fd079d3dd8f288d743913491426dd84d98fdea18aa |
Hashes for dimod-0.10.0.dev8-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e672b8aa26f3a8366237994551b1336ea40f2780e815bfa0c744fb54f2525f07 |
|
MD5 | 1ffb83e20072978cdfe1ecf78161b710 |
|
BLAKE2b-256 | b18e38004c17782828c6fd69592eda599da3a66f52bcde71bf174584e6ab61bd |
Hashes for dimod-0.10.0.dev8-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edf03ad625d2d8545ccd858e0f7e592fb6751b6f44e1721a3f77225f275cfc68 |
|
MD5 | 1f1170b4794b16d20bbce50eefa9710e |
|
BLAKE2b-256 | 16e867c33542acafe786947a5eb542f12f634534beb8918083da36977161b99b |
Hashes for dimod-0.10.0.dev8-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec0b76d076d748945c0f2d7c71bfca4898bad6b0d752f8078907a94bc9ee7271 |
|
MD5 | dc90fce2b1e19b4c57853cef8b31e762 |
|
BLAKE2b-256 | 3d9de9da6156eafec1900ef39c16114af3aa005d725def591a7b42ca075784ad |
Hashes for dimod-0.10.0.dev8-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 358c39a317ca94955ec667f6f13994f1601a06e8ab19153b14b59fe7be10a3b7 |
|
MD5 | b6faf7d5cce6217b023e81d08e007418 |
|
BLAKE2b-256 | acd7aec7a2803079b1eaa9ebb606b36d6f185db06237e99e28857a9712f7f195 |
Hashes for dimod-0.10.0.dev8-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 172d74ca27c6f0bb7cba07288717e26f09b46d07cf1de3ab88ea12bfa9aff7d3 |
|
MD5 | 603faa74cfca49e17dc3b1878dbc57f0 |
|
BLAKE2b-256 | 0f52803b72ee9f044e64a4167a6b8efb7483afad0265bff3be50603b33b20833 |
Hashes for dimod-0.10.0.dev8-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a26f19aa27bd0815f0c1378d25a2f13c499137eb88f067730758004b8d824a4 |
|
MD5 | 0e3b8719f418015377863cbaec4af5c5 |
|
BLAKE2b-256 | 07bcc0de836d0818e7c559088e9c496bb7c7544e2581c5d3c15fc17a96ed581d |