A shared API for binary quadratic model samplers.
Project description
dimod
dimod is a shared API for binary quadratic 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. It also provides utilities for constructing new samplers and composed samplers and for minor-embedding. Its reference examples include several samplers and composed samplers.
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.5+:
pip install dimod
To install with optional components:
pip install dimod[all]
To install from source:
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
Note that installation from source requires that your system have the Boost C++ libraries installed.
License
Released under the Apache License 2.0. See LICENSE file.
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.9.8-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42f9558e259b676730af07b110f99a30297b8c64a7937c8fa392b2c4621951b8 |
|
MD5 | 3379f802d27ec376e336169f2d5d3ff0 |
|
BLAKE2b-256 | 478b50e999ab7f502d9c9d9a0cd37a9250b4a5346a2c1c4d8be169c75c29f643 |
Hashes for dimod-0.9.8-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4e1180ab45704d782878487bb94e3bb14d79f0a50f61370e33c18bba6b3a8e5 |
|
MD5 | 6c278d6cfdb49c18656c4686c2b7299f |
|
BLAKE2b-256 | 69260b021948b0ec735173993fdbb557645d31688a7a1cb3b9185efaeb295b29 |
Hashes for dimod-0.9.8-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1808005ffaef30ca2d6fc0f365d9d4b8bca727cce682992f709b280431454092 |
|
MD5 | 8ca65210b3f3cbd8d86695a7ff2110bb |
|
BLAKE2b-256 | 1961e65e76c975b3b1998c96d77e32ab2619c3abd7e393e32e6d7054928f6535 |
Hashes for dimod-0.9.8-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60ebe44714481316fc0e109539fc3dd33a04435b55b010bed24a981de240d733 |
|
MD5 | 14c00563f98e1a0c5345ce49ef35f9d0 |
|
BLAKE2b-256 | 58b2f5e03163640ee7155a1299f8114aa1e143a79370595187e3894e422b45c9 |
Hashes for dimod-0.9.8-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39a05395b65d33a5a2fb88b0acc66f6c550d439edc83a78c78e2d03cdd686e6f |
|
MD5 | cd0bced89adc73a9ee3f97fb2c685d01 |
|
BLAKE2b-256 | 0aa3e33aa9eda22a60c8a3bca175754b340f7978ecf5b6c9c36483c90de1af13 |
Hashes for dimod-0.9.8-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec1fad8c11cc7d06533ffcaea414a678cea6ab4e360c82833b532e11613eb97f |
|
MD5 | b889b3794ec3e0c25cc90343f382179a |
|
BLAKE2b-256 | 186a7a708a33f8b00cee9571f18068781c07eb5de0977f2479b58357d91df71c |
Hashes for dimod-0.9.8-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 772371508a7b1523442a340a340ec1322362393c5e37b3339ebdb6a55781762f |
|
MD5 | c494e4b6b5c5b38c83428a736af46616 |
|
BLAKE2b-256 | d443bacb3d531d2b947e3b54fbae01550375d8d890f2fc17f92395f973ab6e9c |
Hashes for dimod-0.9.8-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1d636be90235c4defe6acbc43155c7dfc78124325d99f0745e4994b31a05687 |
|
MD5 | fb5e361f381432605b1536694ecbb126 |
|
BLAKE2b-256 | bc91e8d07a16b53f8a0687ecbef63dccc30ff53818beb1bfb4e1a50016b21398 |
Hashes for dimod-0.9.8-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edbea819415d328da1e5f85a5c43852d9e08554e98db99e4c0043625ecb38fa7 |
|
MD5 | 80ce8c1c31ab8c61de29d8b73edea5aa |
|
BLAKE2b-256 | ac92223bb4165866bfb0b108395db85cbdd277222f39c28048fb1e4b2732c04f |
Hashes for dimod-0.9.8-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5662d0302fd27de3210f446859afba4b2c9468e52e6c64516375847ee163884a |
|
MD5 | 2a703159b1b3687ad10fe3acf6c15656 |
|
BLAKE2b-256 | 108fdfdd8a7a341d227bbb52a109771e6de9f585b47b22925b1d294d435d122c |
Hashes for dimod-0.9.8-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79116dda4eb99d05f4e49bd62b133e58560b04f75e158901c3348fb2f2b641a3 |
|
MD5 | 0309e46c852b9812a90d91ff5b5dc46e |
|
BLAKE2b-256 | a97a65a6dbea808a88755bd9fb11d3d4472f8f40740df8fc1ac4889fd1e6077b |
Hashes for dimod-0.9.8-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2db1ffe943c7fd709af1493da041c6f0bae6f1a564447cd2c349f2ecf8f2648 |
|
MD5 | 3286580df950e08dd0ccc1c9192bda14 |
|
BLAKE2b-256 | 9ab326aed625b3f47dfc369a0b42f9187bb27299dfb6d72d8b6c749c591b25e4 |
Hashes for dimod-0.9.8-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a432f45737b06bfb7c766dea731c8a852a99ef7c45a32708ba9edd7bc381613 |
|
MD5 | 6f13c3902aaaaed2603fb9f5401c4bda |
|
BLAKE2b-256 | d633aca6440d10508fc05264924e992ef0bfa2b0fd691dec415a141db23eea24 |
Hashes for dimod-0.9.8-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b1df677dc66f91b6e91ca9886aa79d02151f9b1b6de61bc369414cdf710217d |
|
MD5 | 68f769df953eb7e3a8d1b101b1686f88 |
|
BLAKE2b-256 | ec22f8460dcb582184698378c097307de97fd1af67ab492915d299117dd4b6a4 |
Hashes for dimod-0.9.8-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fbfd02e144e1c39361244e112195792fd7c15bce22a903edf5aab7b28decbfe |
|
MD5 | 36d3ab77d45cf16d914b39f6a79fa909 |
|
BLAKE2b-256 | 40cee10c60a34f0c7a416b82539ad63085c0be6474c6d715a36cfdf8586e7f9e |
Hashes for dimod-0.9.8-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eafe012c6843bd6790d76adaf5c2358d5d02e169ecc8a40ce5c84714bafda480 |
|
MD5 | 915f256c5c5801e700818923c7626955 |
|
BLAKE2b-256 | 307f377bbf93b10d1035b31559519469802c781b58ee14483433295da8ce0d68 |
Hashes for dimod-0.9.8-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3b1babc5c961ab0c008787b2b2186a5c8e71c20705993ef04d4224c34022b4b |
|
MD5 | 2c7b2b1a63cf5cfe98d2642d49a5fa71 |
|
BLAKE2b-256 | 8c91a8134fd89e0296dbba2d1e6db3e1fcb20685c9441f14eb0b5f0b71905beb |
Hashes for dimod-0.9.8-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f9783bdf09aa2b62ef09cb4f78177fe035521d8b0c0908f627eb80b02146aba |
|
MD5 | e9d9c9d82d955d2493875f50ea8a7f6f |
|
BLAKE2b-256 | b752a1819125d07d13342fdc3bad87513c60870ee7e71527fff5ee466ce0f2bd |
Hashes for dimod-0.9.8-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 545638618bf33c222eb40bc04d94ec32c74e7b62623bb7714b6fa53b3c2a77a7 |
|
MD5 | 2346425fd78c3cd4e61358b10031416a |
|
BLAKE2b-256 | 73766ca7854d9787a0428269e190c89a4d6a976d2296f044fa3a082a1564ee16 |