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.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be7dc47002ef9f63cca214fc9e569ba7fa92e972856a98aa7d32f04299d3ec60 |
|
MD5 | 236e111556922ef593a250dc894fe449 |
|
BLAKE2b-256 | 0f95fe519bd8f67e22eb27828d3f709c818495b202f0e6bebd34d446e7330ee2 |
Hashes for dimod-0.10.5-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c8490c91a1724990917515f9c85bed95161f2af0a6bdaf2fb3c447ee45e87c7 |
|
MD5 | e164bfe8ea7af5156ea46f64b5d83e08 |
|
BLAKE2b-256 | 9f456f0af66280f4d794f4b7641e0169d507b1f03c00ed1210e787493e904ce4 |
Hashes for dimod-0.10.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f63102332a5e23118cae7d1be313f3cf68b7fa5c813b65f27b531bddf3af7ff8 |
|
MD5 | 76993994a00243d6c09484bca862cd20 |
|
BLAKE2b-256 | 7c6fb55a9da3f33fcafb1edbfe30fe12b5161a66c9c3c9e0197cd100e2f9142d |
Hashes for dimod-0.10.5-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 830018ee8f477590def3b53a4922d6fa975d18f0271e9f9921b472e5c7635e25 |
|
MD5 | 39f344e4636229e0a2ec643d54ce8fa8 |
|
BLAKE2b-256 | cc61b213fb191f122f10f6b302c29fddead8e1237ee10f11efc50423806b8372 |
Hashes for dimod-0.10.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d6cf720c2125ebbff58127e853c13f6113145eb610a5aea8e7e23feef7a3841 |
|
MD5 | 8130a5054d832023a3caca130cf7010a |
|
BLAKE2b-256 | c97378e6b972fcf2fbf523cd9369fd4182c8c879362c295f870e1b2ea80cf636 |
Hashes for dimod-0.10.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55a8a99789afb22dc9a6b92ae1592946fbeab984402f66e2563817efee037bb6 |
|
MD5 | e6069c3e3a0fa8fa667f42635e55bd3d |
|
BLAKE2b-256 | 2cb3d91b53a4bf3f28440ca5135e5de7481ca3040cd0642c1955a106c118c555 |
Hashes for dimod-0.10.5-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 225a1babbeb16537056414cd17422897b2b5087ceee356fdc1a9099349c9b653 |
|
MD5 | bc9edf332258024c02bc76a403492e05 |
|
BLAKE2b-256 | 5f27a51cf5dced851fce19817d2c08e6f3f5bc81bbb7d98719a3d0ab63e07a7b |
Hashes for dimod-0.10.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 491d04969b6d1a6629e5a02822dbc2be3969c19e5d73b981d882ad13227d2709 |
|
MD5 | cefd88cf3f7a4dc07ffd76ea0b8ad921 |
|
BLAKE2b-256 | 957a4e3ee13d0d2635360b450e951bb9c112adc2351d4db95f007dec6fa6350c |
Hashes for dimod-0.10.5-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c62e63a19a6a0fc05ecf1527ed808ee6c352c2716770d6b87148dd7a351da137 |
|
MD5 | 2aeef18cf8e77ca91d5329542d9313e2 |
|
BLAKE2b-256 | 4ca2d22ba3ae866d6dd1bd0e3d3e92fa6077c524848ceeb93ed471d1c0cec431 |
Hashes for dimod-0.10.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fa52c3629295d583655815200a8ac2ba7c3c147e8813d65e035cc69196c6bca |
|
MD5 | dae72a085bc80d9ec893876c878a79d2 |
|
BLAKE2b-256 | c428fa0bdd2e431edfcf0f91b87c8976be01e776c616860a8d27a98637bcbb1e |
Hashes for dimod-0.10.5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6483e8a0114b1d98805f2b96f087f5eb08a9d459b8c9d6a7f7a4603ada2772a |
|
MD5 | c66c393fb411b7bcf35ea25c03e1da73 |
|
BLAKE2b-256 | bc961c8b298afb2ff3e32de25ba5acd1ca23891c9d14af4fbb8f948f79703cca |
Hashes for dimod-0.10.5-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61479b8cd142b92014d010be54e2f634056402a7f4dd98d0a8d6d20aa402ccd2 |
|
MD5 | 1e997e711c128d5c7178ddd0aa97711e |
|
BLAKE2b-256 | be1a464938ad0c38ef29d51b39c7f28fcd63534eb4cde5eff32fb46b1c954ac8 |
Hashes for dimod-0.10.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5743e8f07a5af751c69e1b00c2ed1a083bfa54d2a72683bdcdcfc3686ca1a727 |
|
MD5 | 3620e43f50432954fec4a89ba8fb68ae |
|
BLAKE2b-256 | ed04d147472d2d19c0d3a8c9810215050918c8597f1ec7f89279c97987cd6f31 |
Hashes for dimod-0.10.5-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83bf732963329addadefff0d5e322d9a3f67d62c278a740e682718ea64f7f142 |
|
MD5 | 21a2d8a063d0dc08620fd9ebfb0dd896 |
|
BLAKE2b-256 | 65871a1db5b0058bf4d5ebc9e218bc0c8e0d7fa7488bd60078014863d7980015 |
Hashes for dimod-0.10.5-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff343ba1a4199a392781a28b520508a9449d90dd31aaf2b61114746eb2d36273 |
|
MD5 | 77460354b3264b1c139d52ace810ae1f |
|
BLAKE2b-256 | 538e76843b469597b8a543b9341ca1c033b5bafc6198818bb20e7a71c200469f |
Hashes for dimod-0.10.5-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d94b39dbf99db173c2bd14dac002105fea8a7149f50377c4ce50c28b0da2851 |
|
MD5 | cca1a303862d630daa79101d04e0aae3 |
|
BLAKE2b-256 | bb55574dfb92949a3d0337b5c518597153e1f11bc2549384cc37878bb5d79e9a |
Hashes for dimod-0.10.5-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8a2151765374c6fbf984b46f10f652288750a302a4c6975d484df79759f3e66 |
|
MD5 | 1213318d2d6c8dc28e78434b8c2ae3ad |
|
BLAKE2b-256 | a70dfa1683f64c0aae7b1705b8dd97338c181a008d8fdaaf08a88cb7a7e86aa9 |
Hashes for dimod-0.10.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e99570ade3849556d49b7ea2e3414b9ac734ebab69615c6ba5b9dc1757a0f40 |
|
MD5 | bab79a5085dd6b6d8ae8b813d3d9a7dc |
|
BLAKE2b-256 | 1ee585b909a50ba8881b989921b45a969df53f084047ab3b38ac9b62ce9349f9 |
Hashes for dimod-0.10.5-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b611e3649062dbb1507b1773fb192099a70ffb066bbe81015ca432e20fc7f4cd |
|
MD5 | cecf5b646fdff08ac385f00f9a3cf31d |
|
BLAKE2b-256 | 17d2c54bc91e91b7dc050e8f0a16bc0d9d9fca973a098b68bfbddaf0312d5698 |
Hashes for dimod-0.10.5-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e194ec10766390f5a8811c5c76f33923d9272900ad6c7cbbc30f8a53008f51c4 |
|
MD5 | e9f4bcd99984ab0606016f194c5326e0 |
|
BLAKE2b-256 | f0b16ecb07b1e06e61ecc49e9d4477d5ad8e3b1948293c0f96032b85a8016623 |