dwave-optimization is an open-source library for formulating nonlinear optimization models for use with D-Wave’s Stride™ hybrid solver. Models are constructed symbolically using an array-based syntax inspired by NumPy.
The package includes:
A class for nonlinear models used by the Stride quantum-classical hybrid nonlinear solver.
Model generators for common optimization problems.
Example Usage
The quadratic assignment problem problem is a combinatorial optimization problem. There are n facilities and n potential locations, a flow between each pair of facilities, and a distance between each pair of locations. The problem is to assign each facility to a location in order to minimize the sum of each distance multiplied by each matching flow.
This small example builds a quadratic assignment using dwave-optimization symbols. There is also a generator for this problem.
from dwave.optimization import Model
model = Model()
flows = model.constant([[0, 4, 2],
[3, 0, 7],
[1, 8, 0]])
distances = model.constant([[0, 1, 2],
[1, 0, 3],
[2, 3, 0]])
assignment = model.list(3)
model.minimize((flows * distances[assignment, :][:, assignment]).sum())
For explanations of the terminology, see the Ocean glossary.
For a discussion about performance, see Performance Benchmarks.
Installation
Installation from PyPI:
pip install dwave-optimization
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 --group blas
pip install --editable . \
--no-build-isolation \
--config-settings=editable-verbose=true \
--config-settings=setup-args="-Dblas=enabled"
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. 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 --group blas
meson setup build -Dbuildtype=debug -Dblas=enabled
You can then run the tests using meson’s test framework.
meson test -Cbuild
To run the doctests, install the docs requirements:
pip install --group docs
You can then run them using the docs/Makefile.
make -C docs doctest
Metadata
Release files for dwave-optimization 0.7.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dwave_optimization-0.7.3.tar.gz | 549.3 kB | Details |
Built distributions (wheels)
Total release size: 428.4 MB
Release files / dwave_optimization-0.7.3.tar.gz
| Download URL | dwave_optimization-0.7.3.tar.gz |
|---|---|
| Size | 549.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a610790c1a329bdc85e0db0c8d6e625f660969cd1f66cfd43a37d5b6f25fa7e
|
|
BLAKE2b-256 checksum How to use checksums |
6f3a74fc56d952b1549acac8920f02d8b3f7c34a3901829e891f4bed8ceb4bde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp315-cp315t-win_amd64.whl
| Download URL | dwave_optimization-0.7.3-cp315-cp315t-win_amd64.whl |
|---|---|
| Size | 9.6 MB |
| Tags | CPython 3.15 CPython 3.15 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
de5b1a2448b14d242186ef6d4fd6447e2978fed471efec93b4d33a7fd9b47678
|
|
BLAKE2b-256 checksum How to use checksums |
b796a5c5d952f6929871c189467f2e85bc1c293ff07650077aa711adaf5e10f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp315-cp315t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dwave_optimization-0.7.3-cp315-cp315t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 15.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 |
790175690c879a59ad069e18cacbdbad509d2fef801ebee6c36799b2460a6d3f
|
|
BLAKE2b-256 checksum How to use checksums |
7948e6b16d69287a1dd24f7f35ec62e49c1225ffb34c406812e544bd53f9e8e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp315-cp315t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | dwave_optimization-0.7.3-cp315-cp315t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 16.2 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 |
c2f3e1accdf72c3151d036d57bc3eb4481bb34aa20561a9c674e4fdee283cb67
|
|
BLAKE2b-256 checksum How to use checksums |
cf41eab6753b47a95d03a18cd1f09a8f7b5e8fdcf5bfb4ddc51a5dc280dd4d0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp315-cp315t-macosx_11_0_arm64.whl
| Download URL | dwave_optimization-0.7.3-cp315-cp315t-macosx_11_0_arm64.whl |
|---|---|
| Size | 22.2 MB |
| Tags | CPython 3.15 CPython 3.15 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e23108cb529a98f1b616a6c3ba508d09683473ef903933dc399ac86e7e3ffdc9
|
|
BLAKE2b-256 checksum How to use checksums |
18031a487d225fb6f281bcb9afd7190613aef2aee831d02f1aa7ce84ecdfe966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp315-cp315t-macosx_10_15_x86_64.whl
| Download URL | dwave_optimization-0.7.3-cp315-cp315t-macosx_10_15_x86_64.whl |
|---|---|
| Size | 22.3 MB |
| Tags | CPython 3.15 CPython 3.15 free-threading macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
9768308822dc492439aa1666a8d9b372971d98289db682241c43ff665c8ad861
|
|
BLAKE2b-256 checksum How to use checksums |
c97e25d803ddd7f74a94ba08c51b55c715f9400a4095f4d9e6ff960c8035359e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp314-cp314t-win_amd64.whl
| Download URL | dwave_optimization-0.7.3-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 9.6 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
de3555ebd71ae2b0c002300a1f8940ecfe7f2506d358ac5468aab858d2973a21
|
|
BLAKE2b-256 checksum How to use checksums |
c162da7185e49f17219b647e8234461c85dcd7c92b7998f19faed26b69e89054
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dwave_optimization-0.7.3-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 15.9 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 |
cede90aa32e13cdd39de2f29bddf473e99cb250a101424b1f4b855f3e89c4ffb
|
|
BLAKE2b-256 checksum How to use checksums |
8ea486773470648cb5b40f2ea1fcb415a533fb1f83c240a7091de37dec682b6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | dwave_optimization-0.7.3-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 16.2 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 |
e99f36f9129f3843af796c2d8f070a6938caf32bdd6e91f86f9b8cca5a487171
|
|
BLAKE2b-256 checksum How to use checksums |
1b37528f6b119fa536fb9deed11307fd9658c421568571efd2302535e5afc904
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp314-cp314t-macosx_11_0_arm64.whl
| Download URL | dwave_optimization-0.7.3-cp314-cp314t-macosx_11_0_arm64.whl |
|---|---|
| Size | 22.2 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
47d010c75d123aba10e2ebb5aa47581537e89b329885ee9b68c834e01005e680
|
|
BLAKE2b-256 checksum How to use checksums |
da6f3bebcd7268fa0b927c3184d5f11ce811de6db6c738436ef5725d39030ca4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp314-cp314t-macosx_10_15_x86_64.whl
| Download URL | dwave_optimization-0.7.3-cp314-cp314t-macosx_10_15_x86_64.whl |
|---|---|
| Size | 22.3 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
b6d138723de2252a241b861d431704dad3c3c0a3bd0a7497a85e4db24afa9d70
|
|
BLAKE2b-256 checksum How to use checksums |
8cd00585872f448716b10dbb91feda0711a567b359dd3b9d1836a1aac8c2d515
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp312-abi3-win_amd64.whl
| Download URL | dwave_optimization-0.7.3-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 9.2 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c0a6423b3b5f3dc9f42f517d4fc8d677a03a580a4a049985ad9170f9a9acf80e
|
|
BLAKE2b-256 checksum How to use checksums |
202bfaf020e1ef160ea3335976c13a054b32f8e390fbcf9a160c17ed848764d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dwave_optimization-0.7.3-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 15.3 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 |
1aff7de15dd3e2805e8f3759c1634a79b1cf44dfd23ba3ca427ddf9c3452a408
|
|
BLAKE2b-256 checksum How to use checksums |
aadb11f2f81454668ee2c6a640d54a7cce95a877981f870fb7a7f1b4d7c11d92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp312-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | dwave_optimization-0.7.3-cp312-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 15.6 MB |
| Tags | CPython 3.12 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
5458459e587f44d5136c374f3b613f293f4d80c91873edf35a14d31a1cceaf7f
|
|
BLAKE2b-256 checksum How to use checksums |
c906ba7494698039b8c609c09fafaabe20ae9ab831ea56854efb9556b3da345d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | dwave_optimization-0.7.3-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 21.9 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2f5175d8a8c8495de8a283a0e00ff9e149975744a7561f0d40b1c8cb429b792b
|
|
BLAKE2b-256 checksum How to use checksums |
04473741228b977c693a79cf03c587b7c42d5f4410cff03f92589287e034e9e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp312-abi3-macosx_10_13_x86_64.whl
| Download URL | dwave_optimization-0.7.3-cp312-abi3-macosx_10_13_x86_64.whl |
|---|---|
| Size | 22.1 MB |
| Tags | CPython 3.12 abi3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
0ea40fb4557341727dce6cac8b2ada76e6165bc5ac003cd9cc2308e60a3b07ac
|
|
BLAKE2b-256 checksum How to use checksums |
00d3068e5d19217f5dff788394de830507b48e6b53c7e4defd60e7f8057dc91a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp311-cp311-win_amd64.whl
| Download URL | dwave_optimization-0.7.3-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 9.3 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
65655d1907d14a81ef2ca5d2060df91a5486e0aedf0e1b669dd07eae2a9e1604
|
|
BLAKE2b-256 checksum How to use checksums |
d25f2096a998291a204864c3df3334979842b4434ce705d213095025bb6adc6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dwave_optimization-0.7.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 15.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 |
b9a8628c64f9d44260f0e595f67af1fb9f7aed81152adefe70257c5100c79838
|
|
BLAKE2b-256 checksum How to use checksums |
70091205e55328dcbba495e79311f39086b5b1841089c4dfa01f80d773db9c85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | dwave_optimization-0.7.3-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 16.3 MB |
| Tags | CPython 3.11 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
28ead37ef6dc930112cd36a97a6a33123598cd4050c8aeda3cb988f4f019ee77
|
|
BLAKE2b-256 checksum How to use checksums |
f7422e2e08d8e09f303f9cea2dc5a8f47d21891cb165e3ec14fad7f71d558dbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | dwave_optimization-0.7.3-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 22.1 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c9281799591a2142d090658ba55dc35aa7b809f8888e859378e5ca3e6af25b12
|
|
BLAKE2b-256 checksum How to use checksums |
15f1e3588050dac164936386077afc106d7bd38f21a20c1ce5351674e422006d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp311-cp311-macosx_10_13_x86_64.whl
| Download URL | dwave_optimization-0.7.3-cp311-cp311-macosx_10_13_x86_64.whl |
|---|---|
| Size | 22.2 MB |
| Tags | CPython 3.11 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
e672cbef58bdfa9e9f4b8378a1fb246008ffb18431f77a15aa7882952d03e8ea
|
|
BLAKE2b-256 checksum How to use checksums |
07addd8e48c5806f66984e0fb031617a8661c88abaf3edcd388a0abd8d3e1679
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp310-cp310-win_amd64.whl
| Download URL | dwave_optimization-0.7.3-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 9.3 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fc3ee4d8d1e2b7e1d3362f05538f1ca82c00e900169a955880a0e3bf144b2ab9
|
|
BLAKE2b-256 checksum How to use checksums |
e0f20ee051ff840b87633d4d49b56c9f3161cfa516dc92ba2312e092453f473f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | dwave_optimization-0.7.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 15.8 MB |
| Tags | CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
75c02ef63cf078d28a3806c41a2809110f16ce5204a6daafbc07b8f49a0d502f
|
|
BLAKE2b-256 checksum How to use checksums |
524472d2b25be7e9533dfe6a92c3b244854ad62c19ceb98950a9fd26351251e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
| Download URL | dwave_optimization-0.7.3-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 16.2 MB |
| Tags | CPython 3.10 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
34b9f0db00884f819bc1cd2560a672ebc8b572d0f693bcabedd4a4872bd393c4
|
|
BLAKE2b-256 checksum How to use checksums |
4a7662dae60e2b80bce1d3e4418e1bfc6e3947dd7e9e6f612445479cf46958dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | dwave_optimization-0.7.3-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 22.1 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6a3a2c98a64e2d00b0240f95646a0fc3086439ba298c63470f75bbba9e7efafb
|
|
BLAKE2b-256 checksum How to use checksums |
536b1c03831f890efb739bb65f53a80377d54851250d8a7fcaead8421b95050f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / dwave_optimization-0.7.3-cp310-cp310-macosx_10_13_x86_64.whl
| Download URL | dwave_optimization-0.7.3-cp310-cp310-macosx_10_13_x86_64.whl |
|---|---|
| Size | 22.2 MB |
| Tags | CPython 3.10 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
e86299b33740cbc66c9cff1822e199a9e79128d1f1f235f9f114f63a5a44b626
|
|
BLAKE2b-256 checksum How to use checksums |
3d5137f532470c27d50557b3391337a31278602978decd45566a00722ce2c7a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|