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.12-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0413721e8c204c10b5fca02a5c07e05c5baa636cc697dfd3817b0dfb395fad3 |
|
MD5 | 17fca6359b525aacfca8b066441cdce8 |
|
BLAKE2b-256 | 0ed13962523beee1329cd8911ccf2f5282be7f3ffefd0a66ed4989cd4061072b |
Hashes for dimod-0.10.12-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef97d7f5f988f4ea190e73e804c057fa3aea3ca40b53c6bca4ccfa18925665ff |
|
MD5 | 2a687fc2f711c1b982f4674da2c328b7 |
|
BLAKE2b-256 | 19bd8bc40957b68b240dc76c47d5027377f0be223d6b3eadde4b368e501c5d82 |
Hashes for dimod-0.10.12-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 896ac6cf8664331d4fc713edc6c52243a01cdd758d90161af23dd791a0b6800b |
|
MD5 | a523bde21791f3bf099c0af156122257 |
|
BLAKE2b-256 | c30e23e29c84429e5354db74f1171bdf51a4c347697c6d8dd2623565a855f6d6 |
Hashes for dimod-0.10.12-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2acf844aab4cff531c91810e87b54400f0ddad30457d5a40b4c93856ba8ee2b |
|
MD5 | c54d98790166576506ff101e477e1dfe |
|
BLAKE2b-256 | 2e0b58c07f3474b6aaa8a159dd4f9648a23accb1d14f590acd32e730fdaca77f |
Hashes for dimod-0.10.12-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76b90d335fd3be16ab2c52be58d131264212d0e8b62ff3664c0a21bb14b00653 |
|
MD5 | 9a6b5e8b7a6a36a3d36d8d80762e958c |
|
BLAKE2b-256 | 21565b8688b6ede7b8d4c3dad1f3cdbaca52ea19587939f02eb07b93702ecc7a |
Hashes for dimod-0.10.12-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6cd40cfeac2ebb0c91f397d650f51b0c5cb19652f0d5b156c9137a3a2b67e55 |
|
MD5 | c201e936090255d6b747a517810c0424 |
|
BLAKE2b-256 | 6324ddc9e5ad95b78017a1f2f3af42675d24cb24b2e91ecff744027a8c0e50ee |
Hashes for dimod-0.10.12-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9dfc081dffaede88c7fb3feaab7a22df0babe193fff3c60c4d167f051dcfa42 |
|
MD5 | 7e249bc23ea74a721e20fb72b46aee54 |
|
BLAKE2b-256 | 29ad6d511e11151d8f810546e63682fe62c913464dbbafa76701209bf4a0e265 |
Hashes for dimod-0.10.12-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d6d9d7d617cfdf098df09f7237727eb4a55f162d948cd51e22b112c97051ca6 |
|
MD5 | 5c2ba2dad90df4581a0721f86f52d99b |
|
BLAKE2b-256 | 2c4189f00b165ee42b28d079530f4260882be92161206ffbfa073afc62d29c89 |
Hashes for dimod-0.10.12-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fc95f101c91ffa45481a70e0dfce4e23b5a3780952547f75f842dbadf74841b |
|
MD5 | 82621e3d10babad01967179e4b3c47e2 |
|
BLAKE2b-256 | fabd644b33b68fbe52a063a5740a7f0e78c76fc8e6e804a6525dec9cf8a38361 |
Hashes for dimod-0.10.12-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15fac2f62fa49ecfdba23a8a21a2d94f23321739183889c405fb283a2e0cb708 |
|
MD5 | 8b55b8f491261eab9b7933ee68ecfb6a |
|
BLAKE2b-256 | 74637bf5dfaf99b92ad28970906cb72bbdfc0d002e4070f7e37019b76f57f4e8 |
Hashes for dimod-0.10.12-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcdc89b9f337e6e808dc5006112f7ea636c8c693d98a3452b0f5f88c97360413 |
|
MD5 | fe31d81c268e02745f39fb1b44d45592 |
|
BLAKE2b-256 | 0294eeb37af90827246bfa9978a60f0edbe55f583a06141fd4854fa788635638 |
Hashes for dimod-0.10.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f485f29040caed24e6c6f602f7054b876f71776f39dec4a86f58f3bcc844ef0 |
|
MD5 | 5bf5dd738bf8b7ad0e1dff9ab9f5bde2 |
|
BLAKE2b-256 | 54b7ce77ed959802e58228579f1e4e9e2054fc8e44a0ac605fa7cd2701b51fe9 |
Hashes for dimod-0.10.12-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c6d8df500feac77b69fc17fbcf5c6a7ab92bb38e88940cf8e5067ab7468351 |
|
MD5 | 4635252eef4016ad7f11a3f7b4b04f16 |
|
BLAKE2b-256 | 5e72eb185c1e39f7556363bc932614483a968837aa33a4d02fd9efc324f36535 |
Hashes for dimod-0.10.12-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b4af22575655c04ad8a55aed6f39c01b30a816739062c46d7fc45c87008938c |
|
MD5 | e2d48cb394f34238062773ca1372b4a3 |
|
BLAKE2b-256 | 7ab30fc773288bc0fd28f038171cec1b0bf99c5bd528d8a04c77bcb9d8cec877 |
Hashes for dimod-0.10.12-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ed73c7d43c3698790530ed5f595964ffd4a0cdd897fc4769f1b3edc923d0750 |
|
MD5 | f76c67530a0854572393563f9a744cf2 |
|
BLAKE2b-256 | d23cad7558675a7ff794ac70a10598cc1ab32825b78c8cec35119b8bcce0c9df |
Hashes for dimod-0.10.12-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1da3d81957d8793b5aff8ff9c4176dbbfc76659010ade3da80da181d8274fd5 |
|
MD5 | bfa4f424c243b67af10722dfa8997f29 |
|
BLAKE2b-256 | fbe1506634c7eeffbf93d6c3accaec8701d03c242e534ce8f32b0ebc1c03aedc |
Hashes for dimod-0.10.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb4a14a4f352b98e4cb20bdd29aac51c81c93c7e206aa705adeee2dcc50779c5 |
|
MD5 | b6093ea0798c13c2090a70e9a71185d5 |
|
BLAKE2b-256 | cafc713f9ddeca63eeb9b2d4fdd761124fb2754744159e3083358f3e5c639518 |
Hashes for dimod-0.10.12-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | addeca1107cbe4b11365ee2675fe71bf063ebc65fab47b88fad39ae489e3432a |
|
MD5 | 5d31108f3ae6cf898e62f36af861281d |
|
BLAKE2b-256 | 9d184a649710612765dbf57b7b4a965913bb1233e2eb8dc1b3ff7bf911d22c1b |
Hashes for dimod-0.10.12-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 974203ed70a29fb129a31972a6abbcd47f5aed51aaf720881975d044ce64807e |
|
MD5 | bc4af5c3615274641c223b1cb6ce37a0 |
|
BLAKE2b-256 | 00f9597169be977e79d8133916d58db04b1a0d486c7eb06daa049351acf03743 |