Dimod

Latest version: v0.12.14

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

Scan your dependencies

Page 11 of 26

0.10.0

0.10.0rc1

New Features

- Add `num_quadratic_variables` to the header of the file created by `ConstrainedQuadraticModel.to_file`. This increments the version to 1.1.

<!-- -->

- You can now install preprocessing as part of the dimod install with `pip install dimod[preprocessing]`

Deprecation Notes

- Some composites have been migrated to `dwave-preprocessing`. The affected composites:

- `ClipComposite`
- `ConnectedComponentsComposite`
- `FixedVariableComposite`
- `RoofDualityComposite`
- `ScaleComposite`
- `SpinReversalTransformComposite`

you no longer can use the composites without having `dwave-preprocessing` installed. Using them with it installed results in a deprecation warning.

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

Page 11 of 26

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.