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.dev7-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58a176dff7001e46587228cd68313b84a5a5515f13931fa239aff3ddd6008132 |
|
MD5 | 614fddd05649b7100ef69104ec8c0164 |
|
BLAKE2b-256 | b8fbdead764e50177d1e0054b1a6b167442fd0260895edc64d1aa5162dc32d0d |
Hashes for dimod-0.10.0.dev7-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e42202824e33372434d957c2f4e8a6c7cb71eac6153368a28147cc5b594dc286 |
|
MD5 | 038508af3b9f13450cee868a4d169df2 |
|
BLAKE2b-256 | 79ab1f6a7abb9ffa4f3aee788b59863608dd1af9718594de0996952aae26cb26 |
Hashes for dimod-0.10.0.dev7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 221453276dc667c3c64f95c6633341d5d32745eb55ddceb9283336e5b0c75af0 |
|
MD5 | ce15e9fb6c0e0fb8649827f5c7bfa4d5 |
|
BLAKE2b-256 | 6fe4347bc4232d0162d32b7065e52521cdf7e7a79762e207eade807fa8b1c683 |
Hashes for dimod-0.10.0.dev7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 977529ac82ef665d71044e82f54e25023b49c7e4eca0a3a385d2a29d7e81f6b0 |
|
MD5 | 89dd1f64638d8f5f9929f66df8c0ffda |
|
BLAKE2b-256 | 383ed95c2d0de19858247ccd52e87d299bd9cb7e3894a9cdbbfcc543638987e3 |
Hashes for dimod-0.10.0.dev7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e48314f65350b5bc98249ae0ef8298c87172ab8299c970d17ee90e1206b7f75 |
|
MD5 | 902dac1dbce35b7a5dad9411edb08ac3 |
|
BLAKE2b-256 | 9a367b62b182976db67b2fcb52c6af44b9ae9f04af97ed20138cae006484677d |
Hashes for dimod-0.10.0.dev7-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 098fa300f8803ecbb0c20d75c9a9ceee6e700e24dd8431bcc96889e3e04a63ca |
|
MD5 | 47be40489fead20d89f61b2214eef1d2 |
|
BLAKE2b-256 | f4bbbc2c57863e009b4a9ff92b06e1392515cdd32480b68b343344b3cab51f17 |
Hashes for dimod-0.10.0.dev7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8757e34907d0978c65f1e0b3c0622ee25ddbe52029e40940bcc1252fc5467f09 |
|
MD5 | 178eeaf3b8d4401e23a1ad04e12e41b5 |
|
BLAKE2b-256 | 30297f3db7f5639748fd480c03bdf1b42f778d59b5f461ad0e619acb9ef5c8f4 |
Hashes for dimod-0.10.0.dev7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc5374b1b61716721702db7db63c733700615ef5d83f004ae78297a1f308d142 |
|
MD5 | f0d94cb14cc831757dbfbfd066e68eb4 |
|
BLAKE2b-256 | 80cd2a5f35369c2910ceb16b7aa85a480bfc456829b2792a1399cd9f9ab38985 |
Hashes for dimod-0.10.0.dev7-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94ef6ad3eea61736291215e384200bdf7b7b271897613f63b0c7662744a1e562 |
|
MD5 | f7605641aef99265cdc99045af640c97 |
|
BLAKE2b-256 | 056e6c4e237a75e2e2f78f9fb19c8d26de8a4dd6b20c6c06ba93c266cda7bd48 |
Hashes for dimod-0.10.0.dev7-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28b188984c1a065f4a9bb422854bf325ebbcdfdd652a7864dbb59b5a980d5f69 |
|
MD5 | d314f2e242d85918ec49f9cdcb38975a |
|
BLAKE2b-256 | c93466616e17bb877adadfc07697e467085a279e225f74061048d13a668caa25 |
Hashes for dimod-0.10.0.dev7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35963f376ffb6a482987f9ef8dd68b2ad36b349e4766cba5cd18c097c75f0b46 |
|
MD5 | 9d05993ed92cd091d2a4809e27e5a780 |
|
BLAKE2b-256 | a24b211643c58d2245fd4d3eb528a9c3210e740f657a76ee67b7f6e3ec898e43 |
Hashes for dimod-0.10.0.dev7-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02a1470b8df5223722deae748507406039a6e844f8787dd90618c0397384d31d |
|
MD5 | b9133ca5a935fc87d9a086e9afbc0991 |
|
BLAKE2b-256 | 1d13ca0e379eb73e55554609343ca9c68c0879554f8b7c01f13d3ad4c53fa176 |
Hashes for dimod-0.10.0.dev7-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2a88b64f390777f7304653e45929025bd1df122384084184e1cdefe4c48aec4 |
|
MD5 | 3b0b83bbd6b2cffcfc215e39260ba107 |
|
BLAKE2b-256 | 5c6bb7c11adab8073349cd3d46e98f515a6f6e5a1c03e5c3921640ddac401ec5 |
Hashes for dimod-0.10.0.dev7-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 472c27bfc8e165dc74a2387d10cb243e773f68a8488ba6b51435ed43fb018939 |
|
MD5 | 596fbc62c3154fa9e4011ca00dd56c5a |
|
BLAKE2b-256 | 5e15d15fe179f67b22937fdcd152b6aaa9d4c2381f0e9adfd551d9ad5337b68a |
Hashes for dimod-0.10.0.dev7-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41fae9dad468a28a3a9f0d4ae5e957d12438be4f4c43d26520260eb24b812696 |
|
MD5 | 0df36d4a11259d52b18e336c65c4b285 |
|
BLAKE2b-256 | 7bd61fa17acede3931a1715f4cb51be2c2b3ba0049315de6baa895470377d6e9 |
Hashes for dimod-0.10.0.dev7-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fc2be034968f23fa8253558601ed4c1f0f59c400d29e30b8ad955a77b53c287 |
|
MD5 | 7dc232e5d73e214f51e41e715d11deb1 |
|
BLAKE2b-256 | 5297846c0fe62a0b93d5271553f61b2c08c1e161a0d438926587070f8d22c3a0 |