Dimod

Latest version: v0.12.18

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

Scan your dependencies

Page 7 of 27

0.11.6.dev1

Bug Fixes

- Fix the performance of `ConstrainedQuadraticModel.from_file()` for constrained quadratic models with a large number of constraints. The poor performanc was accidentally introduced in 0.11.6.dev0.

0.11.6.dev0

New Features

- Add `Variables._remove()` method.

<!-- -->

- Added `weight` and <span class="title-ref">penalty</span> parameters on `ConstrainedQuadraticModel.add_constraint` methods to encoded weighted constraints.

<!-- -->

- Add constrained quadratic model serialization version 1.3 to support soft constraints.

0.11.5

New Features

- Add `ConstrainedQuadraticModel.is_linear()` method.

<!-- -->

- Add `ConstrainedQuadraticModel.spin_to_binary()` method.

<!-- -->

- Add `Variables._clear()` method for use by classes that have `Variables` as an attribute.

<!-- -->

- Add C++ `dimod::QuadraticModel::clear()` method.

<!-- -->

- Add C++ `dimod::BinaryQuadraticModel::clear()` method.

<!-- -->

- Add `QuadraticModel.clear()` method.

<!-- -->

- Add `BinaryQuadraticModel.clear()` method.

<!-- -->

- Add typing support for the `dimod.variables.Variables` class. See [1221](https://github.com/dwavesystems/dimod/issues/1221).

Bug Fixes

- Fix `as_samples()` when given a `SampleSet` and using the `labels_type` keyword argument. Previously it would raise a `TypeError`. This fix allows constructions like `bqm.energies(sampleset)` to function correctly.

<!-- -->

- Refactor `dimod.typing.SamplesLike` and `dimod.typing.SampleLike`. `SampleLike` now correctly includes constructions like `([0, 1], 'ab')`.

<!-- -->

- Make `Vartype.INTEGER` and `Vartype.REAL` pickleable. This fixes the pickling of many downstream objects like `QuadraticModel` and `SampleSet`.

0.11.4

New Features

- Add `ConstrainedQuadraticModel.__str__()` method. See [1188](https://github.com/dwavesystems/dimod/issues/1188).

<!-- -->

- Speed up the construction of <span class="title-ref">Variables</span> objects from a <span class="title-ref">range</span> or another <span class="title-ref">Variables</span>.

<!-- -->

- Add optional keyword argument `labels_type` to the `as_samples()` function.

<!-- -->

- Speed up `BinaryQuadraticModel.energies()` and `QuadraticModel.energies()` in cases where the model has a small subset of the variables in the samples.

<!-- -->

- Speed up `SampleSet.from_samples_cqm()` in cases where there are constraints with a small number of variables relative to the objective.

0.11.3

New Features

- Add `dimod::QuadraticModelBase::energy()` method to `dimod/libcpp.pxd` for Cython access.

<!-- -->

- Randomly generated variable and constraint labels now begin with a letter and do not contain dashes. This ensures that they can be serialized to LP files. See [1206](https://github.com/dwavesystems/dimod/issues/1206).

Bug Fixes

- Fix `dimod.lp.dump()` and `dimod.lp.dumps()` to output bounds for REAL variables.

0.11.2

New Features

- Add `dimod.lp.dump()` and `dimod.lp.dumps()` functions to encode constrained quadratic models as LP files.

<!-- -->

- Expand supported NumPy version range to `numpy>=1.17.3,<2.0.0`

<!-- -->

- Build with [oldest-supported-numpy](https://github.com/scipy/oldest-supported-numpy) for compatibility. See [#208](https://github.com/dwavesystems/dwave-ocean-sdk/issues/208).

<!-- -->

- Add `plant_solution` keyword argument to `dimod.generators.random_nae3sat()`, `dimod.generators.random_2in4sat()` and `dimod.generators.frustrated_loop` functions.

<!-- -->

- Add `dimod::QuadraticModel::add_quadratic_back()` and `dimod::BinaryQuadraticModel::add_quadratic_back()` methods in C++ code.

<!-- -->

- Improve the performance of `QuadraticModel.from_file()`, which also improves the performance of `ConstrainedQuadraticModel.from_file()`.

Deprecation Notes

- Deprecated `planted_solution` keyword argument in `dimod.generators.frustrated_loop()`.

Bug Fixes

- Fix a performance regression to `QuadraticModel.add_linear_from()` introduced by [1170](https://github.com/dwavesystems/dimod/pull/1170) as part of the [0.11.0](https://github.com/dwavesystems/dimod/releases/tag/0.11.0) release.

Page 7 of 27

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.