Skip to main content
https://img.shields.io/pypi/v/dwave-optimization.svg?style=svg https://img.shields.io/pypi/pyversions/dwave-optimization.svg?style=svg https://circleci.com/gh/dwavesystems/dwave-optimization.svg?style=svg https://raw.githubusercontent.com/dwavesystems/dwave-optimization/main/docs/_images/optimization/stride_logo_blue_light_dark.svg

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.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dwave-optimization 0.8.0
File Size Uploaded Provenance
dwave_optimization-0.8.0.tar.gz 554.4 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for dwave-optimization 0.8.0
File
dwave_optimization-0.8.0-cp315-cp315t-win_amd64.whl CPython 3.15 CPython 3.15 free-threading Windows x86-64 Details
dwave_optimization-0.8.0-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 free-threading Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
dwave_optimization-0.8.0-cp315-cp315t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.15 CPython 3.15 free-threading Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details
dwave_optimization-0.8.0-cp315-cp315t-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 free-threading macOS 11.0+ ARM64 Details
dwave_optimization-0.8.0-cp315-cp315t-macosx_10_15_x86_64.whl CPython 3.15 CPython 3.15 free-threading macOS 10.15+ x86-64 Details
dwave_optimization-0.8.0-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details
dwave_optimization-0.8.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
dwave_optimization-0.8.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details
dwave_optimization-0.8.0-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details
dwave_optimization-0.8.0-cp314-cp314t-macosx_10_15_x86_64.whl CPython 3.14 CPython 3.14 free-threading macOS 10.15+ x86-64 Details
dwave_optimization-0.8.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
dwave_optimization-0.8.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
dwave_optimization-0.8.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details
dwave_optimization-0.8.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
dwave_optimization-0.8.0-cp312-abi3-macosx_10_13_x86_64.whl CPython 3.12 abi3 macOS 10.13+ x86-64 Details
dwave_optimization-0.8.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
dwave_optimization-0.8.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
dwave_optimization-0.8.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ ARM64, Linux glibc 2.28+ ARM64 Details
dwave_optimization-0.8.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
dwave_optimization-0.8.0-cp311-cp311-macosx_10_13_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.13+ x86-64 Details

Total release size: 319.4 MB

Release files / dwave_optimization-0.8.0.tar.gz

Download URL dwave_optimization-0.8.0.tar.gz
Size 554.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cb8ce7d4277639fa70da2da6eaeebd2dd88157c3bd176af9d6e6bcee17bee509
BLAKE2b-256 checksum
How to use checksums
d2c293af3c693eb2e09c21b23b8844c030e8e9eb0ec7cae7765a47c1112f1317
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp315-cp315t-win_amd64.whl

Download URL dwave_optimization-0.8.0-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
0bfe2d56d46b35624fff0345934cba62ab27871379df5e81199dbbe19a9b5f39
BLAKE2b-256 checksum
How to use checksums
e9dbc10fe40d811b215052619fdcb46b3903aa633362bbdd8c885eb3c8f86a58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL dwave_optimization-0.8.0-cp315-cp315t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 15.8 MB
Tags CPython 3.15 CPython 3.15 free-threading Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
945e2604ada9cc0d0c9e62a3bea3e69c2955b75ccfe48de86b7b8b2b8b276e07
BLAKE2b-256 checksum
How to use checksums
0e23ede7282447d1467c1e383970f102965aa48cf4548331629a22d84b0b8984
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp315-cp315t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL dwave_optimization-0.8.0-cp315-cp315t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 16.0 MB
Tags CPython 3.15 CPython 3.15 free-threading Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
f49e71d8d8734668e503b9280d62f3a93e26547f1b4167a4c67da859ea7c15d7
BLAKE2b-256 checksum
How to use checksums
e428ae3a59ecc74b68bacf1232a7efcbb6235b463e881c07332aa42cc0db5ef8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp315-cp315t-macosx_11_0_arm64.whl

Download URL dwave_optimization-0.8.0-cp315-cp315t-macosx_11_0_arm64.whl
Size 19.4 MB
Tags CPython 3.15 CPython 3.15 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2d44b462efd3e6714a8938411332c141c8daa026b03a9ec9c9e308aca0fe99d2
BLAKE2b-256 checksum
How to use checksums
df95f2d6c4de14bb90770f5eef0c65db9f4372989234513f864c6db93bc8cfba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp315-cp315t-macosx_10_15_x86_64.whl

Download URL dwave_optimization-0.8.0-cp315-cp315t-macosx_10_15_x86_64.whl
Size 19.5 MB
Tags CPython 3.15 CPython 3.15 free-threading macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
588a55c7ef5246ac3f8e6ec678acf9f0820d7d2325c38cfbd6e9577a1a751cb6
BLAKE2b-256 checksum
How to use checksums
2e48a38294c9d1688b9aa530f32780e33cc60ac93d3d5681aae61e7e6c8995d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp314-cp314t-win_amd64.whl

Download URL dwave_optimization-0.8.0-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
b7111b178228740f80423449c95a45ee1ec4b90fa50496df75aaf1e409ba9643
BLAKE2b-256 checksum
How to use checksums
5e5bb8cc6904bdc029b98e840f6c2387b6a9203b4ed8af685aede9f666e1f5bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL dwave_optimization-0.8.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 15.8 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9cd7259f6341139868e20e0580129ff954ac8bd6c702e946e93c734892af4ae5
BLAKE2b-256 checksum
How to use checksums
76aeab7cc88b2db6f4f80cc1958b679f6f95f2db55bec27e56bbbd6d139b2b38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL dwave_optimization-0.8.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 16.1 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
1e614c7d24cfc7312161fbd3ea97ea0ec9de8a85943b9b629eca9f6aa9406909
BLAKE2b-256 checksum
How to use checksums
e7e15e0e88d7cba390d520c8486e86b2ad59ce021d27d7851f7f1215066b7a51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp314-cp314t-macosx_11_0_arm64.whl

