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.5+:
pip install dimod
To install with optional components:
pip install dimod[all]
To install from source:
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
Note that installation from source requires that your system have the Boost C++ libraries installed.
License
Released under the Apache License 2.0. See LICENSE file.
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.9.16-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7917a49124fb67a06858d8d7c01574348bc80e0721e4894761ae9dc708f07d05 |
|
MD5 | 3f2dead570ff469dd188df3f56811c44 |
|
BLAKE2b-256 | 1a13558854b9208181d6106ed6f4057ec7b9092ad9b33a738b62f574d3d5a4e8 |
Hashes for dimod-0.9.16-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac9d088e942bdcc27b1d6c6daedb23e65c0aa493cdf131fad4fa08b265a05974 |
|
MD5 | da9260af67a630f1eb5e9de899bcca7b |
|
BLAKE2b-256 | 22f1ac064a4e6db602001ae34a9c62aa866a2b97c918f2743d26382f163d3227 |
Hashes for dimod-0.9.16-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e92845c7c1883906fea0a39397f1f654f65f45b39c9c86598742780e1a4d9a89 |
|
MD5 | 450ac08acb291e25162e3cc46e039805 |
|
BLAKE2b-256 | b2319b3c6022407a1c623aa9eeb0a9196edb6da5a6e07b7b42c066940a294b86 |
Hashes for dimod-0.9.16-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b519883c7543e0baab7641a7d019c4ee019d41b16645478260ee0210f943665 |
|
MD5 | ae50d30790175d9182bdb98d5dc474dc |
|
BLAKE2b-256 | 80ab00ed79c373b2915ef3c3281434f2b3b85d7808d052c450b428708d28acbb |
Hashes for dimod-0.9.16-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f761b23fd86d92498eb617150521d0d86dd4b989ed6e20015e2eff14938a4393 |
|
MD5 | b343c88310df634f4b6789e7be60d877 |
|
BLAKE2b-256 | 24a5cff9392a2ef207f0c3ab44aa14b03d8144571808bc6df6d469d9932bb23c |
Hashes for dimod-0.9.16-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b3b3dcf0268062df1613926105a14eb534d4e5ec6620aff6e9fc86825e6671d |
|
MD5 | f8fa0b53371f74762e830851a3a68a6e |
|
BLAKE2b-256 | dca39c0a25a0a5488ed7f02af1f5211a9d9b39e668693f7e289bddcfa57cb652 |
Hashes for dimod-0.9.16-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e86433f8cf58bfa50ec84c530c7a99a6eb0d078f9880fb05214bc08c39bcf6be |
|
MD5 | 83d7ec87e87609f8b0d05c25fc545fe3 |
|
BLAKE2b-256 | bf781713c6d99ba787e281d253ab963b57455b8f348846bd028e86b16e45a936 |
Hashes for dimod-0.9.16-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eff14a26a09010ed5db60e118cb4b9a7ce7cb61d323ac77891f6a975a756e54e |
|
MD5 | 9a09d5fa134d45465dfdf118e6d164ce |
|
BLAKE2b-256 | 22a6fd0a8106d1fac43f52c9ca31dcd1d8cd072373425eb6b2b7036964a28ce6 |
Hashes for dimod-0.9.16-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e34d573e30ddf17bd1ab56f34a80144e3c852ff050455a6934aa092533540df1 |
|
MD5 | 399a90370c0587f3351520eaaa3e5add |
|
BLAKE2b-256 | a26b7622163306376cd3de02eaeb377ffb32ce968c587020e3cc5558dbd25b40 |
Hashes for dimod-0.9.16-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9233606f72f2d464dd48cd87906002faa1b8778045bbe20530c0429d9b325209 |
|
MD5 | e3286a289b0276e89794e97b692ee954 |
|
BLAKE2b-256 | bb20e1ec78dfa5c22c0dfd1785e738dc2d947d593d1f5d6f45ffe1fcfaa5eb62 |
Hashes for dimod-0.9.16-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4079387720642fbe116ecf54eb26be5d07d0dee33d0afecfd63bbebcffe32f0 |
|
MD5 | 14f082d0033fd426d87a123a5af6e5f6 |
|
BLAKE2b-256 | c2bd40978e13230ce41b201f15028ea9e89274bc3f708d00dc6eb06f30e0e417 |
Hashes for dimod-0.9.16-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82d558e1926c8d6718dd1e8eaedb4671f30a8188d7451df49d31e642006de8d8 |
|
MD5 | 678ce15a3648d782002ecd40ea7aa940 |
|
BLAKE2b-256 | 9781c24eaf052d496a39f6aa296848fdd8aa7b2efaf03f253b8d1d398c281090 |
Hashes for dimod-0.9.16-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4fc4dfb285392d4c287aa956d512d1d7f1a9a38dddc3ec1f2f905d450476d30 |
|
MD5 | f5981a4f9e1bf274c6a34f7a3e73969a |
|
BLAKE2b-256 | 5ce460d76f38f29205354cbec2083e694b144e0e2ef4dd481b1c214ef9d2bc7b |
Hashes for dimod-0.9.16-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2269b93ec37919f6608475f99453aa0ed49f22949f989f12c6c1324a046cfe7 |
|
MD5 | 6ec16dba2ea500abc9ed0fb1f2f94716 |
|
BLAKE2b-256 | 9881f31023bcd53c1be267d4fcc05542eccf3f6ce61013222213568a460b6c8b |
Hashes for dimod-0.9.16-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 152485c4e671cdc1878791b28171f3bfe74841114f88fba1d01c1c842f1739c7 |
|
MD5 | ba98f7a531e672d362ae796d828ac16c |
|
BLAKE2b-256 | 42d4370128f3725e39e980bcea691548913483908a429d86b99ccd88d7e16b82 |
Hashes for dimod-0.9.16-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7ce973f25537a3d4a35fda1dae2202e32fed801995fb8881b2f54a588c877e9 |
|
MD5 | e2975fa6777d5933b49279114e2aff85 |
|
BLAKE2b-256 | eb54dad9823b4fdbad72c12dc76e3d0799a67b061bc924bb811d4a90d432a428 |
Hashes for dimod-0.9.16-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bd16c1767c7179f1ed435d290312d4d43f3f9524947b31dda9d8808cc4d1615 |
|
MD5 | 9d63aa4d3895fa97d321eae891d96291 |
|
BLAKE2b-256 | 3d5dfbd2f7f8f07ccbf9cc09ab11cb31d3b099d746cddd28ce41047d85fac105 |
Hashes for dimod-0.9.16-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7114c78bc180a3bd27c0dcdadae37e4c15d203cd13818b1e3924385061d64c0e |
|
MD5 | d7f41f12603ec35780b9c21b6b4fa667 |
|
BLAKE2b-256 | 15e3596fd12ab62a69335e5bb60b33936d1cc7905ca9caa0673842e6b006bb1f |
Hashes for dimod-0.9.16-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc052db1812a154da9ad988f03da791a9b2c320fe35d5caa229ef80d2e83d375 |
|
MD5 | be5177f1811b724f07c4f60988a8cb5a |
|
BLAKE2b-256 | 74bc21284fe3d8792f2f65868c988e8719cda674ad094154a03e2bde0094b132 |
Hashes for dimod-0.9.16-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 282e797b81acb77ec67c6af403ff0de4a6a9de2b14dbe5827ade809c7254ef4a |
|
MD5 | 12e319f6163ba144cbbc3772fc7f617d |
|
BLAKE2b-256 | 69ef738c40c5136d54e47a96db23fba3a3306c3a94c6275da7258d685668c5cc |