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.9-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9b58e4fe8148996ff7126c2346279e1f60a9be56c4f5146d803bbf8f070a0bb |
|
MD5 | af2f9e31b03c51ccbe51413e8e27f511 |
|
BLAKE2b-256 | a063b3b945272549149dee023fc09f71425679bfcd5801a1e32f39cc5f8fffee |
Hashes for dimod-0.10.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f466b676ddc6f811047374123491b84b9041270bf1c60270629e0aa34e10bd76 |
|
MD5 | 0c328d81e9c6c90621ed8ae910d0d826 |
|
BLAKE2b-256 | dba7e6a46adefee0862b60a13e27ef5893f5f09c17f693c647afff8051c2c98f |
Hashes for dimod-0.10.9-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71e81b4b486caa52b4ba9dee3d3ea8df8b11c208cb7045c0628eb1ef9042faad |
|
MD5 | 8b0b7dab04f2eb89246503a2d29eb240 |
|
BLAKE2b-256 | 848167babf7f787a4eff309945bac3249112b8c468a935d93e95346e1c4039be |
Hashes for dimod-0.10.9-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cc6dad55b93d8138d5de9b7a020db5596eb9eb9ac68e7d0ec8a3c7a88837ad6 |
|
MD5 | 0d63acb1403a8461f8fc00171da85aa5 |
|
BLAKE2b-256 | 8d6f8e1e80c56dcc5bc71a45592980ae839011f93079183c3f8f7e2fbec3d9fd |
Hashes for dimod-0.10.9-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 541b034d4cebedd29cfb81867e29cf96f00a1d76913e98efde4e9caac5be0417 |
|
MD5 | 09f946bcaa55b3d442cf03b71bf6e345 |
|
BLAKE2b-256 | 4e5938f0bae7e2f264fc105628829c7cc04e2545d47da07cbe2cd3ab66dbccd8 |
Hashes for dimod-0.10.9-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce1e1237c6a1c9948fbde5451a87113ab15f98cbdf8213a820339dba9589acd0 |
|
MD5 | 1d3aea91b965228df4001f92404dd2cf |
|
BLAKE2b-256 | 9fd6215e97c6faacb12ccd67172cc3a431a7b89294acfbf6bc6d0872e2357ea0 |
Hashes for dimod-0.10.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66f6817d3e6636c0bf34e8dec0da31b9e89b870777fe71734c1f0503e7fe3c7e |
|
MD5 | 6d6382df65d61bdcf572edc3cc6e03ea |
|
BLAKE2b-256 | 7fa964a51be8b22b8a9ddfad31afa6c6d85f81e5b1919ec48900360d183a24bd |
Hashes for dimod-0.10.9-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2aed40bbfbb01c02f36d1319327a1f3c48d32602d7f0b88ce143c9799e673167 |
|
MD5 | 046bef8c5e9a023909fc9a6e85e42d15 |
|
BLAKE2b-256 | 8300f8d23c5c0d776d1e402da2ce076af336852e4d67176a476bf76bac264a33 |
Hashes for dimod-0.10.9-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43c9804166c42bcb270221ee65ee354faed47cf67fe66bd3cec9ca00f9aa1302 |
|
MD5 | 3682002882419b129b3f3b589fbaf73f |
|
BLAKE2b-256 | 52b492d06c675954d87535bd4a91f950d57e2687d3f6419f71aebed43ae5facb |
Hashes for dimod-0.10.9-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4a6350801fbb347f59ee6b94341ac60ce997c31e151da53de0080f685097911 |
|
MD5 | 9836fad7807898754152b046005f364e |
|
BLAKE2b-256 | edc35d66786cb34fad1026d50d1b0a689bb71d9195ae2f33cd5e0c9a9052a9c6 |
Hashes for dimod-0.10.9-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d7a68405dc0278a0d0e20e29b7552d65120773e5a6577ded9d7b77b6b5161c |
|
MD5 | 716e1afbb416c57d96ada00663c3f2b9 |
|
BLAKE2b-256 | 7edab69b5b07a055dd37fa680b54164c19d61e123ab06fdd4c101464eed9ed47 |
Hashes for dimod-0.10.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d51184b1492c02055718a959d8e3bfa64e4e6abef802a19b6962fc4ba2889a25 |
|
MD5 | 8fb6c3ebb0245acedbba3998c71fe67a |
|
BLAKE2b-256 | e46712096ae499da3b2f389836439be9e4b6db00bd31ff228d8753b4602aff28 |
Hashes for dimod-0.10.9-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3434603094722d8b39555b66a671258367a1b1ad568ed347ccbb74d39a3b5ca3 |
|
MD5 | 8ea5eeb583d535d0408ff531a39c22de |
|
BLAKE2b-256 | a74e0a3876e2edde1d7e17a1a27ad8406642f9b9d4376f90e1b935b46688f892 |
Hashes for dimod-0.10.9-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df99dea349b77a557e4a657d6c70db46d5ba1f12d63da1907448d27fad0de10d |
|
MD5 | 037b4ef811e4425a3cb74ff33b5e3f39 |
|
BLAKE2b-256 | 91ac16de760da1d32d9ded214183596088bd7cef0d79e9c16ae1b48a74d9230e |
Hashes for dimod-0.10.9-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 102e975c8435a6a16ac2f13b6b428ccb8233b7a37e02da209a909d7d12b2b276 |
|
MD5 | 4c6dd1ac85e33052b26578b8b10ebde6 |
|
BLAKE2b-256 | 015180d4484cbea35f6df9a5e21c523e30a0aa6ba9a8f9494cefdc791915b3df |
Hashes for dimod-0.10.9-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb31b4d13e552ed0a04a6200ccb96c311216d055b5619bb5746f3cb7aaef6d4d |
|
MD5 | aced211083cd012e1b1bbd557f64edf0 |
|
BLAKE2b-256 | 8ac11e226a449992940f38c12e3a6e080e4b9d11fbf99b7f89acdefdd0a4fb2c |
Hashes for dimod-0.10.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a3d753dec7ba8acf14f9d8b605bed26855650c62a31f982e202038bdcb38844 |
|
MD5 | 64bc5b2c9c59fed42c052321e9d6911b |
|
BLAKE2b-256 | dd8be9283d6b882aaca8f50b10838199caacf05a4295efe886cd7f543f38635f |
Hashes for dimod-0.10.9-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54c6711456ab60fc9bca2ca9021ce620106b7283a7f6ef14d887e2d5e17c00f0 |
|
MD5 | e2a937bb2c252e4960e7f0a38a0123fc |
|
BLAKE2b-256 | 18d69f318eb62c6519e764c206fce3c451645cb6835b6bafcb958ad6d19a56da |
Hashes for dimod-0.10.9-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c79416367004f598a9d59fabfeb2e3901fb70e5498b9f4767febf7a7802a635b |
|
MD5 | 5582ebc513007f70a55905901057a17f |
|
BLAKE2b-256 | 0cab9acb4d7598913f4b9fb6de5b1e1fda9325a25e0bd24ca7b4a68b23cf99e3 |
Hashes for dimod-0.10.9-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5294aa59230088d52799bf478465e69111145e92c8b3997beaf70d20a50df44 |
|
MD5 | 3bd56965b151ed087d094815c9eec842 |
|
BLAKE2b-256 | 7797378711e959c0457647be49738257e713250457020c27d9d32593a3f19607 |
Hashes for dimod-0.10.9-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21abf92e19794477291fb8e5074b36e4a53462942e5c366122d358cf403873a0 |
|
MD5 | eb33125119cf564af9e8ee80a30bcd27 |
|
BLAKE2b-256 | 3a1d066f79d0862716fcc919132e1763412bc1dadb6b6e618859a4f3f42d9626 |
Hashes for dimod-0.10.9-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 450b2a093c6fcfa15221816e475b1c0167ea80161605e91a9c86b3d080c0e944 |
|
MD5 | cfc8370885e79593de1febc92564ad19 |
|
BLAKE2b-256 | a5f86dce2eceb62d3d8c7fc0422647b51f65cb3dfff804ee5eccff29f0cb6527 |
Hashes for dimod-0.10.9-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dbc5b8d5a54ec94522856f330dadb14f2082d3108a73a7bf40504f4fdc8f57b |
|
MD5 | b119c1604dec22017db43eef72cf6683 |
|
BLAKE2b-256 | adfe42a4b00d88551a80a483897322fe9fe55f20eed51153bbc99ff45fc94517 |