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.2.tar.gz (535.1 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.2-cp314-cp314t-win_amd64.whl (9.6 MB view details)

Uploaded CPython 3.14tWindows x86-64

dwave_optimization-0.7.2-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.7 MB view details)

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

dwave_optimization-0.7.2-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (16.0 MB view details)

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

dwave_optimization-0.7.2-cp314-cp314t-macosx_11_0_arm64.whl (22.1 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

dwave_optimization-0.7.2-cp314-cp314t-macosx_10_15_x86_64.whl (22.2 MB view details)

Uploaded CPython 3.14tmacOS 10.15+ x86-64

dwave_optimization-0.7.2-cp312-abi3-win_amd64.whl (9.1 MB view details)

Uploaded CPython 3.12+Windows x86-64

dwave_optimization-0.7.2-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.2 MB view details)

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

dwave_optimization-0.7.2-cp312-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (15.5 MB view details)

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

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

Uploaded CPython 3.12+macOS 11.0+ ARM64

dwave_optimization-0.7.2-cp312-abi3-macosx_10_13_x86_64.whl (22.0 MB view details)

Uploaded CPython 3.12+macOS 10.13+ x86-64

dwave_optimization-0.7.2-cp311-cp311-win_amd64.whl (9.2 MB view details)

Uploaded CPython 3.11Windows x86-64

dwave_optimization-0.7.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.7 MB view details)

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

dwave_optimization-0.7.2-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (16.1 MB view details)

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

dwave_optimization-0.7.2-cp311-cp311-macosx_11_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

dwave_optimization-0.7.2-cp311-cp311-macosx_10_13_x86_64.whl (22.1 MB view details)

Uploaded CPython 3.11macOS 10.13+ x86-64

dwave_optimization-0.7.2-cp310-cp310-win_amd64.whl (9.2 MB view details)

Uploaded CPython 3.10Windows x86-64

dwave_optimization-0.7.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (15.6 MB view details)

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

dwave_optimization-0.7.2-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (16.0 MB view details)

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

