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.11-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0cdfe6d22a172d66af1645313f1b9a1d77e861186e48d8ede5863306f20dbef |
|
MD5 | 06da8a704bac0a6f7dc80ebb66840b21 |
|
BLAKE2b-256 | 5cddd37d668e93bc9eb6c35b6758df23790fa19330ec3d355a8a63b1077431c7 |
Hashes for dimod-0.10.11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7221371ae23db7ff0eacc5192b8d0308ed5dc95ebedc9db970b7d78334a84d5e |
|
MD5 | 2c0980de8bdb94305bbfe0ac066b2e15 |
|
BLAKE2b-256 | ec54ff36f4a1c44bc026a4d47ae2e9b3de8f2cb66825f0709505ca9d6540ebe0 |
Hashes for dimod-0.10.11-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4dd5f6786b3b6335146448abf67545edba0f25f279cdd8f6f9da561a0ce8a81 |
|
MD5 | 5fbeaaad7a4ae52277cc576403f00440 |
|
BLAKE2b-256 | ac0616ca68469fa5b5ba8de110f726db2786b0ae87b468f2c0b893e8976c0a1d |
Hashes for dimod-0.10.11-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af3a7cd02e5d1ad4d13380b8ddb4f4aa2a4663364997fbcf97334d0747134701 |
|
MD5 | b4de9158a5313918924969c0b3045d43 |
|
BLAKE2b-256 | 1c637c6a7f1562ac2499dcd4e4bcfdd9ec5bcdcc9c8fbb718ae329b2d29637a7 |
Hashes for dimod-0.10.11-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08e42599c2a8373b9ffeb0698cf7818c46f6274ad18d4bcf0f7b3ff594f5fe1c |
|
MD5 | 7d4236d287322a5383d8f9154f7817ac |
|
BLAKE2b-256 | f0b9c820c9d2d0e39693706a5e9ecc07caa447c2b8d537438692821442690365 |
Hashes for dimod-0.10.11-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03756dfadcccd87291a2ae66f2720d7a8b31cb786007a3ffe26f4ddd058afecf |
|
MD5 | f980ce2000672e81b6a7c0ae26db3e43 |
|
BLAKE2b-256 | f7b3d801120dd6e5dbd517cae41b377cf7291c81112e85b17365324f1c7b4ba7 |
Hashes for dimod-0.10.11-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d77209ae5cdccfc8d08b00f1c1d80fa694468a37779e109a812f3c0dc84af877 |
|
MD5 | 211a38d93fe3d72200363754ce7b5f45 |
|
BLAKE2b-256 | 206b73627ee569b5499a59248c9d782084981f4904942579081263654fc5f437 |
Hashes for dimod-0.10.11-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d91a82780c4cc62c3c8bdfe73652ea1a3796f5252117bd1f134eaa775e18f68b |
|
MD5 | 3904574fb402efbd29e8c3cc35724c28 |
|
BLAKE2b-256 | 4e78d2d225d14cbf8ec7dac5f48f2f0d56c59c2a4638b41fb0844f67c80f27c6 |
Hashes for dimod-0.10.11-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9cacd2872225b0fd62d70c70d1ab42981637c31b42289679963103cb0288a5b |
|
MD5 | c85a480481d00afca4bec7220dbd8f1a |
|
BLAKE2b-256 | c25aa8610056db46c56367359b3ac0fc796948805b2e8cdddab936ef631dcc3c |
Hashes for dimod-0.10.11-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b64f77777b3d06577686e6a2f96fad03c17499748d77cf5f1d4573a301b49d12 |
|
MD5 | 470b9618ed196aaf46c2fbacadc3c066 |
|
BLAKE2b-256 | 516800d6d94f288832567481983b8e18ceddc247d67dcd214dae3a8ec445a5f5 |
Hashes for dimod-0.10.11-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd16013b94305fb15ba091a8a36ad3ec3b4070a5194da7a3d3fb5ba2044f216c |
|
MD5 | 545751363875dd19cdc5d864bc084e91 |
|
BLAKE2b-256 | 408fbbffd70725bafbd4e0572826af54b91aaf6e78241ac89423a748219e140e |
Hashes for dimod-0.10.11-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6e019269d8506dc8f873416bc3463354fd80f2f6c38d500af00e0afee12deff |
|
MD5 | c41fc5bd58724a15bf407d850e832479 |
|
BLAKE2b-256 | 22c421a70e3d951c63997bf9701f75763b504624036a99f672c3bf34b38891db |
Hashes for dimod-0.10.11-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca67117e86a68d9d9ad231de5e4df20cba9695d5f180c3ddc328d14bac036da8 |
|
MD5 | 8e4ecadd5e2cbabf8e232ff4271ebf68 |
|
BLAKE2b-256 | 43665ba4900d77cddb95117b043e0290fdccda1eef21379f4311b32f4c465745 |
Hashes for dimod-0.10.11-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87a063f1ce3ce9e8d8a1bfc489f2591dba635821737d0bc7d33a43b2e91a7c27 |
|
MD5 | 61e9a9f0e9aab7c202c1fd5f6302eb4e |
|
BLAKE2b-256 | 6381879246f8bb36ab09be7117b4d935d0289472f8c2ee0a5fe4aa0f8282f727 |
Hashes for dimod-0.10.11-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dca35f4f3211d249fcda1366bf3d50e4f1b9ae5b76a2cee5c0934857aef6468 |
|
MD5 | 809b175d7f969e4e0ef958e6783d99dd |
|
BLAKE2b-256 | 0d1131f35434dc6c6a15cef0f8d05ab1b95375e80ab09d8c6f963dce28c6de6b |
Hashes for dimod-0.10.11-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6c91f61ce9559587ec76826365446705f314b47674017e3f4d57a0dd4162d53 |
|
MD5 | 485215f1ca4e26fd627659a7f6d61171 |
|
BLAKE2b-256 | d73637580a8da1a733feb1dc7891e4cc942c982dd5663e91e1cb1c3a48d96d4a |
Hashes for dimod-0.10.11-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9016c70b4178d7f9f31521ea0c33fbedebb440a90e63c9b9380e766e1bcc7a35 |
|
MD5 | f655a47a205d49c76edfeba474affbf7 |
|
BLAKE2b-256 | 6545dccd24dd30155b9d880745f5c00788f76bfa52bfdba7d337cbb9e927c633 |
Hashes for dimod-0.10.11-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4af0cd050ce126c4079271086ff1a037af339dcd399249c4f7ed77cd6df8dc67 |
|
MD5 | 899d3b57691cf663832774efae0911d6 |
|
BLAKE2b-256 | 52504dc08bbabc5ccc1edcffe469b833d3c7e9ff7af1b450d558fc7e380118e7 |
Hashes for dimod-0.10.11-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a7316d96125caa397d12fef54c1234b2e102ab9db802ca354f782e9e1779485 |
|
MD5 | eb979ccfc5c7192841cca1de4cd97149 |
|
BLAKE2b-256 | 16a0929720071c37b0916ae2240c7e7af78f0346f086ef4928eff0f91349e810 |