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.16-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd913700f28f2496f24a167a516bfd7edd2677844755c30cf6de1a4f96eb9077 |
|
MD5 | a3dc1d21ba840e56e884c3c7da20d0df |
|
BLAKE2b-256 | 49185f471e97547d8b3f6db4deb58f5d79a1f0d89b31417ba245ef97006d76bd |
Hashes for dimod-0.10.16-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 126b8a0ed0dc0f0560929e2194fbc0e0ae19d431ea50311b0151f5d52d1f8db7 |
|
MD5 | e1bfbdb397b29337228307eb45a9eb5e |
|
BLAKE2b-256 | 2bf8c8a73efce9b740dabdd28d81770d1b4163188a9c69a9ddc8bb97663da7ce |
Hashes for dimod-0.10.16-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5062bf6288b45cf170ba909d4419bae2c941130136ddf6408078154f516b1612 |
|
MD5 | 73ec3a0df1f88c101a9d57aaab8530b6 |
|
BLAKE2b-256 | 361d90092396c1fd4480c813dd487fe68e46c08c1cffd7096b730dc70a144eba |
Hashes for dimod-0.10.16-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f056fbb300020bd7c96e4f4db175f8ac0d8a93daa1773295cc319f12dd392bb6 |
|
MD5 | 252933f848dae6628d4faf92aa308466 |
|
BLAKE2b-256 | 2f0e6a3987755bae0db2f3d9218e0f18804fed696b63222cf006c2c8b288f42d |
Hashes for dimod-0.10.16-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cd5bfce4fd48002654c58004fd184ee1f52ecb1528c23ad5e963e774c982a6e |
|
MD5 | efcd8f8183844b0a086a682729191c77 |
|
BLAKE2b-256 | d887a002be3a69879bdfd86118a50b03799dfefbe70c87753df3847d1789bf29 |
Hashes for dimod-0.10.16-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a023df9e71879bc58d40846b2fcfcc58e77e2523277dfefff2ee618ba3c86c5 |
|
MD5 | 7e71c25af645775d755588b1e95c8ece |
|
BLAKE2b-256 | 901f243b4c2a19d3b30c4f204e76c81a51c724b1e6be629837c090222cbf21fa |
Hashes for dimod-0.10.16-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3062be50022697719c2689173ce7ca68d2dd905d19901e3c3f4fc2017dba2b5 |
|
MD5 | f7de8bb2dd035b2ab373b1d263c9bc72 |
|
BLAKE2b-256 | c964b79ab2feceb7d3608ca67374422a16fe03804a6bfce1bf92f1bb4706c146 |
Hashes for dimod-0.10.16-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd2ca1f6dea67c57c0d619e149f40444090c53eceebb16453cbce3eff2ad6dcb |
|
MD5 | 1dcac1e93bf18451b3206cebd14660ae |
|
BLAKE2b-256 | f3a1911054eb58009a55b3b24d736d8fe94e54bc1a7ce988e31f44fa874f6309 |
Hashes for dimod-0.10.16-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5a1218cd83f88da548303f914d19dadb24c5a827a891d865a05301bd4e479d1 |
|
MD5 | 0e82e71aa07df86598649bed11577c72 |
|
BLAKE2b-256 | 9cc4a7262df4c603bbac10d1ff7f928c7fd6fa64dfdffdc5adf3fc681263db18 |
Hashes for dimod-0.10.16-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c1cdb5e8b4bc096b8d966d3e6d66f8b871e681f43158c4b5e06a98a442b4833 |
|
MD5 | 0fda25a77755429d7c8d8cd89c8f487b |
|
BLAKE2b-256 | edee0b5ee708755080cc9c42b0d31bc65bdfa15dfe1df39366ee0387721d2119 |
Hashes for dimod-0.10.16-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c0b9c9eced37177249bf93ca24fcbab123dd4bc18f90a0885dafb2a42f72a1e |
|
MD5 | 0cbcd463f5d867ddd6933fdfddb77b3e |
|
BLAKE2b-256 | 04694574750863f8266f7a5413c02915bf7f62c9daa60df42e3b66ab9377292a |
Hashes for dimod-0.10.16-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fbf3f435f4ea524f9aeb36a40e4d30e473d8cd259c27e30e9dde706f6deabf5 |
|
MD5 | fdc55a12d877313e7fc479fb4328f300 |
|
BLAKE2b-256 | 0bff9bfba6cb0245cdc74a02c3dcd98368ab6a578d0782a2c34176a7303a4bf5 |
Hashes for dimod-0.10.16-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2ff1ba0af2b215371afac989b84f3aacdc7c21c9fa25af48f38bbe7deb17557 |
|
MD5 | 11db702f7ff6d0bbf6b6267c8929a06a |
|
BLAKE2b-256 | fd9b8c591cde66195941d25d0f1f10b7308b988cae2c64ecef207605545d6cc2 |
Hashes for dimod-0.10.16-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c43f8097f0d303806d97ececeb560925d7322945cfbdee5c8f3fc217f429715 |
|
MD5 | 8986a1138d7e158c3e8c8cd3a45c6fe7 |
|
BLAKE2b-256 | f4ae632c8941c3397580e183d7ef75bf9ad2860cfd373edb2aa43dec91b3bc68 |
Hashes for dimod-0.10.16-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 436452af315f5d7db21a3e1af0e723a80cf2d4375e6131e934ddb79e6f977f2e |
|
MD5 | c77a2cda99d1ce64ed2a6bf223e87d77 |
|
BLAKE2b-256 | 13113a6d3291cf22f101a86d06fcfc0cb3c4444032bdc764cd917e3f5afad8d1 |
Hashes for dimod-0.10.16-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90aa1be32a2eabb7f9b0c2dffa0d02845230832311ee3e0042b122e9f1b985b8 |
|
MD5 | bbef53dd1a2add1f33a78649b656cf2c |
|
BLAKE2b-256 | 41637af17303a4096a638027ee79f370e02a8f7067cb63fc6658144cd0b2c01f |
Hashes for dimod-0.10.16-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fba6694fd663149c633121768638200fc85bab75dd5e99e8133c1973bfeb2abb |
|
MD5 | 2de2da4195a1cfa0eaadbb6008fb3045 |
|
BLAKE2b-256 | a8c86e40e49685234edd6c5e805ea6aa497d24512c2bc712203530436c87f31d |
Hashes for dimod-0.10.16-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d788c94bdaf48f5278b88134696cea0318b97d620d419adf2f0150321e52c52d |
|
MD5 | 35b6f671eec9d2ccba74825c7a0ca355 |
|
BLAKE2b-256 | 8f6d164f9cb99161db5f7c77bff7d9cb6a73040aa172fa760900a6b0a59b601e |
Hashes for dimod-0.10.16-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5b95ea4134e3b595a6a82eb6d45cf843b89692451a83e516578e02c88082879 |
|
MD5 | 53f17ddb5588859c572b8f4d208f8f0c |
|
BLAKE2b-256 | 37ba7eed7321eb637857d66adcc307d6b0749aa8a6179beef984a2b7004f8761 |