Skip to main content

A shared API for binary quadratic model samplers.

Project description

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

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

dimod-0.11.1.tar.gz (1.9 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.11.1-cp310-cp310-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.10Windows x86-64

dimod-0.11.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

dimod-0.11.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

dimod-0.11.1-cp310-cp310-macosx_10_9_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

dimod-0.11.1-cp310-cp310-macosx_10_9_universal2.whl (5.1 MB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

dimod-0.11.1-cp39-cp39-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.9Windows x86-64

dimod-0.11.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

dimod-0.11.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (12.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

dimod-0.11.1-cp39-cp39-macosx_10_9_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

dimod-0.11.1-cp39-cp39-macosx_10_9_universal2.whl (5.2 MB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)

dimod-0.11.1-cp38-cp38-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.8Windows x86-64

dimod-0.11.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

dimod-0.11.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (13.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

dimod-0.11.1-cp38-cp38-macosx_10_9_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

dimod-0.11.1-cp38-cp38-macosx_10_9_universal2.whl (5.1 MB view details)

Uploaded CPython 3.8macOS 10.9+ universal2 (ARM64, x86-64)

dimod-0.11.1-cp37-cp37m-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.7mWindows x86-64

dimod-0.11.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.8 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ ARM64

dimod-0.11.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (11.9 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

dimod-0.11.1-cp37-cp37m-macosx_10_9_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: dimod-0.11.1.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.9

File hashes

Hashes for dimod-0.11.1.tar.gz
Algorithm Hash digest
SHA256 c8a708d44f4b811360ba3bdda537aaeeb3ec847a092492ddf822aa02d98f6be7
MD5 c14a86071a55358c3735c29c2d3465a2
BLAKE2b-256 51a5daba004f7fba69e49214b4a2826fe4e141cfb1ad4c5d5a30867a8df5f6b5

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: dimod-0.11.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.9

File hashes

Hashes for dimod-0.11.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8bb5f01a72ea9b86d8edc226b8a96930f45d6e968c2d3706c87ea6b64792af1a
MD5 10de078149d930ab429642caa7e487c3
BLAKE2b-256 84ee78df19b1114d72a7740e4894ef58af8e047e0771fa5c28c6ee6c6a1eb92d

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4877cad92243f29cc7c41b7f008f9d490cbf69c6f3609a955a97573c399692a7
MD5 fb84b8b455f202fb674ac08ef7c89604
BLAKE2b-256 91865a9b6d6f3b5385cfb93a47dfe026a70a3b68b710003b1cf77b628343eb83

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 89e3128cf5dfacf875d7ae69749a5a5e914e16798108f00f2a7b1dca2135eb61
MD5 5f42e5e6731908780b5e9141e1333947
BLAKE2b-256 88e4a5aa95e02412a4bed1a76a0f5f1a149a5cd2d1b3b4c3235f320c5b64aef4

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d750a8fac7695f710beb52ad508766dbf999affd7b3b5fa8d9ce7e786cbee582
MD5 c26f095e012659edd64b9fc78cb1ae34
BLAKE2b-256 4031ecb2fdb63e8e1d6e098ceb8432b4a368dcb8f1c246220ecf5ca03a95d293

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 53f12e4400194f112b6d642966e8b65299cb2af1701db2cfe0094503584916ed
MD5 8a2ba0d101340095c2a735194439e592
BLAKE2b-256 39f4d755f52d58061bef387445f1c4db86215010af830269596cabfd845f23af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dimod-0.11.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.9

File hashes

Hashes for dimod-0.11.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5f4d52b351cf4fb534d115a7a1f1f36dbd49c73dc3dbce4c504ebf52c3ec8a78
MD5 87a3dbc78b05e30597b54531b5f0266c
BLAKE2b-256 f1f7d598addcb5fb6ddb80d94ea03fd96d259b09de7d8f1d6b964806feedcc13

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9725aaf7904b74200d0a83862faff301a226b455880207d7a5b5bede2eb546f3
MD5 9ca4d6ed987819aa0c1966846229fce3
BLAKE2b-256 dab104a7d0da464bfcd14b44f65770633b0b93525c0e097daf3023d81726e79c

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 77989a8fbcfa4dd93275c13e2f3b5856fb5ba49d264a64a881d6a69ef4111c4c
MD5 70ab10ea5548eca88004b58bf958fb5d
BLAKE2b-256 3f37e80872d4ed012b25b0d533db619dbd35713518dd170c44abb3d84b1dde88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dimod-0.11.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2c5187c8ba725d6dacd9af6e30f34e8b8dda88362f4199eeed825f7081341676
MD5 3391ca73d3f4a7ef4264d001e7dd697e
BLAKE2b-256 a8486b59488859ede998c85e74a746bf3654dbed337d0cf0bcb3cd9c173b9731

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2d3649b4d088858918d2c3f516eeb08babc056a7177d824505e71764d6f121a7
MD5 42d4b20adc57357fffebc08e5ca3fa16
BLAKE2b-256 abb6ae784cd76b4383141737be266266be1f102c6a9596c33d7ecf683a2f98a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dimod-0.11.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 3.3 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.9

File hashes

Hashes for dimod-0.11.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 de9dcee0e0a6a6543db659a4f38b06af0b1a222477c5da8bc00a20edd81375d3
MD5 f758722ed53025bd87116f3e64c6a6b6
BLAKE2b-256 0cb8a5423651c36e570abe78f68f668cd2955bf0f3d9646c5e574abc27ecaf96

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 285966fd3ded9ffd00916bd3cdb454a865df3853112fedf5cc08126f2c5752b5
MD5 29aa2cd955c11fad10dba848e531c21b
BLAKE2b-256 0657fb7ff557c895f130080bb12fd9135759e51d8d4f1259e66b1e73442f5405

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 b3eb0476b2dc42e8d737ee21c970efe4cb51c1e9d1e79b3fbba2c71208ca813f
MD5 d500e7d5d91c49ea338c68ef81b16fd7
BLAKE2b-256 b9891910ef259534a1a7abbc826c1fb4351995292b5966feec771eed874f7ae8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dimod-0.11.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 34f58e1d1a03b0b458e7ea3a45fbeb66d0404c9b9ff5e1ae8a3d7e636eda51ff
MD5 c13d17b476b67e2225e131683c028c28
BLAKE2b-256 3b58f6f9b85b671dd7683047f12afeccc2324b35213ea8af93ea550dd7e7e8e2

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp38-cp38-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 63be63c49216859fd9cc042d903447276abb745869fd72d0e6c2d466d58a5ffa
MD5 21a5537859a4aeb11fa623672fa24dfd
BLAKE2b-256 0fed9a81ebeca06717bbd4c1511a97b3672524cede68258a2459589a44373008

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dimod-0.11.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.9

File hashes

Hashes for dimod-0.11.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 80bb031e21fd9e75c2063cf0db94d39729db2ace61b3b585477f3e675f98a876
MD5 c2f63e1641ce294f21f036e25a28b71a
BLAKE2b-256 e033d7e1ead2317e5cbd9ac55536187be6db2b299d094d9a7bd417d3195507b2

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5cc1865f73c88559cb9d0abe40e823c9cbae5fd8e418b9ce5fe55444eeff3c6c
MD5 6e4af8119c801753aa21e2f2f09d71cd
BLAKE2b-256 e1aa6659945ad3d3cbfaba416da0346082a1ed9567784bf3fb29ac268a349867

See more details on using hashes here.

File details

Details for the file dimod-0.11.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for dimod-0.11.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 95b52541e70eefa5f3418c5e2e20513b92ec52e4daaf562388c9b9b91a14a10c
MD5 b3b00c0efe49d220d87119ae46034406
BLAKE2b-256 0cd45761e4c7d6dcee66539479d1ee732f286db25a7d975100cb78448c05a9e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dimod-0.11.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 05a13630cd1f739dabd30e72566024b69b23d48090301e8473a4b1c4d5e9ade2
MD5 e090103e6de69b348cf70cb26b4b9847
BLAKE2b-256 1e514e68bc8471d72982618907c193fd7544b4748f6f28c73e2a73ea74b5191c

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