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 quantum computer—and higher-order (non-quadratic) models.
Reference examples of samplers and composed samplers.
Abstract base classes for constructing new samplers and composed samplers.
>>> 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]
For explanations of the terminology, see the Ocean glossary.
See the documentation for more examples.
Installation
Installation from PyPI:
pip install dimod
During package development, it is often convenient to use an editable install. See meson-python’s editable installs for more details.
pip install --group dev
pip install --editable . \
--no-build-isolation \
--config-settings=editable-verbose=true
Testing
All code should be thoroughly tested and all pull requests should include tests.
To run the Python tests, first install the package using an editable install as described above. You will also need to install additional dependencies for the tests.
pip install --group tests
The tests can then be run with unittest.
python -m unittest
To run the C++ tests, first install the project dependencies, then setup a meson build directory. You must configure the build as a debug build for the tests to run.
pip install --group dev
meson setup build -Dbuildtype=debug
You can then run the tests using meson’s test framework.
meson test -Cbuild
Metadata
Release files for dimod 0.12.23
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dimod-0.12.23.tar.gz | 604.3 kB | Without provenance | Details for dimod-0.12.23.tar.gz |
Built distributions (wheels)
Total release size: 75.5 MB
Release files / dimod-0.12.23.tar.gz
| Download URL | dimod-0.12.23.tar.gz |
|---|---|
| Size | 604.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8b360b036680b1332c9257d7dfd1094c50039cc576488ceae9d07a1cb86ebae
|
|
BLAKE2b-256 checksum How to use checksums |
218351cd1ce027f85760774146d3566136bca2d7284db7e4cca7499b507dc50d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp315-cp315t-win_amd64.whl
| Download URL | dimod-0.12.23-cp315-cp315t-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.15 CPython 3.15 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
335bc68b3a35b7ffb1242a003b099303f8ac5e649f06c05818189ef93dfbe69a
|
|
BLAKE2b-256 checksum How to use checksums |
29676d4bfd3b5dbe1354991b8fe987c1118a76bcda69c72b68c71676eb5ede04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp315-cp315t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dimod-0.12.23-cp315-cp315t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.15 CPython 3.15 free-threading Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
65961f73e5283f367671b7d91156e6a681d607dd332899bcabecb8a7f0c7faf7
|
|
BLAKE2b-256 checksum How to use checksums |
b74b892d7750edba0564c77e8d794722298c83f1965d82f9f24e78e83a8237c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp315-cp315t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | dimod-0.12.23-cp315-cp315t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.15 CPython 3.15 free-threading Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
f90e913f21f79feb3cc565464842a347e22758f381bb0c1a1da3652a51082e95
|
|
BLAKE2b-256 checksum How to use checksums |
615a569109559f72f3c494bd05f8ef010f666e68cd716af625c80acb93112b2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp315-cp315t-macosx_11_0_arm64.whl
| Download URL | dimod-0.12.23-cp315-cp315t-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.15 CPython 3.15 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4387dbcd5619a50bb4af423b4d3fbb28539b6f38102bb65bee71e6cdab1a4250
|
|
BLAKE2b-256 checksum How to use checksums |
f6665126d76417740af8ed72fede30c0823c67957c5c53fe28f688534b71e475
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp315-cp315t-macosx_10_15_x86_64.whl
| Download URL | dimod-0.12.23-cp315-cp315t-macosx_10_15_x86_64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.15 CPython 3.15 free-threading macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
60430e65b4ec91075237b5f31950233ec05abbaca4190787438185299c6c543d
|
|
BLAKE2b-256 checksum How to use checksums |
d264af43762e2a8cf5d97f418fe7e0096cb9dcc2d038ca39a28ba846bda5b99b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp314-cp314t-win_amd64.whl
| Download URL | dimod-0.12.23-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3fbf3583c9ad32a9e98c288e301cb7be093626d777abeb665ea6947dfc7f4765
|
|
BLAKE2b-256 checksum How to use checksums |
2fd178f419e56f6486b6e1aa50ec828187143f163649cf4e6aa90ce00c7d8ef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dimod-0.12.23-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
4dd04fec7acc13981ad9aeb45f5133a049ca14bb2f0f6ad217f9bd954e7cf182
|
|
BLAKE2b-256 checksum How to use checksums |
cc66b24dab0638c02c1393414af2a28fa5bec50ef9582008287419ad5c96a82b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | dimod-0.12.23-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
68aa32487f75fdcc767e2aa3b8ad48f949f4de46bf8711a3af4fb965c4874b9c
|
|
BLAKE2b-256 checksum How to use checksums |
676cfab14609d9ffb0cc905b6d8ed865108e9c236c59036d081d34d1747f8c42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp314-cp314t-macosx_11_0_arm64.whl
| Download URL | dimod-0.12.23-cp314-cp314t-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
08feddf6d96c660fd25818ec9c4f6b227eb1685f6053a76859c9a475f213f130
|
|
BLAKE2b-256 checksum How to use checksums |
7223343840874b28e139fe6d01c97ccb6ca5474ddc0f22994abda0513c799290
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp314-cp314t-macosx_10_15_x86_64.whl
| Download URL | dimod-0.12.23-cp314-cp314t-macosx_10_15_x86_64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
c8f46803601c6c7221926ce5c3ecd2ea0ea6c71aed2ac687e34d77bd28c83153
|
|
BLAKE2b-256 checksum How to use checksums |
62ec0ac8e95db4aa6823a3bd6b64dd23d20b1edac1d539aa55c6bb6605cb942c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp312-abi3-win_amd64.whl
| Download URL | dimod-0.12.23-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ab41d4c4f52f8accf96d80e21a24871431ca47030f488be9a4e3db3fc94ac3f4
|
|
BLAKE2b-256 checksum How to use checksums |
3796a6dd565053d6e9c7942a4a638ed0d1aba360f40e44532f37ed15127d3343
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dimod-0.12.23-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5842d06ef64e4be0ceec5706ae58f3893f3975462ee43ea7f99bd2b9a89da323
|
|
BLAKE2b-256 checksum How to use checksums |
89ffa0fc51023b7b622e3b1667cde8f841855754eecd074332e1ba0822ec2190
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp312-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | dimod-0.12.23-cp312-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.12 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
46ddd1de9697e1ee3d74a39b8ee52233c98b557f1b44be7cf3d871fb83b94d8e
|
|
BLAKE2b-256 checksum How to use checksums |
e687775a69a6ff6d993eb971e05f6f0908802f9f907fbad0815f093edc9a059e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | dimod-0.12.23-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4bc43c8ade83f54a816b63127722f1b74811dd09b24e2c63cfc409f3866df7e7
|
|
BLAKE2b-256 checksum How to use checksums |
106dc9ecda4d621f6f3b4b53ca711738d0b35e162a5a409304db441a82af6c21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp312-abi3-macosx_10_13_x86_64.whl
| Download URL | dimod-0.12.23-cp312-abi3-macosx_10_13_x86_64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.12 abi3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
e1d5c5deb052229e4136fbf74ff307274f3a06dc65d7eeb8ca339b9f67526b9a
|
|
BLAKE2b-256 checksum How to use checksums |
b6dcb9fa603d0b5e5b0f9d5474d3305a3e02e36c2c24085f7c106f31264f1bb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp311-cp311-win_amd64.whl
| Download URL | dimod-0.12.23-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
21e64c498e9d1fb41a7231d232e7e154b689e4d35d63f3b16073761b56eb4fdd
|
|
BLAKE2b-256 checksum How to use checksums |
4b295f60de29a3ade05ee9318c0ffddd4739a1c6b6f6dca27a9e773d2622dd00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dimod-0.12.23-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
bed06f26b9264199bf4043669ae2a43b3c1fe6becc3344c1311f66449b2cd1aa
|
|
BLAKE2b-256 checksum How to use checksums |
65f23b37e343f28b4a64038ab17ab77d74536282e7707ea9d7efae5691c564eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | dimod-0.12.23-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.11 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
7f5496084a9e60cf2c93d0ef1833e5471f6b77b1a16debb252cd91c089d9e568
|
|
BLAKE2b-256 checksum How to use checksums |
fc5b61c70f984356ac578e7648ac8ba240a4b6a206a3cfed0a908f5c5302b64e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | dimod-0.12.23-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c11820d7a2eff8c6df7fb6be4a8515047193c79b6d9f33572772417a426a21d9
|
|
BLAKE2b-256 checksum How to use checksums |
5fca3b9a6c56ae372700b35859d8d509813a620f16cd9ce4069aa303113cb949
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / dimod-0.12.23-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | dimod-0.12.23-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
48c9395f592560a662600ce3e59d103e9672f3250411273aaa937aa26676dfe6
|
|
BLAKE2b-256 checksum How to use checksums |
e779b5d0bb06dd61829c3d1ce832fd78e9880037f0a691d51bb27a0acd05d4d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Security for dimod 0.12.23
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.