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.14-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ca4c7652ac65fed5b4386ac97042a301b7c9f66831ce0f542cbd50ed98359ec |
|
MD5 | 1c69e28c2be10ca734b87339c5394520 |
|
BLAKE2b-256 | c744e3368f9dc1615aebf13973258c0d0cba9d15d385ae10fe95c5c889ab5cc4 |
Hashes for dimod-0.10.14-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6225f881c1d9ba5923018c2e0772b39e4b7b246860f2c12201a1d7f79f0be97 |
|
MD5 | a8e2c5d1a2587fff74831a1c27294cf2 |
|
BLAKE2b-256 | c33108f8fa57de3e3666304432b3bcfe4ed50ae1fecd42c0f1f6fcbd09bcac35 |
Hashes for dimod-0.10.14-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 806736b4db17bab6df863ea811a2d0d92bbcf481068e7185a89136af9994a72f |
|
MD5 | 466ed631ac9e9f23969b29efd2308067 |
|
BLAKE2b-256 | 696acd48563970ffde40982e36d0a83c92df5db35ddd09a2b76b3a235ee0c263 |
Hashes for dimod-0.10.14-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bbd505382c2655b72fb9ddf6031c376c443de4f37e617308355e9d3bf623e4b |
|
MD5 | 1d874d6c1aa61f80a30950948740085d |
|
BLAKE2b-256 | 2189fee0f405351fe09bc0b4f883fb61134ca113a6516801408fb31eb8d5beed |
Hashes for dimod-0.10.14-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffc7d8ef34c8f2b8ffaffb734a16b1ac04e4d6f22be26ea398df1e78213dc95a |
|
MD5 | 5d0caba8a560646f9ef3e98a5f11f35a |
|
BLAKE2b-256 | 176c966a9c8e240aeac268f7306e0b5c4e84ae5e5a6963ae4623c65462704b5b |
Hashes for dimod-0.10.14-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ef9718f5bb15f707305417c4a16597569061d7e98f0dc0ae31a7d4540d9dd9d |
|
MD5 | e9a4cc6e937aee512968397c9a7afd14 |
|
BLAKE2b-256 | a3b3e29eb06e30fae048d84b500887a1d79a089952c5890e4c3f7b53918f39f4 |
Hashes for dimod-0.10.14-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b40ece3c249cc6e93227af639a979f0835aa487d1778d8f962a2d61a6de7722c |
|
MD5 | 0eb6c83d3efbde95525b82dd0597aae0 |
|
BLAKE2b-256 | ac98d90c9ecf9a22d16690d86b97f1f5653d3b8052821a18f89e98dd2aea306e |
Hashes for dimod-0.10.14-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 002b7ea126b0bfff851fa0951175259ef04f06edef7ee87806448861a53d36a6 |
|
MD5 | 151d73129a790c36c3cac2d354de6773 |
|
BLAKE2b-256 | 910c8249c05414279e0d11f9120b5def47ff29f005617c71642f2def6b5cc2a0 |
Hashes for dimod-0.10.14-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8fbe19dffb3fc57ca10401515b484fe9305b4b8d53e60e9eb3010c201cd7bed |
|
MD5 | 07b6fc52c8594b65fef0783bdf081dab |
|
BLAKE2b-256 | 305b56106b747dfd552a80bf8d1a84ddf48612f2abe965067761e6e508bce629 |
Hashes for dimod-0.10.14-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b09d701237e1be35a16199a75fae6825abb2c6e135998b63327a84ea35db4e5 |
|
MD5 | 668dcb6078949b9fe1625463c758e9da |
|
BLAKE2b-256 | 0ee946f63381aca04e0ebd9e3f7ede4bba9f9773dabfc1f382a589ef904c2f3c |
Hashes for dimod-0.10.14-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bdcc4f0f02ea6ee7d9d4acdd4d3900d94f411b335b3fb6bf0b486206d23c1c9 |
|
MD5 | ceff6fc94b1bf92dce356f918b7b3435 |
|
BLAKE2b-256 | d5d941d49d61d771be459ef724b6b815e3772227c52271f8a12ab2a1ae32c010 |
Hashes for dimod-0.10.14-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1f312c5c99fab6ad1d4e3bb1d6969185e5aa21bea8a7fbca875e1ec84391813 |
|
MD5 | 6d93601aa620be116eceba53d1ad3110 |
|
BLAKE2b-256 | 44ab1499f986641f8b10d941685cb5ad4367beed5753b664645038efc7350912 |
Hashes for dimod-0.10.14-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5792351cd419187725b478f218bd4aac32bb03a2de2c5c50a7eacfb95d620ce |
|
MD5 | edd7c6051135ca447e94c7a03aa3dfcc |
|
BLAKE2b-256 | 33b64ae964abe1b16f7fc5902ed8bc81c207308954298e1218aa6915495e112f |
Hashes for dimod-0.10.14-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a37e123af48d33953e4cd97f5c7d49023a61fefdaef46877f7c473a67e9f031 |
|
MD5 | d86ddfc944f8f2bbd0b64105fe0477db |
|
BLAKE2b-256 | 656eb8df75b4b11c48ce55f0d9e8103af12a4104635b57b7bc8b6593f29e31fa |
Hashes for dimod-0.10.14-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 600c731fc6c2da2c0a4b28404a22f21844c9a3cb0a0de6c08a8c221d583710e3 |
|
MD5 | 3489937cd0455c715b34ad13924eb684 |
|
BLAKE2b-256 | 02a348c4f3da62734eaef22ce728e26117d3a184f19ccdc53610f26b04c2ca99 |
Hashes for dimod-0.10.14-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0cd78832df6bb8426161cb29286c75932a50d6c16b52d47cb35e99937666e86 |
|
MD5 | d7fb48d20bdf4abb5a20e4b7a925a3ba |
|
BLAKE2b-256 | cb356554a0528678872601f803d197810d8a216b8b72816ebe2833c17d0fb6a0 |
Hashes for dimod-0.10.14-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f90aeaa9a6062e3a5cc7ad74c180ca5395991504a6dd7769112349d2f5a0ea3 |
|
MD5 | 9391b2adf2d91e162503a8cec2789768 |
|
BLAKE2b-256 | 99a7a7a80e17c5b3e818a6843f7c9b2010a0717ebd4d31be45265a64ed58295e |
Hashes for dimod-0.10.14-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca62072fe6836374f91a50ed6c3c1b5a9f9babbdfd265d10f6c2366f8c31bb64 |
|
MD5 | e0f7146af78e9123883258a61da59411 |
|
BLAKE2b-256 | dc22b111949cc8822160dabaa53fb8f5c30a9b8211f77b8aebe6995263fa8451 |
Hashes for dimod-0.10.14-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff1b363d1a54ac33fd9795f11838656dd1d361d19a9c678addfa95496af33876 |
|
MD5 | 0f6efbecc425d39398307d146d4eeeeb |
|
BLAKE2b-256 | e9795eae6d32dc6642254284169b22188546c0398f2ef0453b3e6ff09b5d8835 |