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.dev9-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95dd3bc410d86ebee87ee883e2b33535ccac053775900a9691239b7f3d00a89e |
|
MD5 | 37b41e612b019669b5323b36a60f81a7 |
|
BLAKE2b-256 | d2c0c3c9ee366c30290192168f768b207401aa3ffdfe01d8f532cd3abdc54a5a |
Hashes for dimod-0.10.0.dev9-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbbc106fa3065afb8c5444b244d82077d05500194cd44c42f7b86b014cc95f8e |
|
MD5 | 0a7bf97a78a6fc6db7cdf0a843e1dda0 |
|
BLAKE2b-256 | 0664b06caef2ed453f6142d0e6475bf7e7c17248fe09f8ea1389bfcb0784dc4c |
Hashes for dimod-0.10.0.dev9-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5099cdeff0cc4c1220995138e90b568e4f6435c5c81f479880d6940558fa59c6 |
|
MD5 | 60281bae54869405c0314bd17db1fbb6 |
|
BLAKE2b-256 | ef86afb35d6aa3a904a04147fc50bfa2d6663f6573e2945f5933603d5caf126b |
Hashes for dimod-0.10.0.dev9-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c29056891ae0dbe498e5a97414dad41ca8ca7137edda8851d8a016109cba39a5 |
|
MD5 | 5c209f5160b784e4f9ed506c345ad128 |
|
BLAKE2b-256 | fa5ff251ada6b4c15ca57ab24249867874e98d1d4028436ad51b944242a05bfb |
Hashes for dimod-0.10.0.dev9-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b70e6620c0c1b71f8ee524cb637bbd694358da5b4b5f0792903d16e7b5837ca7 |
|
MD5 | faff013dc1e7ccb9f44eb62c57cb6341 |
|
BLAKE2b-256 | 0bcc4fc981cda56fe956b636353fc3125b54c2e26d99a33b9de1c4f0469360b9 |
Hashes for dimod-0.10.0.dev9-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d00d34742c2dd9001196e885998afe49f6f9cb660505eb075a2ab3142d370982 |
|
MD5 | a0824c1426be0241d83300aad08a3bec |
|
BLAKE2b-256 | b49d3588d3d2c9ee761bcab7511de322eb7b958a473b4ee1c54ff856eebd668a |
Hashes for dimod-0.10.0.dev9-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9eada26db1c1c431d1f7904c691ae57175855636757412895cb702369a64b31 |
|
MD5 | 54edf64f52030df68f40ef7c8c89cce5 |
|
BLAKE2b-256 | a3f8094a4c756d1418f0c4ba1eafae3e7e4ac35748707e5e052485179397f17c |
Hashes for dimod-0.10.0.dev9-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95e63c939bb5f0bd9a47af37e24a9f3fbed9389aa06f3a33231892ea508a353f |
|
MD5 | 2be59faaa8eec8f75d1ca6938fca34b2 |
|
BLAKE2b-256 | 8212711b30ecc2614f540845a70af5d1b0fd69a351b2f9fc3bb740b14cbe5a1d |
Hashes for dimod-0.10.0.dev9-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ec3f17f9b754a526f376dca9b69c768b798230bd0ccaff9ec4b0e487cbacc2b |
|
MD5 | 76520a5d39b52f9137463027c6b4e05f |
|
BLAKE2b-256 | 1a829c5f81660d094f351ba0718e50f777ca407794a8f79ec9953a74c314186e |
Hashes for dimod-0.10.0.dev9-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bff347e6f87c79579fbcdf1fa2243a7d20d495be48c06f03e6a4f9a87ab0c9d4 |
|
MD5 | 2e27f68f35a9d9503cf4b469078c9221 |
|
BLAKE2b-256 | 369348408bc0bfe2392b936a8f65edc57fc996a94509f53722f103f0ec3efbe5 |
Hashes for dimod-0.10.0.dev9-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6591fff7cde0c76c22c885741f3b5417299b7aaba6fb34b9e2c2e0b94af06407 |
|
MD5 | a2bd197ff9ad13429b2fbb9c6eab506b |
|
BLAKE2b-256 | f6f9330de14b358111c06f9f559259fc8d648705f478623fc340cbb442eb62f7 |
Hashes for dimod-0.10.0.dev9-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 253ee26030cf7f6e154f069649206887fc8159a00d408529c7e8ace929b3fcae |
|
MD5 | ac0d5ac3ede5085cae590822d863f0ee |
|
BLAKE2b-256 | 589224828590a7814ef434510e4c4e6720db877a9ed9d4f0db1233b9f081e217 |
Hashes for dimod-0.10.0.dev9-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94aff3dbae88150325746b2f7b1e590de1017d328d613f236b1ce35e7067ddfc |
|
MD5 | 86867b4dbe0ebf5f5421bf9e0a61c147 |
|
BLAKE2b-256 | 5625368189ec1c3e82e3577592fec658f36a4d83f4ff9e554d069f4a783c00c9 |
Hashes for dimod-0.10.0.dev9-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48b90ee35ee9f28e747367855fe0d030573a857a6f68ead613363a0074cc4b2e |
|
MD5 | 6df66de1df18e12682386fb3ebb75cba |
|
BLAKE2b-256 | f1b42300ee12272f51edffbcb29ba54d540242f3ee7b63a0a7f07c5c3164072f |
Hashes for dimod-0.10.0.dev9-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85b7f0234c270b86212de7c223c105596c89f34f76e1fe4d793737a9cd18dfc3 |
|
MD5 | dc6fff132ae529694d6de74e21aa2d66 |
|
BLAKE2b-256 | 7b2fa5b1e6a456b6837f98bcadf882c2239207c502e22880673cc3887c85f539 |
Hashes for dimod-0.10.0.dev9-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d151ec97cddceb2a944768a3710010ed7b86b9b1e6b5e9d69ee5188f85829781 |
|
MD5 | 433c5ebbce11aeac9487322b4cbbf472 |
|
BLAKE2b-256 | def83e9b204e802ff9cf36d7b50e1680e21c0590d55f66c889768688b85a20b3 |