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.11.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b5800601c63871d7366f3ddf4507a0f076ad2231c4dd2b3af0fe0ea305d1f24 |
|
MD5 | 6287088a0f8064c88663c70c61605c78 |
|
BLAKE2b-256 | f3e234d64556f4aaac85cf794c0289b8d41c948478b4c797974680d07a15aaf1 |
Hashes for dimod-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 237c42f4a5b71ebd9c7fd26d813ab8286d0c076f6f718f338b5936aa9bb1be04 |
|
MD5 | 0eb83327173d577648aef58955b99605 |
|
BLAKE2b-256 | 2d24a5ec80b198ced99d09bbfca5b7f9cc1d353a56bcf27584cc5474b55a1bbd |
Hashes for dimod-0.11.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 178969ebfd503fdcac167f17a548637b092a051e4fa29f04e85d8928080d4d92 |
|
MD5 | d5b2dfb36a5065afc648c0a98789f11c |
|
BLAKE2b-256 | 1b2dec027e566b44e08e744d87ee87181be614e2d7d9a96357346b462a95c1cf |
Hashes for dimod-0.11.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76b2b3a74517ca8272f1b71897b69c5caf18f25a5ddd091aeddf58136a9ecf1d |
|
MD5 | 56e76c569993a6ca2a595e7e8aa69e82 |
|
BLAKE2b-256 | d769d61761ef66e5428c45d8fbe54daf89632a15784e2a8318111b37102ce8be |
Hashes for dimod-0.11.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9da486d478f6eab6b508fd2c84c033b1769ae7ab95e35bf8b6014a732ff40111 |
|
MD5 | 6663f25a5914cbab2d75158ed87ca0eb |
|
BLAKE2b-256 | 51c11ba5d50958e5f15b78c1df8dd6de249163c9305ff801fbc16b72bfdb9357 |
Hashes for dimod-0.11.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15eb740fcc9a9a709acf2bb9b6f28f3fb32330ebb4161ea563f7c6c6950eed99 |
|
MD5 | 509afae6d0f85428a04095a57cdad770 |
|
BLAKE2b-256 | 5701a79e15050d47f751bf75c999f8de3ac47b50fa0af185deede1c66e3d98e7 |
Hashes for dimod-0.11.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c022273e03118a2b8217380a0aaacd55afa93e4d4a8ec2eed4fa6ae2a082c904 |
|
MD5 | 74e5a467920e789c7ca57e2035689cde |
|
BLAKE2b-256 | fbef3f3f420bd2e3bbb67485dac4c1a692c11d5976d5ff29a44d7da2e05a10cc |
Hashes for dimod-0.11.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78a217b2472e8cad06473824f187dbb7add13d06fc5405c4372f41b6fa9734dd |
|
MD5 | 60ad041e248b102be12865e69536cee8 |
|
BLAKE2b-256 | 8aa051da6e8d743868e462cf83d855f8b4dd02c4908ec68ffd4fd74d13cda082 |
Hashes for dimod-0.11.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6909e9d8744e4c6cdd2a391900575b09b9f65711888021cfe77dfa258fc668c9 |
|
MD5 | d15d1d55ba240e8826ed3bff0674fcd9 |
|
BLAKE2b-256 | 2f91d5fe3eeba2a831ca402e634b5186e600ca9dabd2eb42d06d7cf66026a095 |
Hashes for dimod-0.11.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c116423174f81d68df2df42f41a6b0666353c893f7944e0a934d6b2c73427fc |
|
MD5 | bba415f69a5ac5586719ca1ec558f9dc |
|
BLAKE2b-256 | 7f1c898fa3b77fa0d246409856d04a69d928fd786f06d611c9fb29a81ff268ab |
Hashes for dimod-0.11.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55830a7c0a178728680049ecc899d0d9140d0a12dc19e6330a949e61efcee29a |
|
MD5 | 99ce51d796f62cc8bf73fb5f5829f34a |
|
BLAKE2b-256 | 1053742f97b1e43be094a36d0a17982e662d59800ac0ea69e0a6b71a59a50f8f |
Hashes for dimod-0.11.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c223b18ecf250efe19855e3ed58efabc02bf52e99f62029a9a54aa973507c96 |
|
MD5 | bad8543fd4812723f01021587c8bfc61 |
|
BLAKE2b-256 | 87f69649ababe8f68f6e668775a59c697ebaa2132976079121bbfff36ea5fe09 |
Hashes for dimod-0.11.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e81fe108cb105152a220ff2265dafca666f4787d806e1094a4297f711b0fd0fc |
|
MD5 | e01efb818f1ba50529778fcc517feaab |
|
BLAKE2b-256 | 93ae03e0e8906fbc988954bc9d60d324d66b3beffbfc07298567755948a446aa |
Hashes for dimod-0.11.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a24c1778f5a8f1134157c55a49e20a8635123cf34c2add93dc4fb64bcb4f928 |
|
MD5 | 6e3c61e0fa913c4ccc93e83b3de6fabd |
|
BLAKE2b-256 | ed5609a449fc35997c6afdf42fe8641725078a280bcad9386e5b25d0f798c6e0 |
Hashes for dimod-0.11.0-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c3298ace23faea1c50384a1340ff4b365e71b804e7bdb7d081d85d65e3d5149 |
|
MD5 | 6e36c581bd3b397c3286eff01367f9b9 |
|
BLAKE2b-256 | 99e00d4d96e5dc59d4258a68aface0ed10555e3276091438a6d03317648d7c88 |
Hashes for dimod-0.11.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 007e8a5fcffe1655a7c89d9a98e44b1986750541131d2f23d64c3132a19b5417 |
|
MD5 | a1b768b003ff5a7bbeffd03af64466e1 |
|
BLAKE2b-256 | 2fd1ec2bfe6c64892ad1674f87100857880b8f5e7eb509492f54fe4369273feb |
Hashes for dimod-0.11.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf1965bbdd1d4054e1c61fc8a88cdad640be9385299e877714d779a5fefd3560 |
|
MD5 | 1e35d521fbf8302e479ea69fb24be427 |
|
BLAKE2b-256 | bc66153f5424f39cdf82bd396872835c50fceb780aa9ba23a1915a8603533be3 |
Hashes for dimod-0.11.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3602032c8e16928c3e254bdf14593b0fe8bbd87eb7fd3faf24397b26e42e2c59 |
|
MD5 | f56f9c469203334af3348e0acc8149c6 |
|
BLAKE2b-256 | 2656b471869165400a2d285a6415b5bff52eba702c44d50144447eb94400aed2 |
Hashes for dimod-0.11.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb7661b03375101505d081881d5186bdd3346eefce6b873d145ed93eec3ce93b |
|
MD5 | e7daf90129e9f7e60dd595f585f09d28 |
|
BLAKE2b-256 | 1af404865a45004b9316bf06dbc90d0ee4b8595c92c78fc3de07d06d21c767c2 |