dwave_optimization-0.7.2-cp310-cp310-macosx_11_0_arm64.whl (22.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

dwave_optimization-0.7.2-cp310-cp310-macosx_10_13_x86_64.whl (22.1 MB view details)

Uploaded CPython 3.10macOS 10.13+ x86-64

File details

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

File metadata

  • Download URL: dwave_optimization-0.7.2.tar.gz
  • Upload date:
  • Size: 535.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for dwave_optimization-0.7.2.tar.gz
Algorithm Hash digest
SHA256 c8bd908c4714a0036a8710ad27840b5226c3b3cdd9f85f5176149b7db3a4ace3
MD5 d7cf7428c80ea085194376838abdd0d5
BLAKE2b-256 cb1f2b087974549022ee9f2a5dcd8aa9efd4c182ba9394628ecd52bf3d119e03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 1888bfc2436e805e88f95b8089332423097d670f735d4f7c558401a8cb4647f1
MD5 b4578fbe3f546d1482d2c0005baff8c0
BLAKE2b-256 2b7e4e454a4e578602b67194af03ffa23e808cfedfc971ef9a55894903d140d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 06b611d7593c9ac6a304188e16d7002cd653bcd0f7b6521f65ba53fbe66e7c96
MD5 9318e22e479f71a78678be83aade4279
BLAKE2b-256 e1f2caea0866c9629643ad4708def21bd7a81511b7dd18dbe704619dd3235bb8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0d053bb34efa8c636023c3b4d5f353c5fd4457501c7540485c1e4b1ac9f98456
MD5 b079c3667fd8fca9fd6a1c869952b6e7
BLAKE2b-256 f1a6309d45c3423a711d5ddcb4794dc8b8396fe4d4a044382605e6e39673691f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bfa0f6e45dbbe6b312f49475dce6d213eb6ae3aad1bf0b008b21693529524d96
MD5 66c7f7d950e68b279c575b470b258262
BLAKE2b-256 84a16b4bc86d9ccf2ae9c03d3e4bb8b199f6eaf6be569ccd9f35dd651577fa83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp314-cp314t-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 94ec6abf61506b4c0cb3284972ffb96fb81762ebb4a358a64cfccc45fcc09e54
MD5 5eeb16d86362f7ac17b8d8bf53aa269b
BLAKE2b-256 c7fa2bdf20fcad1ba6f2fbc4436c886697c50c8d3383839f810dd5a6f4d6358f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3db5bf6d45a3c954c0cccbade6f3d0f9ca94393a2bd6dfddad53c8541db7b586
MD5 2278a18f928cdb521bf45a557d881c63
BLAKE2b-256 b7d7c2e2664ab2d62cd80bdd3119dcae95b48b4b2f2acc5ae5a59a7a1126273e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6b24e228a9c19a724a7eeec9c31fa31378e28477fc35a5510db95c9becaa1d4a
MD5 0343056837c3c7809c223b385a7fa499
BLAKE2b-256 283a0d20f459887ccc5b999b886ba0eb4e14cf211f7cad9af010e78326d600fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp312-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3c7d4f1c9cd688b6e3c87b3e75b128c1f167fab740baff7afabee848f9afa4ce
MD5 94746dd89053123fd752fa87e463c2e4
BLAKE2b-256 406469ff31974f2f0a7f13ef37cac7499a1d177d5ed24fb20244a558e125bc3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 49aa03fad7429d27c1279586216c44585a6a281718bcb217521b3cbdfc42e8a8
MD5 8398ef9fadd3b3c2420546902c0c6548
BLAKE2b-256 1b68497c2d1b3e465b0aba163e6f6d045f50e7df0326ecae616e67cc6ae95396

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp312-abi3-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 dee9f0f56dc319d891427985ab880786e567ac69cf1a66c2843cb0dfad27d332
MD5 6c933ee438c5b838f8a9b7de1d2a6150
BLAKE2b-256 69b1e275c8b47d63acf6b13416e76f6701b72acf406741cb83caecedaa2656e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 9598e6eac23bd43d71a9844fce4668139dc5709e4695c78c17a29cbd2eb9df05
MD5 972e7d905db61396b0f0996f5f359e2f
BLAKE2b-256 2e6f0670765f5716e5e460efbdcaffa51d6a7ecb913329ce4e85b3b407995904

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2f0b619309b0e9ac67e3a6a7221d9f2ce04d0b5c96c512b6130ab7c813e265ae
MD5 4ed830ca6a236ccf500b7d0b7128a574
BLAKE2b-256 c622dae0f9428fab29d83e5b52104c0737397466c4bcab4fc2d1ca370f9718b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 416c7a06944693ff4c9340f60f510d9294d1d393b718b539f51f12e3ecbac177
MD5 9f7c3e6243181de5bbca3a1ce203013f
BLAKE2b-256 642d62310184622e49d32870c07e6c4c2f8aca709193be4939d93daaf4a95315

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 373cfa7296025a120b24ac0dd1d14f590d22fc19c49f50164b40bcbf060d2964
MD5 d62b960105f63d7f0878fe83d0ac86bf
BLAKE2b-256 a16796be9dfb0832cc7274353b6597d68b784dbc95d7f56c0a8b30d972e68351

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 a5092e1393b443d2abe2ac7addcf43dbcbedad5e2f25ddba92aa9094d6079a61
MD5 83b4a53553eccd5ec8c1bf5c161d4de5
BLAKE2b-256 c04091670e95ccd2c8aa304ed7dfdbf3240125d336c941e203a0a64d048ecdf4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8ebc246a14ee5be1b1d02663feea3059901f434cd18468e1cf0429bde05a81ae
MD5 9b07bad207d46d2cebd67e73b92e35ac
BLAKE2b-256 5a6c596a89cde4acead4105ca3e85f2f94c072dbb1fa7324e27148989fd57719

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7f77640f7105feab59f63b6abe93f9b27dbe924201fa5ee000596ec790f47d1a
MD5 8f5d764c0a030a516ab85523c4e719af
BLAKE2b-256 13aa3f30eb9cdc5a0bf800cd282de5b3a3dd36db7a3e27a7c12ee6785019e3b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3b258b5ad6fecc8e53ce42ef817c00c83c643b7fc3ddd2ca6893308972f255bf
MD5 4dd83a2847821d4d9a316f8d5ea81cad
BLAKE2b-256 2e8356888c5502618395448ef4ab7055c550e60adbea8c3e10c3aecc89ac2e35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 573640ea68ccf158d6aed056d66aeb0b36c494b07c16a6e1bbb8b5738ec53da5
MD5 b9a5825793f492c831c1d8ff02d0b9e1
BLAKE2b-256 245cfaf04ae60476b0b14f7efa171e66ddffe1d0ffa3adc07b24199165d63121

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dwave_optimization-0.7.2-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 e45a16a656d509be6150a01945a930f537b4c9355416c9fe059fde6f8e84ddd5
MD5 2775215f27bc3a95aa0d5438ff1cc52e
BLAKE2b-256 47724a503548cdc7eff3ec043eaf2cf0915f2b8fba4a70fe94e37202a532e963

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