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.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e05461908e6ca7096ee0053a7af5854978ae8afd6e1cb943cb86cc9d1c40add |
|
MD5 | bd326b3b2b541b77e59e23bd24c9fa15 |
|
BLAKE2b-256 | 963a76a8f8312d163e881e17796eb4157ec789b9cb3c08276f3cd4d4fba288ba |
Hashes for dimod-0.10.3-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 770be14b342f4cd3b58174b66ca7e90a28f1b0b1d61c09a95fb8d41635a28811 |
|
MD5 | dc5b6d2eb00ab27f37ec42a140c283ef |
|
BLAKE2b-256 | 0d5834d0a780c1693bbeaf195fefda044017d0458d208b03bb833656c1ee2c38 |
Hashes for dimod-0.10.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e8cbd0508d6736d66a9226067b8904af4e133dc13b0a3ad50940d24a1c1c192 |
|
MD5 | 471a17b8418271d34fff37e2d920903d |
|
BLAKE2b-256 | a3f684bde95035c506b51814ae4a2aed32dbe3c1ad1d549c91ae33bc54884377 |
Hashes for dimod-0.10.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 306b9bf8994eb7fd5c1817eb29c1cdca74ffe016320a1c629d6c76b55876ad0c |
|
MD5 | 3315257af6c907cbdaea7f108c77e8dd |
|
BLAKE2b-256 | f4baf0924704b6cf0c7b27b48cd062493d133bec8fe982ffe3e5ca18b7eb49fd |
Hashes for dimod-0.10.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6eb61d74d27c6f1d9a3e5ed33d4e7ce68096fdaf647f409af5f8047988155ab |
|
MD5 | f3774604e180b9ba6c8222a3590ad577 |
|
BLAKE2b-256 | 7dd56c0dace7bd8f7dac39d903d77231a48ae60c2ba43f08ef966b1fc1645911 |
Hashes for dimod-0.10.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d233d9f9a1982cddcaa9c477669c02570cb9638f77a87d6cfd42c94fba5a229c |
|
MD5 | 1ece79842c236b5a988f5fdb284a973e |
|
BLAKE2b-256 | e7cdc5600a129f672e66721c9ccb187797b9d1cdd23fbf172607b16bbee61714 |
Hashes for dimod-0.10.3-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0aaaaa8fff9609c05177e026a101ce1bb4b5f33daceb89b86d705ba41fcb6a17 |
|
MD5 | 1efa3f7ccbb1148db1b78ee3b55b32bb |
|
BLAKE2b-256 | 0881cefe6b7fa1c39ad3b4a43058f34f6a6094208b6a6896bcee663abf6eddce |
Hashes for dimod-0.10.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ecb8309cec99c4f517df2100bc8d24bdd66df0c3f97cf07af9a18d74042b999 |
|
MD5 | bbab99ece6878b1103f86be169873baf |
|
BLAKE2b-256 | 2b937a138a51b67de65b874307531a7e8da68163abce3e8a0a39094ca0cf3a9a |
Hashes for dimod-0.10.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a20cc4f00b0f87d1097da66a646b2d89bbea2a647be26c6aaaba3e077fbd72f |
|
MD5 | 01e91c3f35fd3e7dd954f6107ad03bcc |
|
BLAKE2b-256 | 624b94eff42d738f6f0351d44cbb5ef320e846b39360c4047dedacf9d4607ddc |
Hashes for dimod-0.10.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 994ba3a58054959f60ac2ea4f0c93e2962ec13bdb33eb670845813394df086c3 |
|
MD5 | e5db1bc7ff5bf61ae8fcae8baa0602e0 |
|
BLAKE2b-256 | 6740a7b3417367c968f22e2e7140f8c3e93b038369b83fd6787963943c7fc482 |
Hashes for dimod-0.10.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4597c56161b7ad8bd6191cc7fcccc9c2198dca1c6f8060b1f173ccb848c487c7 |
|
MD5 | b4b0918bf99cf3968aa42a778863f998 |
|
BLAKE2b-256 | abfe80fee6e37e1b04931cd359cb24a4f69755874a4e4a081ab4570dd727134f |
Hashes for dimod-0.10.3-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03016651d8255deee70aa7df39da1fe87b4b3274016ef036f133b8ba7174ac9e |
|
MD5 | cf9e8d3cea274f61a89fec504e49c6fd |
|
BLAKE2b-256 | 470f1bf36506a82f3e2dff36961c024ad43cd42961a92181268c473492949745 |
Hashes for dimod-0.10.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0913b06e45ed24d13606991b29a22aecc557a7a469a33a49bf5e285a2ca5176c |
|
MD5 | bfb095d1c15f5f50f5d5332fa06ec7ac |
|
BLAKE2b-256 | 4bfd55476a64f6f1eee10bd3394fa9f8343158c5d31b0b5b68364da74dfb4fab |
Hashes for dimod-0.10.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb369ad118a8facdcf60ce85f1987cccfbc95fdb821a3cd558f99fc85c7e5424 |
|
MD5 | 7446da8452d9a2224590bd89477da0ce |
|
BLAKE2b-256 | b7a473bf511b6060c1efe776ee1353ab0ddde17fa09a295b8c2fbceb450e75c9 |
Hashes for dimod-0.10.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4f48f8a3ebd558c4fc1185296b97fe8d76bba331c06e9aedc6c548a07c41900 |
|
MD5 | 4cd7a8f63c1582e2f6e647c56108195b |
|
BLAKE2b-256 | 43a72018c6e08d40aeb8744f81a97ed69fb104423bac95d2a009a4d168663137 |
Hashes for dimod-0.10.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9adad6cb8939ae90322df705a6792615dba96ea55ea030a5d90cfd588e6e47d |
|
MD5 | adb9bfd3455f14dcba8c4215251391d0 |
|
BLAKE2b-256 | 593960fb136332dd9b4b3a5e835582bf3888979d802017d4da98239d2f5e3d0a |
Hashes for dimod-0.10.3-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c63b60fb8f8e1402e2de96d5279a842a7d5896c453fb3cc6b75835999e9c914f |
|
MD5 | f727b00e412877dbc8d1bc0d362f305f |
|
BLAKE2b-256 | e55c97a6650a5cf263657ded7832a615c8fcd3505112c58124bc6d400506ac36 |
Hashes for dimod-0.10.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b68e26cc50aaf41bf973c1019117ca18189ed37f836889f4b85da4810fa9f169 |
|
MD5 | 088d4dbac4294a023e1c0a1dc5a82945 |
|
BLAKE2b-256 | 3be5ac2b64d513b0dfbf79f7d77ee28ad4c6461de4380304e2ac5110c461d0b3 |
Hashes for dimod-0.10.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 132e9566a93849b639f003113c000cd5ab312aec2954a010e8ca8819ff1f807b |
|
MD5 | d762514fc450210dddb3958c26149079 |
|
BLAKE2b-256 | ae68d35a2188ff8f09024a51a223383702fd76c596b605cb0533838c857c8d44 |
Hashes for dimod-0.10.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 131b5ba642b60bab60c4062ca751e62b36635484e4935720653a6a3067db3b72 |
|
MD5 | 59a6bbefbc850bab7ca187020edebee1 |
|
BLAKE2b-256 | 82429695703afcd6f744065fca6d8fad18da8e1f87140e8c28a3812e02b9fefb |