Skip to main content

A shared API for binary quadratic model samplers.

Project description

https://img.shields.io/pypi/v/dimod.svg https://codecov.io/gh/dwavesystems/dimod/branch/main/graph/badge.svg https://circleci.com/gh/dwavesystems/dimod.svg?style=svg

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

dimod-0.10.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dimod-0.10.0-cp39-cp39-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.9Windows x86-64

dimod-0.10.0-cp39-cp39-win32.whl (3.4 MB view details)

Uploaded CPython 3.9Windows x86

dimod-0.10.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.5+ x86-64

dimod-0.10.0-cp39-cp39-macosx_10_9_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

dimod-0.10.0-cp38-cp38-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.8Windows x86-64

dimod-0.10.0-cp38-cp38-win32.whl (3.4 MB view details)

Uploaded CPython 3.8Windows x86

dimod-0.10.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (10.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

dimod-0.10.0-cp38-cp38-macosx_10_9_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

dimod-0.10.0-cp37-cp37m-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.7mWindows x86-64

dimod-0.10.0-cp37-cp37m-win32.whl (3.4 MB view details)

Uploaded CPython 3.7mWindows x86

dimod-0.10.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (10.6 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ x86-64

dimod-0.10.0-cp37-cp37m-macosx_10_9_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

dimod-0.10.0-cp36-cp36m-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.6mWindows x86-64

dimod-0.10.0-cp36-cp36m-win32.whl (3.4 MB view details)

Uploaded CPython 3.6mWindows x86

dimod-0.10.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (10.6 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.5+ x86-64

dimod-0.10.0-cp36-cp36m-macosx_10_9_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

Details for the file dimod-0.10.0.tar.gz.

File metadata

  • Download URL: dimod-0.10.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for dimod-0.10.0.tar.gz
Algorithm Hash digest
SHA256 0ed35e89455a60115698114bdb32f6c0e09aceb596ac2b443e980d0c29c77467
MD5 0b179764d7d6cbeb62d6056ec27331c7
BLAKE2b-256 076b4249c117e2353ff75b7c43594c48ad0c1ddfab09d14bf1d1d5575fee4c31

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.0

File hashes

Hashes for dimod-0.10.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 fc092bfa023b90a64708bbb32e7bb891a9196220496c35c7076481f3ecf6c4d6
MD5 184d07242d7b71edad57850ea2ba998e
BLAKE2b-256 53524ad293730668ac229422a4946f32247c7845b433fae4efec744deebf98e8

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp39-cp39-win32.whl.

File metadata

  • Download URL: dimod-0.10.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.0

File hashes

Hashes for dimod-0.10.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 0c2c4848e2231c0cd99599e92ac22db390b67b2dff53de02aab8bbddc8c49387
MD5 fc5ed0f79396ef6cd17464c481e73414
BLAKE2b-256 2bfdbff6880006ec7e3465f941b0ea4950149f50f3783beae514508b479b35d0

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 10.3 MB
  • Tags: CPython 3.9, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for dimod-0.10.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f1f3a27f8b5057b9a16bc76679f1028d97b3f529a4928577910965cbf91faaab
MD5 e102099f5022cd7c068af091e3756547
BLAKE2b-256 5276eef9ed2018ef76878d5393f715f98b8c1c8389e690662b0dc8b3466c3b1c

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.0

File hashes

Hashes for dimod-0.10.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 60af409ff1b440bd6e7d322305d50ff74f476d7aa2f92718c5f3e032a069df5e
MD5 48b0470687f8614345bcc7fa0ddfff7a
BLAKE2b-256 c091eaa7a5a395ae00afc7de6fda707b6d1b3eb359fd02e964e05d3bec44ad83

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.6

File hashes

Hashes for dimod-0.10.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c0850bf82ae7fa7569b6e05c8668df9014ce6b39e44b32050eb238410a801a4c
MD5 3a0ab95c1cd080a5d7e4544ccdcae3d3
BLAKE2b-256 b038c78c68d0f57fbd8eea9b3b6487ec470081ffa7342bd44a4512cf9c0e188c

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp38-cp38-win32.whl.

File metadata

  • Download URL: dimod-0.10.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.6

File hashes

Hashes for dimod-0.10.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 89e62595e5a802c4a7c69e2f051d6c1cac7a241c1710a39ff05717fca4ff76f8
MD5 64cdb058ea309d2fe5b340e1a77fe405
BLAKE2b-256 00637a12f825e655f63704eef15b53affef2e986e62fec779f784e8937c75bdb

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 10.6 MB
  • Tags: CPython 3.8, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for dimod-0.10.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ecfe2d29468d9b5dd1ca38a8deabcda71ad3d7cc5d78c7509f259393f0c11c7c
MD5 645187aed5d52144d5f669e85812a32a
BLAKE2b-256 4903ff6a7e70605a53043e68c0c48d58dfd95acc906f8c6230c97993e8847175

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.6

File hashes

Hashes for dimod-0.10.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f354bea0a96f2c9602d05355e82502d4ca49682f8cbf3037e78f092db9f25a7d
MD5 4cceb86f110a43cf0a4e78f336184827
BLAKE2b-256 b0af6126d05a86e7ecf4b0f5595c0b57e258967e6a3fddf61c42b941e4950515

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.5

File hashes

Hashes for dimod-0.10.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 ba0bf2587caf84422dc0554d932b87b0b64ee504f793bad839e50c9b4b6035d4
MD5 41439b582ead083c03f30dad0359fb44
BLAKE2b-256 072e46a77783282d92efe5b734c78d89e691be71eb4ecaac0eb016b48fc90520

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp37-cp37m-win32.whl.

File metadata

  • Download URL: dimod-0.10.0-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.5

File hashes

Hashes for dimod-0.10.0-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 9d3763cfcd6a818e314ef47c01ed37cda65f7e9bb70aae82d33f40c472062aa4
MD5 5a38be76d8ace5a6af4ae5b49c3c64e2
BLAKE2b-256 d2c90f8fb046260ba5f13858c8cf6d84cfd8a4d59d39ea83bd221a71c5064d97

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 10.6 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for dimod-0.10.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 134acc5c8aae81a1cb64662885979666677d56a2656a03c639da0e533fea7039
MD5 0b03f9d43d48123d2427107c6e72b2e6
BLAKE2b-256 432fc3718dd4855eced25bad1e6acaa51f7d835bb742d3d23648d9330e07bff2

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.5

File hashes

Hashes for dimod-0.10.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d6cc3369744b4c112ce8727952e93e5163e2c44fc4694e482dcf0f66df5da278
MD5 40ac5cd0e0cc0d4ed325a63e31e366ae
BLAKE2b-256 5d48011c7e09b12e4506ff4b58229ff2ef158ac32a5bcefffcdc794bd86bc094

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.8

File hashes

Hashes for dimod-0.10.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 2fa12e3d35373efa8d81d67e5e64e193ef0a3798730885b54645692f7a83bbfa
MD5 7feb638356a707d53a92da3a3781ae1b
BLAKE2b-256 0ebae4aa5dfaad8fcc91d53de50bda75ee2cecdba4d217ef174a42f4d2b49c48

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp36-cp36m-win32.whl.

File metadata

  • Download URL: dimod-0.10.0-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.8

File hashes

Hashes for dimod-0.10.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 21e06b96b206bc7dd4bd50c858c84acc978fbcc60287482d5321c31748c6e5c5
MD5 402e2b542a01cd0a2b6a09acac66fd51
BLAKE2b-256 aae054231033bcd7658632949eb50af4142c7173ab6ebca88c16b1c268bb2fe5

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
  • Upload date:
  • Size: 10.6 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.5+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for dimod-0.10.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7a852f2d41fb97df41c0930ade1736b9986d0262cd24478a9c6ee9902c2a8b78
MD5 59b42afdc009f0a32debebbf74a793a5
BLAKE2b-256 59a5d0b0745289c8bc1c23586feaca574f87c031b3e62849abfe1b2ec8d58c33

See more details on using hashes here.

File details

Details for the file dimod-0.10.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: dimod-0.10.0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.8

File hashes

Hashes for dimod-0.10.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 be486c4a859f613bfd10c1359ea4ad2a8dbd32ea9bcfd953c14691f8196dbd02
MD5 ecb61f3cd773088e122f7b0e56d1b53c
BLAKE2b-256 94a8f897593f99c3456c7e7cbf88756abb3ff344ce4823adcb552f65638ef2a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page