Dimod

Latest version: v0.12.15

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

Scan your dependencies

Page 8 of 26

0.11.0rc0

Prelude

Add support for real-valued variables.

New Features

- Improved deprecation warnings and documentation. See [192](https://github.com/dwavesystems/dwave-ocean-sdk/issues/192).

<!-- -->

- Add C++ `Vartype::REAL`, a new variable type for real-valued variables.

<!-- -->

- Support variables with `Vartype::REAL` in C++ `QuadraticModel`.

<!-- -->

- Add `Vartype.REAL`, a new variable type for real-valued variables.

<!-- -->

- Add `Real()` and `Reals()` functions for creating quadratic models with a single real-valued variable.

<!-- -->

- Support variables with `Vartype.REAL` in `QuadraticModel`.

<!-- -->

- `ConstrainedQuadraticModel.to_file()` now uses serialization format 1.3. This format is backwards compatibile.

<!-- -->

- Add `vartype` and `linear_only` arguments to `ConstrainedQuadraticModel.num_biases()`.

<!-- -->

- Add `vartype` and `include_objective` arguments to `ConstrainedQuadraticModel.num_quadratic_variables()`.

Upgrade Notes

- Remove `.vartypes`, `.lower_bounds`, and `.upper_bounds` attributes from `ConstrainedQuadraticModel.variables`. These were previously deprecated in dimod 0.10.6.

<!-- -->

- Remove `.vartype()` method from `ConstrainedQuadraticModel.variables`. It was previously deprecated in dimod 0.10.6.

<!-- -->

- Remove `bqm_index_labelled_input` decorator. It was previously deprecated in dimod 0.10.8.

<!-- -->

- Remove `SampleSet.is_writeable` attribute.

<!-- -->

- Remove `dimod.generators.knapsack()`. It was previously deprecated in dimod 0.10.6.

<!-- -->

- Remove `dimod.generators.multi_knapsack()`. It was previously deprecated in dimod 0.10.6.

<!-- -->

- Remove `dimod.generators.bin_packing()`. It was previously deprecated in dimod 0.10.6.

<!-- -->

- Remove `HigherOrderComposite.sample_ising()` method. It was previously scheduled to be removed in dimod 0.10.0.

<!-- -->

- Remove `PolySampler.sample()`, `PolySampler.sample_ising()`, and `PolySampler.sample_qubo()` methods. These were previously scheduled to be removed in dimod 0.10.0.

<!-- -->

- `AdjVectorBQM` and `AdjDictBQM` are now aliases for `BinaryQuadraticModel` and `DictBQM` respectively rather than having their own implementation with a slightly different API. They were previously deprecated in dimod 0.10.0.

<!-- -->

- The `dimod.bqm` namespace has been removed.

<!-- -->

- The `dimod.core.bqm` namespace has been removed.

<!-- -->

- `dimod::AdjVectorBQM` has been removed from the C++ code.

<!-- -->

- Some composites were migrated to [dwave-preprocessing](https://github.com/dwavesystems/dwave-preprocessing) in dimod0.10.0. Trying to import and use these composites from dimod now raises an exception rather than a warning. The affected composites:
- `ClipComposite`
- `ConnectedComponentsComposite`
- `FixedVariableComposite`
- `RoofDualityComposite`
- `ScaleComposite`
- `SpinReversalTransformComposite`

<!-- -->

- The `fix_variables()` was migrated to [dwave-preprocessing](https://github.com/dwavesystems/dwave-preprocessing) in dimod 0.10.0. Trying to import and use it now raises an exception rather than a warning.

<!-- -->

- Packages that require binary compatibility with dimod and that were compiled with 0.10.0 will not work with 0.11.0.

Deprecation Notes

- In the future, `ConstrainedQuadraticModel.num_quadratic_variables()` will also include the objective towards the count by default.

Bug Fixes

- Fixes performance regression on energy calculations introduced in 0.10.0. See [1025](https://github.com/dwavesystems/dimod/issues/1025)

0.11.0.dev0

Prelude

Add support for real-valued variables.

New Features

- Add C++ `Vartype::REAL`, a new variable type for real-valued variables.

<!-- -->

- Support variables with `Vartype::REAL` in C++ `QuadraticModel`.

<!-- -->

- Add `Vartype.REAL`, a new variable type for real-valued variables.

<!-- -->

- Add `Real()` and `Reals()` functions for creating quadratic models with a single real-valued variable.

<!-- -->

- Support variables with `Vartype.REAL` in `QuadraticModel`.

<!-- -->

- `ConstrainedQuadraticModel.to_file()` now uses serialization format 1.3. This format is backwards compatibile.

<!-- -->

- Add `vartype` and `linear_only` arguments to `ConstrainedQuadraticModel.num_biases()`.

<!-- -->

- Add `vartype` and `include_objective` arguments to `ConstrainedQuadraticModel.num_quadratic_variables()`.

Deprecation Notes

- In the future, `ConstrainedQuadraticModel.num_quadratic_variables()` will also include the objective towards the count by default.

0.10.17

New Features

- Add `BinaryQuadraticModel::lower_bound()` and `BinaryQuadraticModel::upper_bound()` methods to the C++ code.

<!-- -->

- Improve the performance of the `QuadraticModel.update()` method.

<!-- -->

- Improve the performance of the `ConstrainedQuadraticModel.set_objective()` method.

<!-- -->

- `QuadraticModel.update()` now accepts binary quadratic models in addition to quadratic models.

<!-- -->

- Add `QuadraticModel.add_variables_from_model()` method. See [1157](https://github.com/dwavesystems/dimod/issues/1157).

0.10.16

New Features

- Add `SampleSet.from_samples_cqm()` method.

Bug Fixes

- `ExactCQMSolver.sample_cqm` now uses `SampleSet.from_samples_cqm`. This corrects a small error in the calculation of constraint satisfaction.

<!-- -->

- `dimod.generators.random_knapsack()` and `dimod.generators.random_bin_packing()` no longer use a fixed seed by default.

<!-- -->

- `ConstrainedQuadraticModel.add_discrete()`, `ConstrainedQuadraticModel.add_constraint_from_iterable()`, and `ConstrainedQuadraticModel.add_discrete_from_model()` now correctly raise an error when given a binary variable that overlaps with an existing discrete constraint. See [1149](https://github.com/dwavesystems/dimod/issues/1149).

<!-- -->

- `SampleSet.from_samples_bqm` now handles empty list input correctly.

0.10.15

Deprecation Notes

- Deprecate `cls` parameter in `dimod.serialization.coo.load()` and `dimod.serialization.coo.loads()`.

Bug Fixes

- Fix energy calculations for quadratic models with squared terms. See [1136](https://github.com/dwavesystems/dimod/issues/1136).

<!-- -->

- `dimod.serialization.fileview.load()` now correctly propagates `KeyError` from the loading function.

0.10.14

New Features

- Add `Polynomial` to `dimod.typing`.

<!-- -->

- Add `Comparison.to_polystring()` method.

<!-- -->

- Printing `Comparison` objects now returns an equation representation of the comparison as a string.

<!-- -->

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

<!-- -->

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

<!-- -->

- Add methods to report memory usage of quadratic models:

- Add `QuadraticModel.nbytes()` method.
- Add `BinaryQuadraticModel.nbytes()` method.
- Add `QuadraticModel::nbytes()` method to C++ the code.
- Add `BinaryQuadraticModel::nbytes()` method to C++ the code.

See [668](https://github.com/dwavesystems/dimod/issues/668)

Deprecation Notes

- Deprecate `cls` parameter in `dimod.generators.random.gnm_random_bqm()`, `dimod.generators.random.gnp_random_bqm()`, `dimod.generators.random.uniform()`, `dimod.generators.random.ran_r()`, `dimod.generators.random.randint()`, and `dimod.generators.random.doped()`.

Bug Fixes

- `Comparison.__repr__()` now correctly returns a representation that can be passed to `eval()`.

<!-- -->

- Fix `dimod.typing.Bias` to correctly exclude `numpy.complexfloating`.

<!-- -->

- Attempting to relabel two model variables to the same target will now correctly raise a `ValueError`. See [1110](https://github.com/dwavesystems/dimod/issues/1110).

Page 8 of 26

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.