Dimod

Latest version: v0.12.18

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

Scan your dependencies

Page 11 of 27

0.10.4

Bug Fixes

- Fix `QuadraticModel.energies` when given samples with values greater than the maximum value representable by an 8 bit integer. Previously samples were incorrectly cast to 8 bit integers.

<!-- -->

- Fix energy calculation when the lower bound (lb) equals the upper bound (lb) in `DiscreteQuadraticModel.add_linear_inequality_constraint` and `BinaryQuadraticModel.add_linear_inequality_constraint`.

0.10.3

New Features

- Add `QuadraticModel.change_vartype()` method.

<!-- -->

- Add C++ `dimod::QuadraticModel::change_vartype()` method. Also add non-const versions of `dimod::QuadraticModel::vartype()`, `dimod::QuadraticModel::lower_bound()`, and `dimod::QuadraticModel::upper_bound()`.

Bug Fixes

- Fix `QuadraticModel.spin_to_binary` not correctly updating the variable type of the changed variables.

0.10.2

Bug Fixes

- Fix case where adding linear and quadratic biases whose class requires arguments on construction to a `BinaryQuadraticModel` with `object` dtype could fail.

0.10.1

New Features

- Add an optional `label` keyword argument to `ConstrainedQuadraticModel.add_discrete`. The method also now returns the assigned label, whether supplied or generated. This is consistent with `ConstrainedQuadraticModel.add_constraint`.

<!-- -->

- `cyBQM` and `cyQM` fused types can now be cimported from the `dimod` namespace.

<!-- -->

- Add `.data()` method to `cyQM_template` and `cyBQM_template` that returns a const pointer to the underlying C++ `QuadraticModel` and `BinaryQuadraticModel` respectively.

Upgrade Notes

- `BinaryQuadraticModel.data.vartype()` is now accessed as a method rather than as an attribute. This is consistent with `QuadraticModel.data.vartype()`. `BinaryQuadraticModel.vartype` is still an attribute.

<!-- -->

- `from dimod cimport cyBQM` now is a fused type containing `cyBQM_float32` and `cyBQM_float64`. You can use the `cyBQM` containing `cyAdjVectorBQM` with `from dimod.bqm cimport cyBQM`.

Bug Fixes

- Fix wrong behaviour when the lower bound (lb) equals the upper bound (lb) in `add_linear_equality_constraint`. Correct behaviour is to add constraint as eqaulity when lb is equal ub.

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.

Page 11 of 27

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.