Download URL dwave_optimization-0.8.0-cp314-cp314t-macosx_11_0_arm64.whl
Size 19.4 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7fe4096e51fb08c82bdcfe09719cef6b9bcee4578d045dadf5c766a4939a31ab
BLAKE2b-256 checksum
How to use checksums
af5450465f4294b95c6ac71b07a956177a0dd202bf4ec4650e55281a8d60d0b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp314-cp314t-macosx_10_15_x86_64.whl

Download URL dwave_optimization-0.8.0-cp314-cp314t-macosx_10_15_x86_64.whl
Size 19.5 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
a943ed80f4a99e5d2ea6b1c5e93f04777409a0411691191c5db6d0d43c535ae8
BLAKE2b-256 checksum
How to use checksums
d4efac49af8e1d779ca051cf930ee25b55db6c7409c72fa368961f73039bc63f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp312-abi3-win_amd64.whl

Download URL dwave_optimization-0.8.0-cp312-abi3-win_amd64.whl
Size 9.2 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ea5fba53f4f2a20482cee411276c2a5635344f83cc320e738074eb28fe644a25
BLAKE2b-256 checksum
How to use checksums
0cabd994a890987fd514fb045362eaa26c3e5878d61fbdb2a52ad62f5dcc7ab5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL dwave_optimization-0.8.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 15.2 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
b899944c4cf9ebcde1ebfff983a3355eb98f11907ed4d3cd942faeb7babbdfb0
BLAKE2b-256 checksum
How to use checksums
f6844e7bb479170ace0f6ac8f72fae4efbe541f9293c7fe18fcd9301db2f70a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL dwave_optimization-0.8.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 15.5 MB
Tags CPython 3.12 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
3ee89ccbe8d60e2c09358ace04d9e7f896854b88b805b28a57e22ba7013c4a8c
BLAKE2b-256 checksum
How to use checksums
4ebd0d56055d14bc5c6f6da51b6b9e65c868da830960cbe67ab7fa1e22ec5888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL dwave_optimization-0.8.0-cp312-abi3-macosx_11_0_arm64.whl
Size 19.1 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d3caedb7d66c54c8ef8cf723e2ffe72f82cf6bd570a85dc73d356a9fc854be42
BLAKE2b-256 checksum
How to use checksums
df79a28b50bd1796c7d9eb68b77e608a1fc98fdd90f43737de0e1884e9d5702c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp312-abi3-macosx_10_13_x86_64.whl

Download URL dwave_optimization-0.8.0-cp312-abi3-macosx_10_13_x86_64.whl
Size 19.2 MB
Tags CPython 3.12 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
da5d567f0c2e9fc3f3c4217ff2ac73dc9c29f72b5c3ef32afdd741bba7488308
BLAKE2b-256 checksum
How to use checksums
e5267683a0d0ade30f81a1dbbff0c4c6c3c423a9f5f5b05a9268f4719d67e557
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp311-cp311-win_amd64.whl

Download URL dwave_optimization-0.8.0-cp311-cp311-win_amd64.whl
Size 9.3 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
6b755a1349c615128299394913501941eed3f419987a4afee5304804b03a6dae
BLAKE2b-256 checksum
How to use checksums
c0ba7713a0cb3206c1b2dc246c1afd94bfff9128216b5b5c130bfe1435af84e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL dwave_optimization-0.8.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 15.8 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c07debdcb0743fcc09ab51ec2adeb42e4c4a3dcac1448639e7ee43148748da63
BLAKE2b-256 checksum
How to use checksums
014cc398f3884dec612da1b4341f1e5fe5817cc2e5f4e0d83b646a64e31f680d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL dwave_optimization-0.8.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 16.2 MB
Tags CPython 3.11 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
01ad438dcbcb389af32bad808f1a8e29913c70e6261b6286300c8e362073e3b1
BLAKE2b-256 checksum
How to use checksums
d9998022574e3cc13542d335bdbb2c8258f4bdd31282ac89448016f50733de64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL dwave_optimization-0.8.0-cp311-cp311-macosx_11_0_arm64.whl
Size 19.3 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
46355d25f53f7551606e4d6b6d6ed10093983f7d95721541a27db62b342f3047
BLAKE2b-256 checksum
How to use checksums
7f43bbf43da5f296316a83dbc7d9f9fa4ade54a1fae0ec2f3dffaf350117eeaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / dwave_optimization-0.8.0-cp311-cp311-macosx_10_13_x86_64.whl

Download URL dwave_optimization-0.8.0-cp311-cp311-macosx_10_13_x86_64.whl
Size 19.4 MB
Tags CPython 3.11 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
7af47c6d345ad1c9a875c49342420d47eba9df9b2aee3b503c8431ea34518be2
BLAKE2b-256 checksum
How to use checksums
96b13eb2372fd46a69496bbba3f64a67de7657f0e6f53c2cb3779b88855d51eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for dwave-optimization 0.8.0

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.

Release history Release notifications | RSS feed

This release

0.8.0 This release

21 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page