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.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.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08a2a5fd34c288be2aae225112b9aca1da53b8c1604cc8b971d63889c99975d2 |
|
MD5 | c8d34a9ef26e8d13d0116df07ce3e698 |
|
BLAKE2b-256 | 3369491ddc293b65abc30235fbb0f62a239975a546d872ddbecb524d2d4d8c8b |
Hashes for dimod-0.10.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54c2bc76e6dd59eae390214135bc10fc37965b24a382b47450de1bd5543b208d |
|
MD5 | e074aaad567d7d1844c4b57952bb6942 |
|
BLAKE2b-256 | 797d5f4bf6127ec2473d5682c309f3bc0b7844cdde2b84ee722631daef333c7c |
Hashes for dimod-0.10.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f48f27d4d0966deec8a5fe72842c6d1b22f1477d1f518faccd9f155bb46304c |
|
MD5 | 25bac9382588592ed78b33ba3f7f3501 |
|
BLAKE2b-256 | e30f3fd2568f1ca1a682e5eaae3537fde77eac088e279e358b8cac7989686cf2 |
Hashes for dimod-0.10.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e7e6a5255f89434e25cd09ca3048f8017d243a69b3dda1455d4b705143605c3 |
|
MD5 | 3fc0d8e11df91d6f540a9cad609d17d3 |
|
BLAKE2b-256 | e11a9e96f2e25e7554631b5f12a71561b3b27aa260a549d0fde96e13e323156a |
Hashes for dimod-0.10.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e28d561fad00d7ca71e809796ccc95f4e3d9dc08baf1a9adf5ad1d5d415e48cd |
|
MD5 | edd591955ff8d105777b0cb7f5e6640b |
|
BLAKE2b-256 | 9b4d57e3fa0509439b342e72009d24c2a1946827094abe37c97320c44d89ca96 |
Hashes for dimod-0.10.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e38c3edc833c3af7fcb113565e6ffc4879e2c2c2bfeb35949d4c257250c5eb0d |
|
MD5 | 0880e492437e8ee1d709dc23ad67cd4c |
|
BLAKE2b-256 | 3c25c40f66e74e60a684039206154efffa917612c0b3d2178e8bd9fe413bbc63 |
Hashes for dimod-0.10.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa95cf560b7032c8fbd4fbfb994099433315bd9719d3041469f7539a75785f82 |
|
MD5 | 9ee635afaa9c23b78f66fa536e2395bb |
|
BLAKE2b-256 | 7e66d0f3645a3af8eeef8495bb317508122cd4302be44e005a471e0817f7814f |
Hashes for dimod-0.10.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03dbb1a408d7241b767f88d6097ffe95482193e28ab0c60769c1daba487ec80a |
|
MD5 | ed9593bbbd852b2f76fed45ac50af307 |
|
BLAKE2b-256 | 1c1625011c7c97dd5fd3db89029d567353539cd9a23f3efef546852025bb8d51 |
Hashes for dimod-0.10.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efa5ca9c78d969dc2a71b6c82d399cd031cc0b35840c3c582b2d549b5d9dace3 |
|
MD5 | c578747ca57ba5727a61cf807d080df5 |
|
BLAKE2b-256 | ae9176d69ad713021af416a73b48546065accccc17b116098d6d7508577f3b74 |
Hashes for dimod-0.10.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ee9868840ec25b402225f958d4ee1b509cb1cfaaba13d5d7765bb42ea6f6b70 |
|
MD5 | 297b131f4f7aa2b194c5f3dbe0766b26 |
|
BLAKE2b-256 | edf82267c220edb92a44f41a26ae3f9c989dea0bef2d5ce36193bad2a4120569 |
Hashes for dimod-0.10.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4f7d579d796d06e953dd031d664790836f6e00b061c9494ccfe70564c9584e1 |
|
MD5 | b9c939e84d57e295c4e777123fd10980 |
|
BLAKE2b-256 | 50b7e8357506e910f3c26613cb9c6375580fd5b1ed8c52caff6427c74d898731 |
Hashes for dimod-0.10.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 951d84684b24414ea7dbd0e18dffc289e6aa4f0463e13da3a48dc43ab7a6ac4b |
|
MD5 | f5590781d1a743e377e5bdbe0d7a3e97 |
|
BLAKE2b-256 | be4c63855b990176880e68e71d38c80c979b41c2a9206de9092d8b968762a6c7 |
Hashes for dimod-0.10.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10b280eae881846b46c9e08045dd88ed77359429b14a8eaebc6f80628a51ad54 |
|
MD5 | 08e229b8d4b4fe8cdf06325d35de1364 |
|
BLAKE2b-256 | 4b9c3444d68da2a57600a2948db7792c03e5a550935f4be907605bcb4b85b93d |
Hashes for dimod-0.10.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2437b4dca8ed80037f83723fecb394b23fa54878029eb792ea2291145dde0b79 |
|
MD5 | 21b10dab27ed99a00692e3289b12e8e0 |
|
BLAKE2b-256 | 9b2d92b0c965769539e2e2a15b2c974c182f32562ec4c4c25701d2fe1956c2e5 |
Hashes for dimod-0.10.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a99af0bca713c77302aef1fcf722be7871e5947b23709d2e9bfe06974e38eb3 |
|
MD5 | 1f90611e45b5f8f9ebd7e4f2e684f83b |
|
BLAKE2b-256 | 8d4e0c515c33ab16a1163c16c7327ee7aaa6688b533d2c8012df8b5fe6279460 |
Hashes for dimod-0.10.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d414af145848c06a01af5b1ffa8fc3e096ddffc31b243d3e754333d531b967c0 |
|
MD5 | 478f5351ac28a2d2976f2e75f16e02ae |
|
BLAKE2b-256 | 7858496aef98ebce4a529ad92c06901066e4fdee53999cdd321b0e774c92392d |