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.0rc1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40c7cc446e62fbe040b888e2ecd13fd50bf630d9915bf23e3ab0ed669ec05fea |
|
MD5 | 9461a47493aa248b5385d73638a9ca63 |
|
BLAKE2b-256 | 334dd44853be1538b90c48c466bdaabb6a4bf5a2f144be2fce07c908cd2409e0 |
Hashes for dimod-0.10.0rc1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d546605d4d53437e99f43ed26c0c125984d437827836d145664c5aa3a7e02dd2 |
|
MD5 | 8bc0a26ebb66a819a77b510bb48b3190 |
|
BLAKE2b-256 | 30ab8b21004893955f99725db2b83ef18d731312376d30885ca67c45bff33415 |
Hashes for dimod-0.10.0rc1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d332d2fe8956d7d825e6c47944f9e63895a46c1f1ef04c14d9fd512082976e5a |
|
MD5 | 678bcb79b3e0e2d6a318d08f830e06f6 |
|
BLAKE2b-256 | 9bc0b2484fd12a535510879ee8da26535f99b1135f25824cec7511208bcef1b0 |
Hashes for dimod-0.10.0rc1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 889736d214f5a47163977c7758a0443ab88eb5579b6b8fe098c4292d20c5f755 |
|
MD5 | 13e5af52492b4eadf5902c28794b084d |
|
BLAKE2b-256 | 28d43b15040d902ea3568de62160be9794a87cbc54e8ecdeed152cb0c29395e2 |
Hashes for dimod-0.10.0rc1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d966d1243c502aa0584cbca03f1c2113eaf19045c6c95656bf5173a5464aa9fc |
|
MD5 | 89b07bd8ce81c9fc2a9e8066b227a1fd |
|
BLAKE2b-256 | bd91a596c9b906f1ef3cc2b15470e0dcf0b4b225d0f6c47896ec504d58d1fd63 |
Hashes for dimod-0.10.0rc1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f16354c8c2a93c3ac420600c159bcad7076939e1e34085ec287bff7d90f186c6 |
|
MD5 | e55c55dd42d44b361d3ddbe598b05c1c |
|
BLAKE2b-256 | b3ede320a4ce1ca77506ce9deaf3687c1c09b373c7201195394e91d5e4b00fd2 |
Hashes for dimod-0.10.0rc1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c565690377a2325546d75b66eb710b7e24643bdfab3d0902b79f1758dac8fac |
|
MD5 | a482ed10ed18b8925548cb4e780666a0 |
|
BLAKE2b-256 | e6ef43b1b95eb7de2cb621d780eb740c1582892af886119a41450dfc274fa423 |
Hashes for dimod-0.10.0rc1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4db14c1c1749f8052c2d3ccf4da120c174858ad4a0b276d9ae0b356db258b5c |
|
MD5 | 5cfecc9ae9855e9c3b35dd2f8ff3c1b1 |
|
BLAKE2b-256 | 18871f26a04be4109adfc96e8eed72e4e547fc47c6605bccefb8eae0bfda5a51 |
Hashes for dimod-0.10.0rc1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 955e0c03f8f56be5c3041813d42c984819683c6cea8209853ee071a5fb206a97 |
|
MD5 | 0f185858b8054aa7b803c586f20f29e5 |
|
BLAKE2b-256 | 1be0caa3f060e63b34993c2f6957b243fb2b222629f6580571aa83b1601c574a |
Hashes for dimod-0.10.0rc1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c1d1afd25ee3456691c145c1476ba2f7e8c120211f748ace4890c39eb8451e2 |
|
MD5 | 330478e73c1ab16d77aab87028f16c9e |
|
BLAKE2b-256 | e23c9f949a9d99a8a018abac898b7c68373c4fefaa15124732b7e5c4c9928140 |
Hashes for dimod-0.10.0rc1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f4032ccfc9f84febe650217f44c2c76dc67d608439f79d4a3eaec5c48be3186 |
|
MD5 | 8d2b1f26851534cb513d8ab7e3bc7e72 |
|
BLAKE2b-256 | 25f7af6923259fc307031b1df2971e19212f0e40fc52b8563af5af4e620136e5 |
Hashes for dimod-0.10.0rc1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a46c9c5c867d09baa1e53d5edb62cbe967abe010757b788afa026bb8b0108f8 |
|
MD5 | 3119c051bb934fdc8a646d5896fc8f92 |
|
BLAKE2b-256 | 4a7126a3cfae07fb39c6a55cf22dbe8d5c963eb3bc28d7e138e93d5e49d066c1 |
Hashes for dimod-0.10.0rc1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1b2dc7d2dcacba3aa8684521ffb551dd313e23d7217492f15dac2f4e765b5ba |
|
MD5 | 2fa08e360d1ec59a933e1ee1049c972f |
|
BLAKE2b-256 | 2c1a2c62a5d04ff20ea101d95bca03341f93e4d6c6d3a728cbce646f79cfd66f |
Hashes for dimod-0.10.0rc1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c843bd91a327ba39a199fdca0a172d7162271f2f9befd3d4e380ca62aa0986 |
|
MD5 | 816453d837eb741ef257ddf6042791b2 |
|
BLAKE2b-256 | e7a956c1600a6e34d9ec895bf45fb075469f40a006f5e08b007263322434b66d |
Hashes for dimod-0.10.0rc1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7326320f15314508ed6a3626831548f266c2d85c1d706afcfb2bfdf026cd59c1 |
|
MD5 | fcda512eaafb430b72230d4336b722ae |
|
BLAKE2b-256 | 5efac2388d84b500a87373e6fda76bf327c24a6ebace2f5c98f722a677f1059f |
Hashes for dimod-0.10.0rc1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65d02bfddd298c8fca230be92eafcae8dae4c0fe64366a0d4ae2ee815df0296a |
|
MD5 | 8da023734ab21dd0c0dbb491bc2e69b5 |
|
BLAKE2b-256 | edca8421d166326eededb2849a24d15367ecff9f1c08f715ce8bec27a9ff58c2 |