Dimod

Latest version: v0.12.18

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 12 of 27

0.10.0.dev9

0.10.0.dev8

New Features

- Add <span class="title-ref">bin_packing</span>, <span class="title-ref">knapsack</span> and <span class="title-ref">multi_knapsack</span> constrained quadratic model generators.

<!-- -->

- Add `BinaryQuadraticModel.is_almost_equal` method for testing approximate equality to other binary quadratic models.

<!-- -->

- Add `Variables.copy` method, implemented as a `cpdef` method for Cython and Python access.

<!-- -->

- Support specifying lower and upper bounds for integer variables in quadratic models:

> - Add `lower_bound` and `upper_bound` keyword arguments to `QuadraticModel.add_variable`.
> - Add `QuadraticModel.lower_bound` and `QuadraticModel.upper_bound` methods.

Upgrade Notes

- Remove `dimod.utils.LockableDict` and `dimod.decorators.lockable_method`. Also `SampleSet.is_writeable` can no longer be set to `False`.

Deprecation Notes

- `AdjVectorBQM` and `AdjDictBQM` are deprecated and will be removed in dimod 0.11.0. Use `BinaryQuadraticModel` with `dtype=np.float64` and `dtype=object` respectively.

<!-- -->

- `SampleSet.is_writeable` is deprecated and now always returns True.

Bug Fixes

- Add support for <span class="title-ref">AdjVectorBQM</span> and <span class="title-ref">AdjDictBQM</span> in <span class="title-ref">ConstrainedQuadraticModel</span>.

<!-- -->

- Fix shallow copies of `Variables` objects when using `copy.copy`.

<!-- -->

- Implement rule of five for `dimod::NeighborhoodIterator`, `dimod::ConstNeighborhoodIterator`, and `dimod::ConstQuadraticIterator`. This fixes double frees caused by the default copy constructor copying information that is not intended to be shared.

<!-- -->

- Fix shallow copies of `BinaryQuadraticModel` with `object` dtype when using `copy.copy`.

0.10.0.dev7

Prelude

Add <span class="title-ref">QuadraticModel</span> implementation to Python, Cython and C++. Quadratic models can be represented by a degree 2 polynomial over binary, spin and integer variables.

We began using [Reno](https://docs.openstack.org/reno/) as a changelog tool after the release of 0.10.0.dev6. Content added before that release is not included. See [releases](https://github.com/dwavesystems/dimod/releases) for previous release notes.

New Features

- Add <span class="title-ref">ConstrainedQuadraticModel.add_discrete</span> method. This allows users to create a discrete variable via a one-hot constraint. A disjoint set of discrete variables are tracked by the <span class="title-ref">CQM</span> and serialized.

<!-- -->

- Add support for quadratic model objectives and constraints in constrained quadratic models. Previously CQMs only supported binary quadratic models.

<!-- -->

- Add new <span class="title-ref">QuadraticModel</span> class for creating quadratic models.

<!-- -->

- Add <span class="title-ref">CaseLabelDQM</span> class. Provides means of labeling cases of discrete variables.

<!-- -->

- Begin using reno for changelog.

<!-- -->

- Add <span class="title-ref">BinaryQuadraticModel.add_linear_inequality_constraint</span> and <span class="title-ref">DiscreteQuadraticModel.add_linear_inequality_constraint</span> methods.

<!-- -->

- Create <span class="title-ref">dimod/libcpp.pxd</span> Cython header file. This allows user to <span class="title-ref">cimport</span> C++ classes and functions defined in <span class="title-ref">dimod/include/</span>

<!-- -->

- Use C++ <span class="title-ref">BinaryQuadraticModel</span> rather than <span class="title-ref">AdjVectorBQM</span> as the underlying object in <span class="title-ref">cyDiscreteQuadraticModel</span>. This means that the underlying implementation is now version controlled.

<!-- -->

- Add new <span class="title-ref">Vartype.INTEGER</span> variable type.

<!-- -->

- Add <span class="title-ref">QuadraticModelBase::scale</span> method. Scales offset, linear biases, and quadratic biases by a provided scale factor.

Upgrade Notes

- Symbolically multiplying, subtracting and adding <span class="title-ref">BinaryQuadraticModel\`s with different vartypes now creates a \`QuadraticModel</span> rather than raising an error.

<!-- -->

- Use C++ <span class="title-ref">BinaryQuadraticModel</span> rather than <span class="title-ref">AdjVectorBQM</span> as the underlying object in <span class="title-ref">cyDiscreteQuadraticModel</span>. Any code that relied on the old <span class="title-ref">AdjVectorBQM</span> implementation will need to be upgraded.

<!-- -->

- Make <span class="title-ref">dimod.vartypes.ExtendedVartype</span> an alias for <span class="title-ref">dimod.vartypes.Vartype</span>. Also remove <span class="title-ref">ExtendedVartypeLike</span> from <span class="title-ref">dimod.vartypes</span> and <span class="title-ref">dimod.typing</span>.

Bug Fixes

- Fix subtracting a <span class="title-ref">BinaryQuadraticModel</span> from a number. Before it would return <span class="title-ref">bqm - 1</span> rather than correctly returning <span class="title-ref">1 - bqm</span>.

<!-- -->

- Stop using deprecated numpy aliases like <span class="title-ref">np.int</span>, <span class="title-ref">np.float</span>, and <span class="title-ref">np.complex</span>.

0.10.0.dev6

Changes
-------
* Promote `dimod.binary.binary_quadratic_model.BinaryQuadraticModek` to the top-level `dimod` namespace and remove `dimod.binary_quadratic_model.BinaryQuadraticModel` 847

Fixes
-----
* Fix issue where `Variables._relabel` mislabeled other variables a0791b0

0.10.0.dev5

New Features
------------
* Add `add_bqm` method to C++ BinaryQuadraticModel https://github.com/dwavesystems/dimod/pull/821, https://github.com/dwavesystems/dimod/pull/823
* Add `Structured.valid_bqm_graph` method for verifying input problem structure https://github.com/dwavesystems/dimod/pull/832
* Reimplement `BinaryQuadraticModel` to use new C++ code https://github.com/dwavesystems/dimod/pull/828
* `BinaryQuadraticModel` can now be manipulated symbolically https://github.com/dwavesystems/dimod/pull/834
* `load` function can now load all model types https://github.com/dwavesystems/dimod/pull/841, https://github.com/dwavesystems/dimod/pull/843
* `DiscreteQuadraticModel` now has an `.offset` attribute https://github.com/dwavesystems/dimod/pull/838
* Add `ConstrainedQuadraticModel` class https://github.com/dwavesystems/dimod/pull/839
* Add `make_header`, `read_header` and `write_header` utility functions https://github.com/dwavesystems/dimod/pull/842
* Add `ExactDQMSampler` https://github.com/dwavesystems/dimod/pull/820

Fix
---
* Fix type promotions in binary quadratic models with object biases https://github.com/dwavesystems/dimod/pull/836

0.10.0.dev4

New Features
------------
* Support PEP518 for building the package https://github.com/dwavesystems/dimod/pull/814
* Add `cyVariables.size()` and `.at(..)` to improve cython access to the `Variables` object
* Add new `QuadraticModelBase` and `BinaryQuadraticModel` implementation in c++ https://github.com/dwavesystems/dimod/pull/818, https://github.com/dwavesystems/dimod/pull/819

Fixes
-----
* Fix broken documentation links https://github.com/dwavesystems/dimod/pull/815

Page 12 of 27

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.