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.11.0.dev0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3053f7130c8f0a2a96a9f35270556e1b53acd4f6f328feb389cb2125fb07b38c |
|
MD5 | c4eed6c0f5e55bdace681629d3fab53c |
|
BLAKE2b-256 | 360555cf9f7dbf9fd08e4888be8d1f889c276f13b2a71867d43fd171ca2676d6 |
Hashes for dimod-0.11.0.dev0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d34be0e8d2ab8520562a6fd6794d5400c36593c64986ca524a476f4ba3090862 |
|
MD5 | 519f231b6b6b6be74e5d91c08eed2184 |
|
BLAKE2b-256 | 5c35eb558ea3c1d751f24a194edf2ec71aff432ba45b1db49124551e24b78b33 |
Hashes for dimod-0.11.0.dev0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f72087cc965399dccf2caa7be38002a8c1049c52e17e63711f3b808042c35ae1 |
|
MD5 | 7fcafa5888afe9f041192210098d7a04 |
|
BLAKE2b-256 | 55be579182ca240a8bdca032b29aa34dd10d3d398def1613149af993ec0064ad |
Hashes for dimod-0.11.0.dev0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af8015485f88551e92338c54e9693950955c4501bfa9072fa1a44984d0781d9a |
|
MD5 | 2dcce9e12e3b0e0abfbc9b26fc83fba5 |
|
BLAKE2b-256 | 1d96057cdc923142f8596afa842609a387bcac6368ba31559654e59acdf37e12 |
Hashes for dimod-0.11.0.dev0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f427a88d5a8f3347aef613879a107d0ff89080d00112108be2133cded60b256 |
|
MD5 | d4658a2324e739a528879300ec5c061a |
|
BLAKE2b-256 | 2acc9ac02e6956c7e5db684838fa861ed77c378faf12e0991dc7e484768e2c0d |
Hashes for dimod-0.11.0.dev0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed0f6e36b06a6f3db4a29a8dfc382a858b1dde25d8bfbccb8625f30438098fab |
|
MD5 | c0f67cf743611e93a507989c20340ff3 |
|
BLAKE2b-256 | b9d0908bad773f6ff966b14fcdd4ea89e064fc16f90ee755dadf260bdc50bf5a |
Hashes for dimod-0.11.0.dev0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be0e7927c805aa1f71d69c8b26ee69e6e7e7d516228dc59b9f58c6a60ed5e01b |
|
MD5 | 84b2e9a9522bdbe842f0d00a66c7bfa1 |
|
BLAKE2b-256 | 989b81f17bf14daff5283e353fe4a077995414c1b6a247ef098f8f655fc19cf2 |
Hashes for dimod-0.11.0.dev0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5353bc56cea6944fe10c667d2d9abe68c33c6f7ae5d9c433533c6b74fec474ff |
|
MD5 | 6e09ea11b2c866597d342bb1062edee7 |
|
BLAKE2b-256 | 7807a794ce8487177fe8f9d18b0cde04858fdba247a877f17827f28bd67792da |
Hashes for dimod-0.11.0.dev0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 757c105ead970b141cb8fb5bdef6cbcf7d8d3f57c8d49cd683d65be63a31b333 |
|
MD5 | 9b68e1f279a96595409665a980e359fa |
|
BLAKE2b-256 | 6497074a98dbc543f6fc248a35b0e53fabb0fe14f1cc52d3f106197b0f88ecb9 |
Hashes for dimod-0.11.0.dev0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d029c25904c63984f9e3166b2bb30266fecf8d94a1b004677565cb17a33b976 |
|
MD5 | 919aa36e0e6f31003fb6d7b132108b4b |
|
BLAKE2b-256 | 3416bb5a9e2051d1e18de0456dc4e6bcf34903ebaf7d7e78ebf68c251ea57a4a |
Hashes for dimod-0.11.0.dev0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee42258ec95727636e4e7c7286c4a81752781121bb5999cb14109e9349282d02 |
|
MD5 | 5d8b319f4d435c6c228f1b592129fd5b |
|
BLAKE2b-256 | 307d77cc701bd0521776e12a6877d06b46050fbffa22efa770dd11da3a4aee09 |
Hashes for dimod-0.11.0.dev0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a71b6241dc3a9e64b94e2ba741372b50b0656a79b7019883defcf0c5ebee4f39 |
|
MD5 | 25cc847d6d2e79a2ce7abda9a5df4d17 |
|
BLAKE2b-256 | 710a96b9055f13873c30154c6c4d13730f83d5ee6204969c4d9ebd905f13e9ab |
Hashes for dimod-0.11.0.dev0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5d2946a2751c3f2917eb30abec3d27a632567eb71f89764c043bc4ed94b94f6 |
|
MD5 | 40dccb9b6cf2eb534e6d426f7080bdf7 |
|
BLAKE2b-256 | cebbb33066478bb0ee26d2168c5e95c2d3d3fdc4fb83ff9a574aa578d68486a8 |
Hashes for dimod-0.11.0.dev0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d40851d20a4c4cbd826b2d28cba5e36f062b0ceeed3cd4e6a26d49924e6e16cf |
|
MD5 | 23bf94b3e72899d90695dfa047effe68 |
|
BLAKE2b-256 | cd71a9045741077fccc81ad4754d6e44b41a729f6c8cf301f96db561039df8f4 |
Hashes for dimod-0.11.0.dev0-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73f523b2a4aa092e3300e5c9114f799919a39a87effd91a53c18bddf1f352063 |
|
MD5 | 43a2933373d77f0001f77bb2c85f5e3b |
|
BLAKE2b-256 | d83aca220d6de0fa17c61f309ed8a219871534f81f195075e5d78dea407c986c |
Hashes for dimod-0.11.0.dev0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53c7afa1ac378d516b75ac804c390c422a826f7f381f94530e4cc1d602804642 |
|
MD5 | fa6176b2b63bcb4053dcc9f34cb4ae54 |
|
BLAKE2b-256 | 9dfa39d3646ab23cb88be63abca7adcc5ac9e919d22c6032fea8814b641e5e12 |
Hashes for dimod-0.11.0.dev0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e55978fbfe6770463bf0ecaae3ee9b3abed19b237d1e2bca2627133c804f8f3a |
|
MD5 | 5ee4e2271f68c4b446a72d8bec192d9b |
|
BLAKE2b-256 | f3427e597d79d968cf07ceb7ae0ad027fb66df8af4d53a6c5dbeb2f43aaec1f2 |
Hashes for dimod-0.11.0.dev0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f84b4d891fb8b0032d7861834f98b6355bc9b316a929f694085ef68ef5303d6 |
|
MD5 | 8c59d1dad8100569399900dc99eb4cc5 |
|
BLAKE2b-256 | 7c07a7105f701372f33c56da8cdc696a571a496de7379fe95d9e6ecf6c27bff0 |
Hashes for dimod-0.11.0.dev0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a7a7b48e126c928d17778140e3ec847a1f685968d1b623ca29661b1929c3e49 |
|
MD5 | fc6d239a7fd854644f449c1ac70442de |
|
BLAKE2b-256 | 9e4bb4c5f684136ca8e3040fed897c7e1d4555f3da6661b01fa354656685bc2c |