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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dwave_optimization-0.7.3.tar.gz (549.3 kB view details)

Uploaded Source

Built Distributions

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

dwave_optimization-0.7.3-cp315-cp315t-win_amd64.whl (9.6 MB view details)

Uploaded CPython 3.15tWindows x86-64

dwave_optimization-0.7.3-cp315-cp315t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.8 MB view details)

Uploaded CPython 3.15tmanylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dwave_optimization-0.7.3-cp315-cp315t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (16.2 MB view details)

Uploaded CPython 3.15tmanylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

dwave_optimization-0.7.3-cp315-cp315t-macosx_11_0_arm64.whl (22.2 MB view details)

Uploaded CPython 3.15tmacOS 11.0+ ARM64

dwave_optimization-0.7.3-cp315-cp315t-macosx_10_15_x86_64.whl (22.3 MB view details)

Uploaded CPython 3.15tmacOS 10.15+ x86-64

dwave_optimization-0.7.3-cp314-cp314t-win_amd64.whl (9.6 MB view details)

Uploaded CPython 3.14tWindows x86-64

dwave_optimization-0.7.3-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.9 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dwave_optimization-0.7.3-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (16.2 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

dwave_optimization-0.7.3-cp314-cp314t-macosx_11_0_arm64.whl (22.2 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

dwave_optimization-0.7.3-cp314-cp314t-macosx_10_15_x86_64.whl (22.3 MB view details)

Uploaded CPython 3.14tmacOS 10.15+ x86-64

dwave_optimization-0.7.3-cp312-abi3-win_amd64.whl (9.2 MB view details)

Uploaded CPython 3.12+Windows x86-64

dwave_optimization-0.7.3-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.3 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dwave_optimization-0.7.3-cp312-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (15.6 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

dwave_optimization-0.7.3-cp312-abi3-macosx_11_0_arm64.whl (21.9 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

dwave_optimization-0.7.3-cp312-abi3-macosx_10_13_x86_64.whl (22.1 MB view details)

Uploaded CPython 3.12+macOS 10.13+ x86-64

dwave_optimization-0.7.3-cp311-cp311-win_amd64.whl (9.3 MB view details)

Uploaded CPython 3.11Windows x86-64

dwave_optimization-0.7.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dwave_optimization-0.7.3-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (16.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

dwave_optimization-0.7.3-cp311-cp311-macosx_11_0_arm64.whl (22.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

dwave_optimization-0.7.3-cp311-cp311-macosx_10_13_x86_64.whl (22.2 MB view details)

Uploaded CPython 3.11macOS 10.13+ x86-64

dwave_optimization-0.7.3-cp310-cp310-win_amd64.whl (9.3 MB view details)

Uploaded CPython 3.10Windows x86-64

dwave_optimization-0.7.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

dwave_optimization-0.7.3-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (16.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

dwave_optimization-0.7.3-cp310-cp310-macosx_11_0_arm64.whl (22.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

dwave_optimization-0.7.3-cp310-cp310-macosx_10_13_x86_64.whl (22.2 MB view details)

Uploaded CPython 3.10macOS 10.13+ x86-64

File details

Details for the file dwave_optimization-0.7.3.tar.gz.

File metadata

  • Download URL: dwave_optimization-0.7.3.tar.gz
  • Upload date:
  • Size: 549.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.21

File hashes

Hashes for dwave_optimization-0.7.3.tar.gz
Algorithm Hash digest
SHA256 2a610790c1a329bdc85e0db0c8d6e625f660969cd1f66cfd43a37d5b6f25fa7e
MD5 caad8cb9d5c4486ee44fe8d4015fae3e
BLAKE2b-256 6f3a74fc56d952b1549acac8920f02d8b3f7c34a3901829e891f4bed8ceb4bde

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp315-cp315t-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp315-cp315t-win_amd64.whl
Algorithm Hash digest
SHA256 de5b1a2448b14d242186ef6d4fd6447e2978fed471efec93b4d33a7fd9b47678
MD5 026b0033160e93e14d6f5981297b4397
BLAKE2b-256 b796a5c5d952f6929871c189467f2e85bc1c293ff07650077aa711adaf5e10f0

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp315-cp315t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp315-cp315t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 790175690c879a59ad069e18cacbdbad509d2fef801ebee6c36799b2460a6d3f
MD5 5e44e0695249e31668add050f937c300
BLAKE2b-256 7948e6b16d69287a1dd24f7f35ec62e49c1225ffb34c406812e544bd53f9e8e2

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp315-cp315t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp315-cp315t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c2f3e1accdf72c3151d036d57bc3eb4481bb34aa20561a9c674e4fdee283cb67
MD5 3375f3ebdda8278eda14106a430ab75e
BLAKE2b-256 cf41eab6753b47a95d03a18cd1f09a8f7b5e8fdcf5bfb4ddc51a5dc280dd4d0b

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp315-cp315t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp315-cp315t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e23108cb529a98f1b616a6c3ba508d09683473ef903933dc399ac86e7e3ffdc9
MD5 707f42942bdcd772e6f43a2a2b1695f9
BLAKE2b-256 18031a487d225fb6f281bcb9afd7190613aef2aee831d02f1aa7ce84ecdfe966

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp315-cp315t-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp315-cp315t-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 9768308822dc492439aa1666a8d9b372971d98289db682241c43ff665c8ad861
MD5 0bd399e6e9b3b7cf076d98bc5ec7076e
BLAKE2b-256 c97e25d803ddd7f74a94ba08c51b55c715f9400a4095f4d9e6ff960c8035359e

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 de3555ebd71ae2b0c002300a1f8940ecfe7f2506d358ac5468aab858d2973a21
MD5 a4fd6e7cb179133854bd36eb7a9b5f25
BLAKE2b-256 c162da7185e49f17219b647e8234461c85dcd7c92b7998f19faed26b69e89054

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cede90aa32e13cdd39de2f29bddf473e99cb250a101424b1f4b855f3e89c4ffb
MD5 dd78c9b3e23c0910270e0d5ecd88cf6a
BLAKE2b-256 8ea486773470648cb5b40f2ea1fcb415a533fb1f83c240a7091de37dec682b6a

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e99f36f9129f3843af796c2d8f070a6938caf32bdd6e91f86f9b8cca5a487171
MD5 d1b4a4c813848ec0898df8cd1cd4d1a3
BLAKE2b-256 1b37528f6b119fa536fb9deed11307fd9658c421568571efd2302535e5afc904

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 47d010c75d123aba10e2ebb5aa47581537e89b329885ee9b68c834e01005e680
MD5 3237e437f0a01c799f83e5221527fcef
BLAKE2b-256 da6f3bebcd7268fa0b927c3184d5f11ce811de6db6c738436ef5725d39030ca4

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp314-cp314t-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp314-cp314t-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 b6d138723de2252a241b861d431704dad3c3c0a3bd0a7497a85e4db24afa9d70
MD5 e415459f45b109657c952c42796fedb6
BLAKE2b-256 8cd00585872f448716b10dbb91feda0711a567b359dd3b9d1836a1aac8c2d515

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp312-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c0a6423b3b5f3dc9f42f517d4fc8d677a03a580a4a049985ad9170f9a9acf80e
MD5 ce8505fc2c37b80b2ddc453d0aef5ecb
BLAKE2b-256 202bfaf020e1ef160ea3335976c13a054b32f8e390fbcf9a160c17ed848764d0

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1aff7de15dd3e2805e8f3759c1634a79b1cf44dfd23ba3ca427ddf9c3452a408
MD5 ec7c48b7bc38d7eea1ecef69d97d5c8f
BLAKE2b-256 aadb11f2f81454668ee2c6a640d54a7cce95a877981f870fb7a7f1b4d7c11d92

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp312-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp312-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5458459e587f44d5136c374f3b613f293f4d80c91873edf35a14d31a1cceaf7f
MD5 48158fb4787deb12d4490ab0cf850df3
BLAKE2b-256 c906ba7494698039b8c609c09fafaabe20ae9ab831ea56854efb9556b3da345d

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f5175d8a8c8495de8a283a0e00ff9e149975744a7561f0d40b1c8cb429b792b
MD5 643bb83acbd7b722973be0e8e299e51c
BLAKE2b-256 04473741228b977c693a79cf03c587b7c42d5f4410cff03f92589287e034e9e0

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp312-abi3-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp312-abi3-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 0ea40fb4557341727dce6cac8b2ada76e6165bc5ac003cd9cc2308e60a3b07ac
MD5 ea3a8c51ad647002c59690a2979020c4
BLAKE2b-256 00d3068e5d19217f5dff788394de830507b48e6b53c7e4defd60e7f8057dc91a

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 65655d1907d14a81ef2ca5d2060df91a5486e0aedf0e1b669dd07eae2a9e1604
MD5 079d1c660ba131e5796364bcdc899f21
BLAKE2b-256 d25f2096a998291a204864c3df3334979842b4434ce705d213095025bb6adc6e

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b9a8628c64f9d44260f0e595f67af1fb9f7aed81152adefe70257c5100c79838
MD5 47ed4a32c6351ce36400cc367c61b7a6
BLAKE2b-256 70091205e55328dcbba495e79311f39086b5b1841089c4dfa01f80d773db9c85

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 28ead37ef6dc930112cd36a97a6a33123598cd4050c8aeda3cb988f4f019ee77
MD5 bf8176c62a81473e48cdaefd98068ece
BLAKE2b-256 f7422e2e08d8e09f303f9cea2dc5a8f47d21891cb165e3ec14fad7f71d558dbe

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c9281799591a2142d090658ba55dc35aa7b809f8888e859378e5ca3e6af25b12
MD5 0dda3d9472e0be8e24c15fdac8aa60fd
BLAKE2b-256 15f1e3588050dac164936386077afc106d7bd38f21a20c1ce5351674e422006d

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp311-cp311-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 e672cbef58bdfa9e9f4b8378a1fb246008ffb18431f77a15aa7882952d03e8ea
MD5 c2fc4ead2b7f721d9899009098183a3f
BLAKE2b-256 07addd8e48c5806f66984e0fb031617a8661c88abaf3edcd388a0abd8d3e1679

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fc3ee4d8d1e2b7e1d3362f05538f1ca82c00e900169a955880a0e3bf144b2ab9
MD5 ac435cac75dc2ef11fc175d50681dc10
BLAKE2b-256 e0f20ee051ff840b87633d4d49b56c9f3161cfa516dc92ba2312e092453f473f

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 75c02ef63cf078d28a3806c41a2809110f16ce5204a6daafbc07b8f49a0d502f
MD5 2869ef8350f457220c2922b795b52235
BLAKE2b-256 524472d2b25be7e9533dfe6a92c3b244854ad62c19ceb98950a9fd26351251e8

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 34b9f0db00884f819bc1cd2560a672ebc8b572d0f693bcabedd4a4872bd393c4
MD5 f0ef1c4a9af9da756ed655eb0c709b3f
BLAKE2b-256 4a7662dae60e2b80bce1d3e4418e1bfc6e3947dd7e9e6f612445479cf46958dc

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6a3a2c98a64e2d00b0240f95646a0fc3086439ba298c63470f75bbba9e7efafb
MD5 45869adeb6175e9ce00df029769d7535
BLAKE2b-256 536b1c03831f890efb739bb65f53a80377d54851250d8a7fcaead8421b95050f

See more details on using hashes here.

File details

Details for the file dwave_optimization-0.7.3-cp310-cp310-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for dwave_optimization-0.7.3-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 e86299b33740cbc66c9cff1822e199a9e79128d1f1f235f9f114f63a5a44b626
MD5 22aa207ebacdcb828c743fd7ffd4fb31
BLAKE2b-256 3d5137f532470c27d50557b3391337a31278602978decd45566a00722ce2c7a4

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 Sentry Error logging StatusPage Status page