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.7-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91799cc8332218b0979ffdb6740479514c7e8b44ffebedae37e791852b311cd9 |
|
MD5 | c29dddb1ff713a5e8388bb5b880fd292 |
|
BLAKE2b-256 | 7d440ee72d9a6d6f700e9ddac8b2f32f9bcc1237282782ad7edcef6096c84b4b |
Hashes for dimod-0.10.7-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f74848035e8bcda55df756cdb6a5f83ef46bf3b256a8919b3b873652d5b831c |
|
MD5 | 69a5e486e80c163d19dad71db1cf28d6 |
|
BLAKE2b-256 | 0d202ac073a2c9d475f8623d03f4cf9e90cd4e6d59e05e2137425efbc22ea01e |
Hashes for dimod-0.10.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1886cb21d1ecf4a0579ff5a422911b23c84767070afb4953c20539122adf67a |
|
MD5 | a8fb6286bf6180c82848ef42e51741ab |
|
BLAKE2b-256 | 5ba81c958b0b305913f9bf535c0ca35bf2f9f1fbb33f31482244ad2f5dba88c7 |
Hashes for dimod-0.10.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1a3aa8c09bb74077cf4e98f20a869e2a9d7c1b42b4f54c4d6cc299a9822c3b7 |
|
MD5 | 2c23a566fd689ab3560e17e66f938564 |
|
BLAKE2b-256 | dcb41a3729f651dbadc3c46a81b1e40b766a57657317585e80d44c34c7f77440 |
Hashes for dimod-0.10.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0c914c889315dd599b6658ebcb47d44768f464b2ea08a8bbc76987d93cb4866 |
|
MD5 | b39aef8b79a0ffe994eefded83c1a0eb |
|
BLAKE2b-256 | 530a2c257c5728aaf4b9dc2e2546c7e799f974e3512e91507b72e17f63066e55 |
Hashes for dimod-0.10.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 530415472ab2fdc02cd8a2e12e78e909638eac332c6e0f86da5203506dbcb106 |
|
MD5 | 095fef122e6555cabafbcb1361afef6a |
|
BLAKE2b-256 | 08bd2f12c0724ebf82451b6e315f1f662cf2e2b0f161d483765bb578e4b0864b |
Hashes for dimod-0.10.7-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 091d96cb83a7a275fb48a91b7bd9ba9c9daecc87e70d869a97a89d77b61c3851 |
|
MD5 | 98ea5e3d65a727216cb20da118d0ad37 |
|
BLAKE2b-256 | d35bd2540945735f6c0920e4f2c679b49164e09c76526c19e7a1230352dbe39d |
Hashes for dimod-0.10.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9612adbf1fafd679b35f5ff01cc998c4dda62553c0c1aac04497903e66342863 |
|
MD5 | da5867c30c45ad3a34198fba1d18a5ee |
|
BLAKE2b-256 | 8f3b92d9f36d09ed7c9aff2fba80203291bec06645d3be5c6f66986a3740884d |
Hashes for dimod-0.10.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7c124fc06578ba3d42896a431103e3ac1050ceb4d4e0b8985eecfe2e3c4cf25 |
|
MD5 | 332410dbe04d1997a6dda9940a6b1bf0 |
|
BLAKE2b-256 | 74813e4ee289179d237e3275e381d7cd568c57efe88c86d9e816336866552023 |
Hashes for dimod-0.10.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0d115ab812997769a6aecb2ca01bf492155c635b58dda553904f3a70a091aab |
|
MD5 | 7982807d3a081b02359b1b87dbe2cf9f |
|
BLAKE2b-256 | 6af48bf5779abd705029a4f102eb70c2f037ba436a9241989d8345e86f828092 |
Hashes for dimod-0.10.7-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61b119115d5b03f5bfd190f869cdd6df616ec698fbc85128c4127146400a7602 |
|
MD5 | f47d28cca2d0739e339471b428f7fc14 |
|
BLAKE2b-256 | 7e4c18fc8e304f72e1db20c95cb0717f7dbc373ccd51924702d69ad11d61c5d0 |
Hashes for dimod-0.10.7-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4731917bac6a59b83bb57b653ff1adf98e18f35d394efd8a75dc822dbdcc1d5e |
|
MD5 | 5244ab2ef8cd74595ca2a4ed9b85ff40 |
|
BLAKE2b-256 | 187ddc638c75d4ac4a63f16c794292f28347d297d2ae893003df7c335ff7aa1c |
Hashes for dimod-0.10.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 673bb1b75872a9e6a6a903ac3bfdf3a36af30f05b6b02567cf51e9e703b795e2 |
|
MD5 | 96d95b1c0aba4d1c6821ee0c640c0966 |
|
BLAKE2b-256 | 7e894e4957f1ba2a550253d2e7f3305e41fc6229f8f85a047edc4e95b8f945ae |
Hashes for dimod-0.10.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a876baa2994a1494e928cd1d92ba1dad313fde554a471beac13000394e09508b |
|
MD5 | 171ba035302a48d5a771cbd5d0d6c95c |
|
BLAKE2b-256 | fea42bbbe32bb50b65c2d2a26c450b4925be2bcadc521b0e0d3a7eb7dcd56df6 |
Hashes for dimod-0.10.7-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98807019b87d281e6d1b14a2385dd23493bb2832f2e51411a0b13809d7ce3b51 |
|
MD5 | 697fbb70ee1069e4a374f2a5df8b3708 |
|
BLAKE2b-256 | c4ba865aa4ba57fbecf6a9080ff69bf149b84fd6252b7fc248440f5622e894fa |
Hashes for dimod-0.10.7-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84f88db2e54b058472d1b5786c681b4bc8429b504c6bfdf9ce8be1354b5f64c1 |
|
MD5 | 50aed699661ee6fb1ec92d68031ea5e4 |
|
BLAKE2b-256 | 162e9defe79008ef130ce701e8b744df1c771104f7de99d11f3bc9f2985235d4 |
Hashes for dimod-0.10.7-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12fc146f0132836c3c62419a7c137ce91b4214b970fa44dc737d7edd42ba401d |
|
MD5 | 2fd17b14beaa7d3276c0ae5f74e024c8 |
|
BLAKE2b-256 | 58b78e047f16fde48c6a887c3b5fbd4a6aabf0b95b2bd676305ee044da6110e4 |
Hashes for dimod-0.10.7-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9aab55cab88253b2d998578b2a898cbfe4c60f2a95fa749e0b59f77d579a2971 |
|
MD5 | 09162df6fae2a32b7b364449fe1b8788 |
|
BLAKE2b-256 | 882a3225c8d40036714e948f127ba570cf799261649c19f947ef52908d465013 |
Hashes for dimod-0.10.7-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dffc2ee50dc4afe5fb6b7532c029621ea0be3b91a03c19b72d3b33a75fca73a8 |
|
MD5 | b95517ea2378768d03581956914abc41 |
|
BLAKE2b-256 | 7f6c40e943e27a7f99d2bd801435356c9ac1a48590ce5846df87d9c6829c02fa |
Hashes for dimod-0.10.7-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff4fe2ff50c4e8a4f25b4b8de22e98ca8de1fd6d432b69354ef510374452839e |
|
MD5 | eac4edde6aab8bb4cbce2d649c1a7ea3 |
|
BLAKE2b-256 | 33a21976172cd83b17d4023017d28b91221e0cce97df6a51faf7750196e5dbe0 |