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-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc092bfa023b90a64708bbb32e7bb891a9196220496c35c7076481f3ecf6c4d6 |
|
MD5 | 184d07242d7b71edad57850ea2ba998e |
|
BLAKE2b-256 | 53524ad293730668ac229422a4946f32247c7845b433fae4efec744deebf98e8 |
Hashes for dimod-0.10.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c2c4848e2231c0cd99599e92ac22db390b67b2dff53de02aab8bbddc8c49387 |
|
MD5 | fc5ed0f79396ef6cd17464c481e73414 |
|
BLAKE2b-256 | 2bfdbff6880006ec7e3465f941b0ea4950149f50f3783beae514508b479b35d0 |
Hashes for dimod-0.10.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1f3a27f8b5057b9a16bc76679f1028d97b3f529a4928577910965cbf91faaab |
|
MD5 | e102099f5022cd7c068af091e3756547 |
|
BLAKE2b-256 | 5276eef9ed2018ef76878d5393f715f98b8c1c8389e690662b0dc8b3466c3b1c |
Hashes for dimod-0.10.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60af409ff1b440bd6e7d322305d50ff74f476d7aa2f92718c5f3e032a069df5e |
|
MD5 | 48b0470687f8614345bcc7fa0ddfff7a |
|
BLAKE2b-256 | c091eaa7a5a395ae00afc7de6fda707b6d1b3eb359fd02e964e05d3bec44ad83 |
Hashes for dimod-0.10.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0850bf82ae7fa7569b6e05c8668df9014ce6b39e44b32050eb238410a801a4c |
|
MD5 | 3a0ab95c1cd080a5d7e4544ccdcae3d3 |
|
BLAKE2b-256 | b038c78c68d0f57fbd8eea9b3b6487ec470081ffa7342bd44a4512cf9c0e188c |
Hashes for dimod-0.10.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89e62595e5a802c4a7c69e2f051d6c1cac7a241c1710a39ff05717fca4ff76f8 |
|
MD5 | 64cdb058ea309d2fe5b340e1a77fe405 |
|
BLAKE2b-256 | 00637a12f825e655f63704eef15b53affef2e986e62fec779f784e8937c75bdb |
Hashes for dimod-0.10.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecfe2d29468d9b5dd1ca38a8deabcda71ad3d7cc5d78c7509f259393f0c11c7c |
|
MD5 | 645187aed5d52144d5f669e85812a32a |
|
BLAKE2b-256 | 4903ff6a7e70605a53043e68c0c48d58dfd95acc906f8c6230c97993e8847175 |
Hashes for dimod-0.10.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f354bea0a96f2c9602d05355e82502d4ca49682f8cbf3037e78f092db9f25a7d |
|
MD5 | 4cceb86f110a43cf0a4e78f336184827 |
|
BLAKE2b-256 | b0af6126d05a86e7ecf4b0f5595c0b57e258967e6a3fddf61c42b941e4950515 |
Hashes for dimod-0.10.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba0bf2587caf84422dc0554d932b87b0b64ee504f793bad839e50c9b4b6035d4 |
|
MD5 | 41439b582ead083c03f30dad0359fb44 |
|
BLAKE2b-256 | 072e46a77783282d92efe5b734c78d89e691be71eb4ecaac0eb016b48fc90520 |
Hashes for dimod-0.10.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d3763cfcd6a818e314ef47c01ed37cda65f7e9bb70aae82d33f40c472062aa4 |
|
MD5 | 5a38be76d8ace5a6af4ae5b49c3c64e2 |
|
BLAKE2b-256 | d2c90f8fb046260ba5f13858c8cf6d84cfd8a4d59d39ea83bd221a71c5064d97 |
Hashes for dimod-0.10.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 134acc5c8aae81a1cb64662885979666677d56a2656a03c639da0e533fea7039 |
|
MD5 | 0b03f9d43d48123d2427107c6e72b2e6 |
|
BLAKE2b-256 | 432fc3718dd4855eced25bad1e6acaa51f7d835bb742d3d23648d9330e07bff2 |
Hashes for dimod-0.10.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6cc3369744b4c112ce8727952e93e5163e2c44fc4694e482dcf0f66df5da278 |
|
MD5 | 40ac5cd0e0cc0d4ed325a63e31e366ae |
|
BLAKE2b-256 | 5d48011c7e09b12e4506ff4b58229ff2ef158ac32a5bcefffcdc794bd86bc094 |
Hashes for dimod-0.10.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fa12e3d35373efa8d81d67e5e64e193ef0a3798730885b54645692f7a83bbfa |
|
MD5 | 7feb638356a707d53a92da3a3781ae1b |
|
BLAKE2b-256 | 0ebae4aa5dfaad8fcc91d53de50bda75ee2cecdba4d217ef174a42f4d2b49c48 |
Hashes for dimod-0.10.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21e06b96b206bc7dd4bd50c858c84acc978fbcc60287482d5321c31748c6e5c5 |
|
MD5 | 402e2b542a01cd0a2b6a09acac66fd51 |
|
BLAKE2b-256 | aae054231033bcd7658632949eb50af4142c7173ab6ebca88c16b1c268bb2fe5 |
Hashes for dimod-0.10.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a852f2d41fb97df41c0930ade1736b9986d0262cd24478a9c6ee9902c2a8b78 |
|
MD5 | 59b42afdc009f0a32debebbf74a793a5 |
|
BLAKE2b-256 | 59a5d0b0745289c8bc1c23586feaca574f87c031b3e62849abfe1b2ec8d58c33 |
Hashes for dimod-0.10.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be486c4a859f613bfd10c1359ea4ad2a8dbd32ea9bcfd953c14691f8196dbd02 |
|
MD5 | ecb61f3cd773088e122f7b0e56d1b53c |
|
BLAKE2b-256 | 94a8f897593f99c3456c7e7cbf88756abb3ff344ce4823adcb552f65638ef2a4 |