Dwave-ocean-sdk

Latest version: v8.0.0

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

Scan your dependencies

Page 16 of 29

0.12.6

New Features

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

- Allow discrete constraints added by `ConstrainedQuadraticModel.add_discrete()` to have zero or one variables.

- Add `dimod::ConstrainedQuadraticModel::constraints()` method that returns a view of the constraints that is easily iterated over.

- Improve the performance of fixing and removing variables from constrained quadratic model expressions.

- Implement the `Expression::fix_variable()` C++ method. Previously it would throw `std::logic_error("not implemented - fix_variable")`.

- Improve the performance of `ConstrainedQuadraticModel.fix_variable()` and `ConstrainedQuadraticModel.fix_variables()`.

- Add `inplace` keyword argument to `ConstrainedQuadraticModel.fix_variables()`.

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

Upgrade Notes

- Remove the undocumented `cyConstrainedQuadraticModel.add_variable()` method.

- Add an overload to the C++ `QuadraticModel::remove_variable()` method. This is binary compatible, but it makes `&remove_variable` ambiguous.

- The `ConstrainedQuadraticModel.fix_variables()` function now returns a `ConstrainedQuadraticModel` rather than an empty dictionary.

- Change `lp.load()` and `lp.loads()` to raise a `ValueErrorr` rather than a `RuntimeError` when given an invalid file format.

- Make `beta_range`, `num_reads`, and `num_sweeps` keyword-only arguments for `SimulatedAnnealingSampler.sample()`.

- Make `num_reads` and `seed` keyword-only arguments for `RandomSampler.sample()`.

- Make `initial_states`, `initial_states_generator`, `num_reads` and `seed` keyword-only arguments for `IdentitySampler.sample()`.

- Make `rtol` and `atol` keyword-only arguments for `ExactCQMSolver.sample_cqm()`.

Bug Fixes

- Fix `ConstrainedQuadraticModel.add_variable()` to raise a `ValueError` when given an inconsistent variable type. Previously it incorrectly raised a `TypeError`.

- Fix `ConstrainedQuadraticModel.add_variable()` to raise a `ValueError` when given invalid variable bounds.

- Fix `lp.load()` and `lp.loads()` functions to correctly handle maximization objectives. See [\1321](https://github.com/dwavesystems/dimod/issues/1321).

0.12.3

New Features

- Add `compress` keyword argument to `ConstrainedQuadraticModel.to_file()`.

<!-- -->

- Add `ConstraintView.set_weight()` method. This allows users to set the weight of existing constraints.

Upgrade Notes

- When the constraint is hard, `ConstraintView.penalty()` now returns `None`. Previously it would return either `'linear'` or `'quadratic'`.

Bug Fixes

- Fix the `copy` keyword argument of `ConstrainedQuadraticModel.add_constraint_from_model()`. Previously it would always make a copy.

<!-- -->

- Add missing `include` in `dimod/include/dimod/abc.h`.

<!-- -->

- Fix `ConstrainedQuadraticModel.add_constraint_from_iterable()` to no longer raise a `NotImplementedError` when given a weight.

<!-- -->

- Fix `ConstrainedQuadraticModel.add_constraint()` to raise a `ValueError` rather than a `NotImplementedError` when given an invalid penalty.

0.12.2

New Features

- Implement `Expression::remove_variable()` method in the C++ code.

<!-- -->

- Implement `Expression.remove_variable()` method in the Python code.

<!-- -->

- Add `dimod/libcpp/expression.pxd` and `dimod/libcpp/constraint.pxd`.

0.12.1

Bug Fixes

- Add the ability to set offsets on `ObjectiveView` and `ConstraintView`. This was previously removed in dimod 0.12.0. See [1287](https://github.com/dwavesystems/dimod/issues/1287)

<!-- -->

- Add `ObjectiveView.add_linear_from()` and `ConstraintView.add_linear_from()` methods. These were previously removed in dimod 0.12.0.

<!-- -->

- Add `ObjectiveView.add_variable()` and `ConstraintView.add_variable()` methods. These were previously removed in dimod 0.12.0.

0.12.0

Prelude

The entire C++ library has been rewritten for performance and consistency.

New Features

- New `dimod::abc::QuadraticModelBase` abstract base class.

<!-- -->

- Better performance for linear models.

<!-- -->

- Add `dimod.cyqmbase.cyQMBase_template` Cython class to serve as an abstract base class for Cython quadratic models.

<!-- -->

- Break `dimod/libcpp.pxd` into a full Cython subpackage to mirror the structure under `dimod/include/`. This allows for better organization, and less need to recompile all Cython files when changing parts of the C++ library. Packages that depend on dimod are still encouraged to use the `from dimod.libcpp cimport ...` syntax.

<!-- -->

- Build wheels for Python 3.11.

- Add C++ `dimod::ConstrainedQuadraticModel` class.

<!-- -->

- Add C++ `ConstrainedQuadraticModel.add_constraint()` overload that allows a user to move a binary quadratic model or quadratic model as a constraint.

<!-- -->

- Add C++ `ConstrainedQuadraticModel.constraint_weak_ptr()` method.

<!-- -->

- Make `BinaryQuadraticModel.vartype` callable. This allows for more uniform syntax between binary quadratic models, quadratic models and constrained quadratic models.

<!-- -->

- Replace current `ConstrainedQuadraticModel` implementation with one implemented in Cython.

<!-- -->

- Add `ConstrainedQuadraticModel.clear()` method.

Bug Fixes

- Fix a performance regression introduced in 0.10.0 when loading linear binary quadratic models from files.

<!-- -->

- Fix the handling of self-loops in `dimod::Expression::add_quadratic()` and similar methods.

<!-- -->

- Fix C++ `ConstrainedQuadraticModel.remove_variable()` method. Previously it would segmentation fault.

Upgrade Notes

- Rewrite `dimod::QuadraticModelBase` and move it to `dimod::abc::QuadraticModelBase` in `abc.h`.

<!-- -->

- Move `dimod::Vartype`, `dimod::vartype_info`, and `` dimod::vartype_limits` to ``vartypes.h\`\`.

<!-- -->

- Remove the `dimod::Neighborhood` class.

<!-- -->

- Remove `iterators.h`.

<!-- -->

- Move `dimod::BinaryQuadraticModel` to `binary_quadratic_model.h`.

<!-- -->

- Remove `dimod.binary.cybqm.cyBQMBase` class.

<!-- -->

- Remove `dimod.quadratic.cyqm.cyQMBase` class.

<!-- -->

- Build `manylinux2014` wheels. Previously we built `manylinux2010`.

<!-- -->

- Build `arm64` and `x86_64` wheels for macos. Previously we built `x86_64` and `universal2`.

Deprecation Notes

- Deprecate the `cascade` keyword argument in `ConstrainedQuadraticModel.fix_variable()`.

<!-- -->

- Deprecate the `cascade` keyword argument in `ConstrainedQuadraticModel.fix_variables()`.

0.11.6

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.

Page 16 of 29

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.